by dietrichepp · 10y ago · 0 comments
This isn't something like threading or filesystem access where we need to put it in the standard library because it abstracts platform differences. This isn't something like std::unordered_map or std::sort where it's so universally useful that we want to put it in the standard library. No, this is extra functionality that should be in a third-party library.
Honestly, it worries me a little bit that such a prominent member of the C++ committee came up with such an ill-advised proposal, and it makes me worry that the success of C++11 has gone to their heads. What I don't understand is why someone would even be unhappy that this is not part of the standard library, since this kind of stuff has been available in third-party libraries for years. You shouldn't be clamoring for inclusion in the C++ standard, you should be calling for better third-party library support in your tooling!
Besides, there are parts of even the current standard that are broken enough to demand some replacements and deprecations. For example, "std::string" and "std::iostream" are pretty awkwardly implemented and it would be really nice to have something better.
This. Honestly after C++11 the stuff they're adding is scarcely useful, it mostly just complicates the language itself even more than it currently is. They're trying to change the way you write C++ code without removing support for the old ways. I feel like they should make a new language instead of adding mostly useless things/stuff that barely anybody will use (could be also because barely anybody will know of that feature's existance)
That being said: I don't think that a graphics is a good addition to the standard library. It would tremendously difficult to standardize this for the reasons others have mentioned.
I think that graphics would be a great addition to the standard library. However, it will be tremendously difficult to create a good API that is simple to use for simple cases, yet doesn't limit one to the simple cases, and is flexible enough to fit a wide range of devices and OSes with their favorite graphics libraries.
Web developers want all browsers to support CSS, canvas and SVG, so that their applications port easily between platforms.
Why wouldn't C++ developers get it as easy?
First thing to spend a lot of time on would be what one means with 'graphics'. 2D? 3D? Static or also animated? Windowing system included?
I would go for 2D, static, no windowing system, certainly in the first version. That already could be very useful. Imagine having a standardized way to query what bitmap graphics formats the OS supports, and to easily read and write them.
Also imagine writing a plotting package on top of such a library. Porting it between various OSes would be way simpler than it is now.
But as I said: designing this will be very difficult.
YMMV, depending on your field, of course.
I've also wondered why so many random number generators and math libraries are being standardized. Maybe there's a good reason for them to be in the standard, but I haven't heard one yet.