
Initialization in Go: the power of init() - RamshackleJ
http://authenticff.com/journal/go-init-and-organizing-your-webapp
======
dilap
Definitely one of the parts of Go that seems most likely to lead to regret.
Unspecified call order. Mandatory startup time penalties just for importing a
package. Blech.

(It is handy, though.)

~~~
RamshackleJ
Absolutely! its definitely a stumbling block when you first start getting into
golang.

Are the startup penalties for importing a package really that significant? Are
there ways of reducing them?

~~~
dilap
Well, it's up to the package -- you can make it as slow as you want, in theory
:).

But I confess it's just a hypothetical problem for me so far -- I haven't yet
run into trouble from it yet. I think Go's general culture of restraint and
light-weightness may help it here.

(I've had tons of problems w/ this in python, which makes me suspicious of the
feature generally.)

