3 ms·
I like about everything except the leading underscores for _fields and for __static_fields. They look really bad, a remnant of the 80s. I understand that one of
by pmontra 4y ago
I like about everything except the leading underscores for _fields and for __static_fields. They look really bad, a remnant of the 80s. I understand that one of the goals is keeping the VM small but there must be another way.
- rr888 4y agoIs it time for some new characters like an emoji to signify attributes like this?
- mgrandl 4y agoYou could setup a font with special ligatures for something like this, without changing the convention…
- dataangel 4y agoPython does it and is still very much alive. It's also idiomatic in C++.
- Cyberdog 4y agoAnd PHP still has __construct() and friends. It still looks like a remnant of the '80s, though.
- AlchemistCamp 4y agoPopularity doesn’t mean something isn’t “a remnant of the 80s”, as the previous poster put it.
- bobsomers 4y agoIt's definitely not idiomatic in C++. The standard reserves names starting with an underscore and a capital letter or containing double underscores in any scope, and identifiers beginning with an underscore in the global namespace. Most style guides I've seen that use underscores in identifier names use trailing underscores deliberately to avoid colliding with names reserved by the standard.
- agentwiggles 4y agoUgh, I hate this convention. I will grudgingly admit, after spending the last year in a C++ codebase, that it makes reading code somewhat easier to have a clear indicator of whether we're looking a class variable or not, but something about that unnecessary character bugs me.
- renox 4y agoI work in C++ and removing the confusion between local variables and class members with only one character looks to me as a very good idea!