Std: Print is headed for C++23. std:cout is now a code smell
twitter.com
twitter.com
C++ is insanely bloated and complex. If there is a book distilling the best and cleanest parts of the language, I might give it another look. Haven't considered it in earnest since College.
Although, I mean, iostreams is pretty bad.
std::cout::write(myInt)
such a hard thing to write that we decided std::cout << myInt
was a better idea?However, in C++98, how else would you handle when you have an arbitrary number of things to print in a type-safe way? e.g.
cout << myInt << ": " << something << " - " << otherthing << " - " << etc << '\n';
printf is not type-safe, nor supports user defined types. I'd rather not write 8 lines of functions calls for the same thing either.I think it made some sense C++98, though it is an awful API in 2021.
Possible with preprocessor.
If I were the one designing the language, I'd have simply fixed printf to be type-safe. (e.g. via adding macro support a la Lisp)
Qt does it right: fluent-style interface which does string interpolation.
And moreover, if you want a java-like standard library that's good enough then you already have a bunch of options like Qt, Boost, POCO, etc.
Networking is an extremely standard need, making the standard library a good place for it.