Hacker News new | ask | show | jobs
by kzhahou 3708 days ago
With all due respect to Alexandrescu's incredible C++ skills, I find that his style of programming is very detrimental to the overall quality of the C++ environment.

C++ is a very abusable language. This is reflected both in its capabilities and in the ability to shoot yourself in the foot. These points are obviously well-covered in any C++ discussion.

Now, Alexandrescu brings a style of programming in which you exploit templates, sometimes macros, operator overloading, and everything else, in order to squeeze out more generality/reusability out of a piece of code, or simplify the coder-visible syntax of some construct.

We see that right here: the above comments show a few ways to run arbitrary code on a scope exit. Each of the examples above is perfectly easy to follow along. But then the YouTube video show's Alexandrescu's take, and it's a real brain-warper. He invokes a couple of levels of C++ trickery to get his effect. Now, his end result is wonderful... but it's also not easily understandable. If you write code in his style at your job, good luck to the person that takes over your code after you leave the project. They'll have a hell of a time.

IMHO a developer should always sacrifice syntactic sugar, with no performance penalty if done correctly, in exchange for more understandable code.