3 ms·
Single underscores outside of the global namespace are perfectly fine in C++ (_foo is a common naming notation for members). Using double underscores in identi
by gpderetta 7y ago
Single underscores outside of the global namespace are perfectly fine in C++ (_foo is a common naming notation for members).
Using double underscores in identifiers is dangerous as you risk colliding with implementation macros or builtin, but of course if you make the identifier long enough the risk is minimal.
But defining a double underscore single letter identifier and the using it for a macro is really inexcusable.
- apankrat 7y ago__f is a questionable name for a macro. But it's a petty irrelevant detail. I can't fathom how anyone could seriously see this is as a subject worthy of a prolonged discussion. The repo is a demo for a serialization technique, yet only one comment out of 30 is on that. Can't say I'm shocked, but it is moderately disappointing.
- gpderetta 7y agoWelcome to HN! That's what we like to do here. In all fairness that macro is a pretty prominent part of the library interface. (Also full disclosure, I've also used one letter macros in my c++ experiments and yes I'm moderately ashamed).
- apankrat 7y agoHeh, yeah. It wasn't this bad in 2008 when I first got here... though I suspect it's more of a language issue. C++ tends to prompt a discussion of a poorer quality. Every second person is an senior expert that feels obliged to teach everyone else the true ways of the language. Hence all the focus on irrelevant minor fluff like here. Especially evident when compared to C threads, where nitpicks are of a far better quality and actually relevant.
- ryandrake 7y agoIt takes at least two to tango. It looks like you’re responding to this criticism very defensively. An initial simple “thanks for pointing that out” response could have probably avoided the whole thread. C++ tends to bring out the language lawyers because it is such a minefield of undefined, implememtation-defines, and unspecified behavior.