News for hackers. Stuff that matters.
Re:Practical Go: Real-world advice for writing maintainable ... by akerl_ on Thursday February 21, 2019 @02:26PM (#19219776)
The issue w/ calling it "config" is that you end up with the confusing scenario where "config" is the object and "Config" is the type, differing only in casing.
Re:Practical Go: Real-world advice for writing maintainable ... by pcwalton on Thursday February 21, 2019 @02:48PM (#19219940)
Why is that confusing? Local variables are, idiomatically, never capitalized in Go, so the distinction is obvious at a glance.
Re:Practical Go: Real-world advice for writing maintainable ... by akerl_ on Thursday February 21, 2019 @04:05PM (#19220577)
Sorry. To clarify: it's not that I'm confused by the distinction between capitalized vs uncapitalized, it's that visually, "config" and "Config" look quite similar at a glance, whereas "c" and "Config" are clearly visually distinct.
Re:Practical Go: Real-world advice for writing maintainable ... by rat9988 on Thursday February 21, 2019 @02:53PM (#19219990)
As are unexported objects.
Re:Practical Go: Real-world advice for writing maintainable ... by ben0x539 on Thursday February 21, 2019 @02:55PM (#19220009)
Yeah, getting to idiomatically capitalize names has been pressure to move them to their own package in the past, which feels awkward.
Re:Practical Go: Real-world advice for writing maintainable ... by bpicolo on Thursday February 21, 2019 @09:16PM (#19222555)
This is a fairly go-specific issue due to its unexported vs exported convention. Many languages solve this through case conventions