3 ms·
Well, if your main argument against C++ is undefined order of static initialization amd that it caught you by surprise, then I'd counter that by saying that you
by gmueckl 9y ago
Well, if your main argument against C++ is undefined order of static initialization amd that it caught you by surprise, then I'd counter that by saying that you do not know the language very well. This is very well known behaviour.
I think that there are stronger arguments against C++: the continued presence of the complete C preprocessor restricting the effectiveness of automatic refactoring, the sometimes extremely cumbersome template syntax, SFINAE as a feature, no modules (yet!)...
Still, C++ hits a sweet spot between allowing nasty hardware-related programming hacks and useful abstractions in the program design.
- bb88 9y ago> ...then I'd counter that by saying that you do not know the language very well. This is very well known behaviour. So parsing your sentence. I'm right, and you're blaming me for not knowing a language as expertly as you. I can live with that. Edited to add: I admit it's a little snarky perhaps, but the c++ standard is 1300 pages long. It took my browser in 2018 1 minute to open it. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3797.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n379... I really do not have time to read a document like that to figure out whether or not that behavior is spelled out in the standard. So yes, I'll let you be the expert on this.
- gmueckl 9y agoSorry if the statement offended you. It came from the experience that I so far haven't encountered anyone who seriously uses C++ and does not know about the undefined order of static initialization. Also, I haven't yet had a situation where this was a big deal. There are worse pitfalls than unstable order with static initializers specifically. If you dynamically load shared libraries at runtme on Linux, you risk static initializers being run multiple times for the same library. This is platform specific behavior that is AFAIK present on other UNIX systems as well and I'm certain that you won't find that in the standard.
- bb88 9y ago> Sorry if the statement offended you. It came from the experience that I so far haven't encountered anyone who seriously uses C++ and does not know about the undefined order of static initialization. Water under the bridge. While I did say I was brought in to fix it, what I didn't say was that the group's management thought that Java coders could code in C++. D'oh.
- deleted 9y ago[deleted]
- Shikadi 9y agoIt's worth noting that most language standards are of similar length