Re:Golang 1.4 Internal Packages
by georgemcbay on Wednesday June 25, 2014 @02:13PM
(#7945747)
You say ad-hoc and hackish, I say simple and practical.
Simple is not always good.
As the quote (attributed to Einstein IIRC) goes: "You must strive to make things as simple as possible -- but no simpler than that".
This is, I think, something "simpler" than simple ("simpleton"?).
Which languages have solved this problem?
All languages that don't tie visibility rules to the name of the variable/function? Even C++ applies IIRC.
The mechanism for specifying visibility has nothing to do with the issue.
The Java approach for standard packages is nearly identical to what's proposed for Go. Anything in the com.sun. (or whatever they call it now) namespace is considered internal, even though it's publically accessible.
This is so basic and has been solved by other languages so long ago that it's quite strange to see Go had to reach 1.4, and 5+ years of age to get this...
...and in quite an ad-hoc and hackish way -- which means you're tied to a directory hierarchy.