3 ms·
I'm not angry about it but the fact that Go uses capitalization for access control is just so silly to me. Like something a child might design when figuring out
by crackrook 2y ago
I'm not angry about it but the fact that Go uses capitalization for access control is just so silly to me. Like something a child might design when figuring out how to hide secrets in a note.
- euroderf 2y agoStrong disagree. Using capitalization for access control is ridiculously obvious and simple and clear. Sure, things like "Printf" look odd for a little while.
- crackrook 2y agoWhat is it that you strongly disagree with? That it's silly? I never said it was wrong or harmful, once you know what the rule is I agree that it makes access control obvious - it's just a bit atypical for the capitalization of symbol names to be syntactically significant, no? I'm not aware of any other language that does this. It's common for other languages to use underscores to indicate that something should be private, but I can't think of another example that uses either capitalization for access control or that embeds syntactic meaning in variable names. To me that makes Go unusual, and for a language that cares greatly about being accessible, unusual choices like this seem silly - not bad or foolish, necessarily - just silly. I think most people have to be told about the capitalization rule (by the compiler, docs, etc.) because the rule itself isn't that obvious to someone coming from another language, that was my experience at least, and in that sense it feels a bit like a secret handshake to me.
- euroderf 2y ago> To me that makes Go unusual, and for a language that cares greatly about being accessible, unusual choices like this seem silly I might agree with you if the UC/LC innovation were burdensome to "implement" (i.e. to remember). But, well, it's about as burdensome as understanding that on Unix, a filename that starts with a dot is normally hidden. In other words: instantly grokable and memorable.
- crackrook 2y agoI don't mean to nitpick but I'm not arguing that it's burdensome or difficult to remember. I meant it when I said: > once you know what the rule is I agree that it makes access control obvious The rule is memorable and grokable, I agree with you! I don't use "silly" to characterize it as the wrong choice, I strictly mean it's a quizzical choice. Using your hidden file analogy in Unix: if I were to invent a new file system and I decided to use lower case letters to represent hidden files instead of borrowing the "." convention, wouldn't that strike you as a silly choice given the ubiquity of Unix-like filesystems?
- euroderf 2y agoUnix has a hegemony that Go doesn't. Go can be a playground for the New Jersey Way. But sure, I'll sign on to "quizzical". Mainly I'm glad that in Go there's only two levels of visibility, not 3+. Much easier to reason about. Altho I'll admit to being confused when you mix the two levels in the names of a struct and its fields.