C++ - A hated programming language

This article details the top 4 most hated programming languages

https://www.techrepublic.com/article/the-4-most-hated-programming-languages-experts-pile-on-javascript-c-and-more

These are also amongst the most popular! Linus Torvalds really puts the boot in!
THE most hated language according to the article is C, yet there is not one "expert" trashing it as there are with the other three.

Not buying the hype nor the premise.
I admit to hating java. Java has a ton of screwy, pointless limitations and not a single redeeming quality to make those bearable.

And I have a dislike for python as well simply because of the indentation syntax and the default flavor is extremely slow at everything.
Is perl still used much? I have barely heard its name in 10 years.

C++ would do well with a mass culling of obsolete and redundant stuff for sure. I get backwards compatibility, but at some point if you don't cut the cord it gets to be too much.
Last edited on
All I heard about Perl in recent times was that whatever the latest version was had been delayed for a huge while.
<obligatory Stroustrup quote about the two kinds of languages> https://stroustrup.com/quotes.html
Sometimes you need to write an article and your boss is breathing down your neck. Then you get that amazing article that seems like it was written in an hour before bed.
From Cubbi's link:

There are only two kinds of languages: the ones people complain about and the ones nobody uses.

That describes quite well my disdain for the linked article that inspired this thread.

Not that I am trying to say I know everything. I don't, not even by half.
C++ would do well with a mass culling of obsolete and redundant stuff for sure. I get backwards compatibility, but at some point if you don't cut the cord it gets to be too much.


Agree, but IMO isn't going to happen any time soon (C++2030 ??). There's way too much 'non-modern' C++ around. Then there will be the big disagreements and arguments re what is redundant etc. Don't forget this is a language now designed by committee (aka the camel)!
C++ has culled some features, std:: random_shuffle for one, as well as some C headers that weren't made compatible.

Maybe it is time to dump srand/rand for C++, even the C standard indicates it should be avoided if there are alternatives available.
jonnin wrote:
C++ would do well with a mass culling of obsolete and redundant stuff for sure. I get backwards compatibility, but at some point if you don't cut the cord it gets to be too much.


One way of doing that would be to invent a new language that is similar to C++ ..... It has already been done with the D language. D was invented to overcome the perceived problems with C++, and for a long time has features like contract programming, modules, static reflection amongst others. It has a C++ ABI, so D can be linked along with C++. It seems to be reasonably popular.
D missed the boat by having two competing and mutually incompatible standard libraries for years. It's never going to take off anymore.
Right now if there's any language that could displace C++ is Rust. If Rust can get good quality tooling it could be a serious contender.
Last edited on
Is it time for D++ to make an appearance?
Nah, it will be Dflat.
M$ is ahead of you, they want to call it C^^
I wasn't implying that D would completely displace C++. C++ is very strong, I am not proposing we abandon it en masse, rather use use some it features integrated into C++ projects.

D can interface to C, C++, and objective C

https://dlang.org/spec/interfaceToC.html
https://dlang.org/spec/cpp_interface.html
https://dlang.org/spec/objc_interface.html

D has C++ linkage, so it is possible to call D functions from C++, and C++ functions from D, same for C and Objective C, albeit with restrictions. So if one had a project where they wanted to use some D features that C++ doesn't currently have (there is quite a list of these), they could have a mixed C++/D project easily. From a cursory look at Rust, I am not sure if this could be done using Rust. Also D is rather similar to C++ in a lot of ways, whereas Rust looks rather different IMO.

I guess if one wanted to wait for a number of years, then C++ might eventually have all the features of D.

The other complication is how C++ and D might interoperate in the future. For example C++ now has modules in C++20 (implementation is in MS; g++ and clang++ not too far away), I wonder if C++ modules will interoperate with D modules. I guess if one is going to have a C++/D mixed project, then the code should at least be kept in separate translation units; there would probably be separate C++ and D modules.

Some other points about deprecation:

If there are a bunch of things that are deprecated in C++2023, doesn't that mean that one would just compile against an earlier standard to use them still?

I am hoping that production code bases have coding standards that disallow all those crappy things that we would like to be deprecated.

This forum has a lot of what I call traffic generators: they post code full of all the things that are bad form, generating replies to fix them, thereby increasing the traffic on the forum. IMO this so pervasive that we now now have the perception that C++ is taught really badly. This probably not entirely true, but perhaps the perception is worse than it should be. I met an IT guy (not a developer) who said he didn't like C++ because of having to allocate memory all the time - this does demonstrate poor or at least out of date education about C++. The other thing is that hopefully most of coders who use poor practices, aren't actually developers.

Maybe we have an increased desire to see things deprecated because we see so much code with bad form on this forum.

Anyway that is my rant for today :+)

With perl:

https://en.wikipedia.org/wiki/Perl#Applications

It is still being used for a bunch of important things, as far as I can see.
If there are a bunch of things that are deprecated in C++2023, doesn't that mean that one would just compile against an earlier standard to use them still?

so far very few things won't compile, it just warns and they still work fine.

As for the traffic gen... its a mix. Some are fake. Some are people like I was a while back, and still am in many places ... learned c++ before 98, the first stl stuff was a performance mess so we ignored it, time it matured my group was still looking at it sideways due to the initial rollout. Then got out of the language and missed 14 & 17 entirely. Whatever back story people learned what they did and some of them have missed a ton. And apparently at least a few education systems still teaches it pre 98 style due to refusing to update their plans and tools and all. Jumble it all up and here we are, trying to help and learn.



Last edited on
Compiling code that doesn't use the new spaceship operator <=> will bomb out when compiled against C++20.

Boost is being hit especially hard from what I've read because of that.

So yeah, there are a couple of serious drawbacks to pre-C++20 code when using the C++20 standard.
From Boost's 1.75.0 release notes:

Known Issues

Boost.Operators is currently incompatible with C++20 compilers, which in some cases may manifest as an infinite recursion or infinite loop in runtime when a comparison operator is called. The problem is caused by the new operator rewriting behavior introduced in C++20. As a workaround, users are advised to target C++17 or older C++ standard.


https://www.boost.org/users/history/version_1_75_0.html
@jonnin

If people posted code written in C++98, that would be a big improvement from the terrible code we often see here. There seems to be a lot of mixture of C & C++ with char arrays, pointers, while !eof etc. Even nonsense like this: double a = 1.0f;

I might even go so far to say that it is a bot doing it: there are often several posts from different users about the same type of topic; all kinds quite inventive legal but very bad form things like semicolons at the start of almost every line for instance. Now that I have mentioned that, lets see if there are any posts like that in the near future.

I find these legal but bad form code snippets so abstruse, it's hard for me to believe a beginner would somehow think them up themselves: it seems more like an experienced coder with an evil bent and access to a bot.

With all these problems we have here and with other fora, it gave rise to the invention of the Stack Overflow forum. One of the reasons I am still here is that I still learn things from users that obviously know their stuff.
Topic archived. No new replies allowed.