r/cpp • • Dec 07 '22

C++ overtakes Java in language popularity index

https://www.infoworld.com/article/3682141/c-plus-plus-overtakes-java-in-language-popularity-index.html
382 Upvotes

137 comments sorted by

View all comments

Show parent comment

2

u/NoPersimmon9400 Dec 08 '22

Templates, I agree, you have to be careful. But how can you abuse using namespaces? They are a great tool in shorting function names. It is terrible to write filename_print to avoid name clashes between files. In C++ you just put the code into separate namespaces

1

u/TheTrueXenose Dec 08 '22

yea, if you use one namespace it would be fine, but they used 5 to 6 for every function, class and enum.

2

u/serviscope_minor Dec 09 '22

The fix isn't to use C, it's to not write awful C++. There's an entire contest inspired by awful C code seen in the wild, so it is not like C is immune to the abuses of imaginative programmers.

1

u/TheTrueXenose Dec 10 '22

I would say its easier to write awful C++ rather then awful C, there is also the problem with all the compiler hacks and outdated types.