News for hackers. Stuff that matters.
Re:Pprint: Pretty Printer for Modern C++ by phaedrus on Monday April 29, 2019 @05:16PM (#19782689)
A huge problem with cout and << is that setting flags (such as to print numbers in hex) is global and a destructive update. If you don't save the stream state beforehand and restore it you change the flags for printing in unrelated code.

So making an object for printing probably helps with scope issues like that.

Re:Pprint: Pretty Printer for Modern C++ by rsynnott on Monday April 29, 2019 @07:24PM (#19783590)
Yeah, I always wondered was << just an ill advised attempt to show off operator overloading (I’m sure things had it before C++, but it definitely wasn’t commonplace). It never made much sense to me.
Re:Pprint: Pretty Printer for Modern C++ by kabdib on Monday April 29, 2019 @10:05PM (#19784493)
They were adding features to the language (e.g., "Koenig lookup") in the CFront era to accommodate iostreams.

I was sad that they were spending a bunch of resources on that relatively useless stuff, rather than a sorely needed set of standard collection classes, not to mention a string class. And by "standard" I don't mean actual standards -- it was far too early in the game for that -- but even just enough to get by.

Re:Pprint: Pretty Printer for Modern C++ by dearrifling on Tuesday April 30, 2019 @05:52AM (#19786478)
ADL is important for customization points in modern C++.