News for hackers. Stuff that matters.
Re:Maximal Min() and Max() by jonathrg on Thursday August 08, 2024 @12:36PM (#41193419)
There is a comment purporting to show a difference between compilation speeds in C and C++ which uses iostream for the C++ example, which completely misses the point. Sure C++ has a lot of warts, but in terms of compilation speed it should be completely reasonable to use a few simple template functions.
Re:Maximal Min() and Max() by Groxx on Thursday August 08, 2024 @01:50PM (#41194293)
Yeah, that's the main thing I saw and it's just plain completely wrong. The fact that C++ can more easily bloat into large build times, and people frequently make larger-build-time projects in it, implies absolutely nothing about its behavior in replacing simple macros like max/min.

There's ample evidence that it'll build just a fast as C there, so it's not an issue in this context, and that both can build quickly with care. That's kinda the point of C++: you can write plain C code plus [this one thing] and you basically don't pay for the rest, and it generally achieves that.