News for hackers. Stuff that matters.
Re:Orthodox C++ by arcticbull on Sunday December 27, 2020 @06:01PM (#25555005)
That entire writeup is a scathing indictment of C++'s template system. It just gets progressively more horrifying and less understandable the further you read, until you're left with a mess of angle brackets, scope resolution operators and a pounding headache.
Re:Orthodox C++ by gumby on Sunday December 27, 2020 @07:06PM (#25555351)
All of that is so that most user code doesn’t have to worry about corner cases. Libraries (of all languages) are full of weird stuff so that users can blithely use them without thinking about it.
Re:Orthodox C++ by arcticbull on Sunday December 27, 2020 @07:42PM (#25555590)
Agreed, but it should be possible to read and understand. This is solidly neither.
Re:Orthodox C++ by billfruit on Monday December 28, 2020 @10:27AM (#25559898)
I should say, after a quick glance most of the stuff is only adding greater typefullness and type saftey, which IMHO is good thing, considering the total type anarchy found in most large c projects.

When some projects/domains even now prefer C to C++, aren't they trading off safety for vague expectation of greater execution speed?

Re:Orthodox C++ by gumby on Monday December 28, 2020 @10:26AM (#25559884)
The sources to glibc are no clearer, for the same reasons.
Re:Orthodox C++ by northwindfoo on Sunday December 27, 2020 @06:13PM (#25555071)
I think it goes to show that the combination of C++ giving the developer a lot of flexibility in how to approach a problem, as well as being unopinionated, leaves room for stuff like this to be built.

There are a lot of decent ways to use templates; that link is definitely not one of them.

Re:Orthodox C++ by amelius on Sunday December 27, 2020 @06:19PM (#25555105)
True. It must be said, however, that the Boost libraries are built using a peer-review system. So this is not some "random" C++ code.
Re:Orthodox C++ by eps on Sunday December 27, 2020 @08:09PM (#25555774)
It's a peer review in an echo chamber.

What Boost project churns out is absolutely terrifying in its lack of rudimentary elegance and good programming taste.

Re:Orthodox C++ by northwindfoo on Sunday December 27, 2020 @09:43PM (#25556230)
I think that about sums up my experience with boost. I've found boost to be hit and miss in terms of elegance. One of the things I've liked about the standards track is how they've cleaned up many of the same boost concepts that ultimately ended up in std.
Re:Orthodox C++ by jcelerier on Monday December 28, 2020 @08:32AM (#25559044)
So, how would you write it instead ?