7 ms·
Before they heap yet more into the language, I think they need to go back to previously-standardized classes and seriously critique them, ideally replacing some
by makecheck 11y ago
Before they heap yet more into the language, I think they need to go back to previously-standardized classes and seriously critique them, ideally replacing some of them with entirely new designs.
For instance, it is crazy that something as critical and commonplace as "std::iostream" is riddled with error-prone design decisions. The "<<" operator choice is wrong, and it fails basic localization requirements before you even get into its other problems. To this day, I see people who don’t handle stream errors correctly in every case (and who can blame them, when you have stuff like “bad() is actually not the exact opposite of good()”?). Don’t even get me started on the fact that most flags have two different pairs of constants with similar names, used in different contexts, with different values, that will even compile after the wrong one has been chosen (producing who-knows-what behavior?). Or the fact that global stream states can be screwed-with from anywhere, meaning that when a library call returns you can’t be sure that your own "std::cerr" state is “undamaged”? And this is just from streams! The list goes on.