logoalt Hacker News

callclast Tuesday at 10:20 PM3 repliesview on HN

I find both the golang uppercase lowercase naming scheme and python underscores for private (and __ for *extra* private) to be terrible design choices.

They are hidden functionality, a set of rules which must be remembered. “Make sure to do <weird trick> because that mean <X> in <PL>”

Leave identifier names alone. Packing extra info inside is unnecessary mental burden


Replies

mdaniellast Wednesday at 2:39 AM

Also, I recently learned that only leading __ are considered special, whereas both sets of __ go back to being a public method due to the dunder magic methods such as __add__, __eq__, etc

show 1 reply
masklinnlast Thursday at 5:15 AM

> and __ for extra private

That was never its purpose and using it that way is in fact misuse.

Name mangling was added to avoid unintentional conflicts in inheritance scenarios. That’s why it’s static, simple, and well documented.

arccylast Tuesday at 11:08 PM

the other option seems worse, i dunno if i can use this identifier unless i have an IDE or i look up the definition every time