News for hackers. Stuff that matters.
Re:Fun with C++26 reflection: Keyword Arguments by arjonagelhout on Monday February 10, 2025 @11:40PM (#43009031)
I do the same thing. C++’s feature is incredibly broad, and sprinkling in just a bit too much templating can result in code that is cleaner, but harder to reason about when reading it back after a month.

For example, using C++ 20 ranges over simple loops is an example of where brevity and “cleanliness” can reduce clarity because the heavy templating and operator overloading hides what the code actually does.

On the other hand, sometimes one can’t avoid the complexity when writing a library that aims to work on many platforms, and with special tricks such as SIMD, as is present in the Eigen library.

Re:Fun with C++26 reflection: Keyword Arguments by drysine on Tuesday February 11, 2025 @05:47AM (#43011292)
>hides what the code actually does.

As does any function call.

Re:Fun with C++26 reflection: Keyword Arguments by f1shy on Tuesday February 11, 2025 @07:33AM (#43012054)
God forbids! I want functions to hide HOW is it done, not WHAT. One thing is abstraction, the other is obfuscation.
Re:Fun with C++26 reflection: Keyword Arguments by drysine on Tuesday February 11, 2025 @08:11AM (#43012345)
When you add "actually" to "what" it becomes "how")

What the code using C++ ranges is doing is quite clear, but understanding how it is doing it requires some knowledge of how ranges work.