Dec 31, 2018

[C++] thoughts on Aras's "Modern" C++ Lamentations

Read: http://aras-p.info/blog/2018/12/28/Modern-C-Lamentations/

Classic example for not following KISS.

'range' library is fancy due to it pushes the limits of using almost every bits of the language features,
i.e unless being a C++ language lawyer could you debug the error spit out from the compiler..

From above blog post even C# version's range code example smells bad.
(from Python's point of view, duh~)

Not only 'using the right language for the problem', but also 'using the right form of coding within the language' is important.

When decided to start a project with C++, always identifies the subset C++ features that are allowed for the project, failed doing so will definitely lead to the project's failure, which including slow compile time, hard to debug, and even worse in performance(including time-to-deliver).

Once in a while, engineers forget that when coding in C++, there's another implicit language, i.e template meta-programming, is involved. That is to say, if, as a good engineer, won't code in any language with many iterations, worst run-time algorithm, should also beware not to make the compiler coding for you fall into that situation. And yet this needs a bit of knowledge/wisdom.

This also indicates the bar of hiring qualified engineers for a C++ project is higher than using other languages, with other languages , e.g Golang, no matter how bad code is written, it just works, as for C++, it just doesn't :-P (https://en.wikipedia.org/wiki/Heisenbug bombs)

Follow up:
http://www.elbeno.com/blog/?p=1598

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.