r/cpp • • Dec 28 '18

"Modern" C++ Lamentations

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

162 comments sorted by

View all comments

80

u/victotronics Dec 28 '18

Thought #1: C++ is starting to look like Fortran in its desire to be ever more modern while retaining compatibility with archaic features.....

Thought #2: I think I'm no beginner anymore (I've written objects that you can iterate over) but some of the code in your posting is indeed horrendous. People who understand that stuff are scary to me.

18

u/darthcoder Dec 28 '18

I agree. Its time to deprecate things. Im cool with an incompatible split.

And if we can get rid of,the preprocessor, even,betterer.

12

u/chugga_fan Dec 29 '18

And if we can get rid of,the preprocessor, even,betterer.

No, the pre-processor is useful, do YOU like importing a million things in windows.h? Do YOU need platform specific code (linux, windows, macOS)? Because both of these things require the pre-processor, and there's no way you can get rid of that without making C++ platform-independent, which is not happening.

1

u/Valmar33 Dec 30 '18

What do you think about how D solves the preprocessor problem:

https://dlang.org/articles/pretod.html

3

u/chugga_fan Dec 30 '18

D doesn't solve all the problems C preprocessor solves, although it does alleviate a lot of them (and changes them to use a different name), so... yhea.

1

u/Valmar33 Dec 30 '18

Can you name the problems not solved by D?

4

u/chugga_fan Dec 30 '18

Platform specific things that only exist in that platform is hidden behind "version", which is literally the pre-processor.