It would make teaching C++ much easier for beginners |
I hear that one a lot. I think that's a very bad reason to put something in the standard library. The standard library does not exist to make teaching things easier.
Why should the hardware dependency be a problem? |
Lots of hardware doesn't have the capability to show graphics at all, so that's all out of the picture right from the start.
On OS and hardware stacks that can support it, you've now got the GCC (and others) standard library team having to endlessly write libraries to intereact with an endlessly changing, always updating operating system API and associated hardware. No guarantee of anything apart from the operating system API. Seems like it shouldn't be the job of the GCC maintainers to be constantly updating to match this endless array of OS APIs, but if it's in the standard, that's where we are. So we're writing a slow graphics library with minimal functionality. Can't rely on the existence of accelerated graphics hardware and drivers, so the performance will be awful. Anyone who really wants to make use of graphics will use something that actually works well with their hardware. Who exactly is this crappy, quickly fossilised graphics library for again? Oh, to make it easier for people to learn how to draw lines in C++, except that once they actually learn they'll leave the C++ standard graphics library behind fast because they get much more functionality, probably much more easily, using something made for their OS and hardware.
So yeah, it's not a problem; it just ties us to a crappy library with poor functionality, trying to meet some minimal set of functionality on all possible OSes on all possible hardwares, for no serious benefit.
Are we going to add everything to the std library so that newcomers don't have to learn what a thrid party library is? If that's the whole argument - it's to help people do things without needing a third party library - then that argument never ends, until eventually all possible libraries are in C++.
We already have simple graphics libraries that do what's needed. For the cost of a newcomer actually taking a few hours to learn what a library is and how to use it, they can have it already. The C++ library should not be a substitution for incompetent teachers.
I'm sure there are various nit-picks to be made above, but basically, my argument is that the C++ std library does not exist to cover incompetent teachers, and that a graphics library that tried to cover all possible implementations on all possible OSes on all possible hardware is going to be too bad to use seriously, and something that nobody will use seriously shouldn't go into the std library.