Am I a bad C++ programmer for agreeing with some of it?
> 5. #pragma once: see modules. They are in fact trying to make something better. There are also some cases where you don't want/need it
The fact that modules have taken so long, and still have prominent members of the community saying they need to be sent back to the drawing board, is a legitimate criticism.
> 7. Binary file includes. Ugh this is just such a dumb idea I can't even.
It's a useful feature, much used in the language I work on, allowing you to distribute a program that needs just one or two static data files as a single executable. It's also good for packaging data as libraries: for instance, Unicode libraries need a lot of random tables and it can be convenient to store these in binary form. Having to embed binary in C/C++ syntax as, say, ICU does just adds parsing overhead at compile time for no reason.
> 9. do/while(0). What are you using macros for in 2016 (the time of writing)?
There are lots of use cases of macros, too many to list here. Templates don't always suffice.
> 11. Switch/case is stupid. No it's not. You want fall/through cases as well and if you can't see why, don't criticize. This is true in pretty much EVERY language that supports switch/case
I designed much of the pattern matching system in an industry language without fall through in switch case and I have never missed it. Nor has anyone else in the community I know of.
These are hard problems, and the things in 11, 14, and 17 are useful. Ultimately, people [on the committee and developing the language] are prioritizing what they need.
It's not a closed process; it's just a slow one.
"Pretty much every language," right? C++ is right in there with C, JavaScript, and PHP.
This is the biggest thing that is wrong with C++. Everything is always stupid human's fault. :D
This can be really useful in embedded devices where there is no file system but I don't really see the need for it to be part of the language, every time I've needed it the toolchain came with build tools to handle this.
> 11. Switch/case is stupid. No it's not. You want fall/through cases as well and if you can't see why, don't criticize. This is true in pretty much EVERY language that supports switch/case
a smarter option may have been to require an explicit break or fallthrough keyword but we're a good 40 years late.
>12. Still no strong typedefs. There are! Use the explicit keyword on a constructor definition.
Define a new wrapper class (maybe I'm missing something)? It would be a lot nicer if you could do something like `typedef explicit int FooId;`
For simple types, for which this makes most sense but from which you cannot inherit, it is a lot of work.
Unfortunately, I'm still not 100% this is what they're referring to, but I think this is it.
https://isocpp.org/files/papers/n3996.pdf
EDIT: Here it is :D
https://www.meetingcpp.com/blog/items/reflections-on-the-ref...
1. Size of a static array: Use std::array please
2. Maximum value of an enum: See reflection TS
3. Converting enum to string: ditto
4. Converting string to enum: ditto
5. #pragma once: see modules. They are in fact trying to make something better. There are also some cases where you don't want/need it
6. C99 designated initializers. They are there!
7. Binary file includes. Ugh this is just such a dumb idea I can't even. When do you want the file to load? When the executable does? What if you want to read it in chunks? This idea is not well suited for a systems-oriented language
8. FourCC codes. Again, this is a silly idea not even worth addressing. Just define it yourself. C++ is a programming language. Not your media toolkit
9. do/while(0). What are you using macros for in 2016 (the time of writing)?
10. preprocessor gripes. Stop using it! You have <type_traits> and stuff now
11. Switch/case is stupid. No it's not. You want fall/through cases as well and if you can't see why, don't criticize. This is true in pretty much EVERY language that supports switch/case
12. Still no strong typedefs. There are! Use the explicit keyword on a constructor definition.
13. Types as Primitives. See reflection TS
Basically, this feels like any other "C++ rant." Someone who didn't learn the language properly or respects what the language needs to achieve.