#Is a dot-import a bad practice?
21 messages · Page 1 of 1 (latest)
one way to solve that is making most of your stuff receivers
that way only place it shows is like v := mymath.NewVector() and then it's v.This() v.That()
btw... I don't know the syntax... what's dot import looking like (8 years of go, never used it)
oh interesting 
type aliases are fine, but maybe a smoke that the name of your package is not great
vector ?
or vect?
what's the f2 standing for?
fortran 2 ?
but you're on the right track, naming is hard... but "better names"
oh... that's not great name I think
well I was about to say Point but... realized it could be 2d or 3d
why not just
type Vector struct {
xi []float64
}
(though maybe you care about memory foot print)
PlanePoint vs VolPoint?
Plane implies 2 dimensional
but maybe just Point (for 2d) and Vector (for 3d)
Personally I don’t see a problem with it for some math/vector related stuff. Oftentimes math libraries can be a bit nonidiomatic to make usage and semantics easier. Just make sure to not pollute the namespace too much