Hacker Newsnew | past | comments | ask | show | jobs | submit | techar's commentslogin

C++ is really horrible, everything feels like an after thought. The new unique_ptr and shared_ptr ends up with really ugly code, the concept is good but wow...

Can we move away from this horrible language already?

http://harmful.cat-v.org/software/c++/ http://harmful.cat-v.org/software/c++/coders-at-work http://harmful.cat-v.org/software/c++/linus http://harmful.cat-v.org/software/c++/rms


I don't know about your case, but most of the time I found complains like yours , is from people who never actually tried the language, or just heard a bad story or have one bad experience reading a bad legacy code.

I think Torvalds and Stallman fall in that category actually. Stallman even mention generics which C++ doesn't have and it is very different to the templates mechanism that C++ does have.

As for the people who actually uses the language (specially after C++11), most of them would tell you that there is a great subset of the language that works for them. A valid argument I have heard before is that subset is different with each people and the problem arises when maintaining somebody else code. Well that happens with every language (Have you ever had to debug a memory corruption bug in an old C code with void* all over the place? Hint: it's not pleasent )

C++ is a language that allow you to use abstractions with a very reasonable performance and very reasonable resources, and in that niche there is not a real alternative.

Yes, you can have a fine tuned VM running Java or .Net code that might be comparable with C++ but with a cost in memory. I don't think Rust or D are ready yet to be a real competitor.

So... no... we can't move away from this "horrible" language yet.


On the contrary I always heard several years ago how good it was and it was the language to rule them all. Now those years have passed and I used it extensively from time on and off, even jumping on the C++11 standard as soon as it was available to start working in. Now I know the dismal truth about the state of C++ projects.

Now the people who defend C++ or push it to every project (like in this thread) is almost always someone who sit exclusively in C++. You know, the people who think they are experts in C just because they know C++ (like in this thread)? There is the real incompetence.

I also fail to see how hunting down a memory corruption bug in C will make C++ look better, and since you mention it is legacy code it is the same in C++.

It does not matter what language I suggest, the real fact is that C++ user will use C++ for ANY project regardless. So no, we can't move away from this horrible language yet, but not for the right reasons.


> "I also fail to see how hunting down a memory corruption bug in C will make C++ look better, and since you mention it is legacy code it is the same in C++."

It doesn't, I meant it as just an example that every laguange has its own caveats.

>It does not matter what language I suggest, the real fact is that C++ user will use C++ for ANY project regardless.

That just not true in my experience. Actually none of the C++ developers that I know uses just one programming language for everything. They pick the language depending of the requeriments of the project (and that's how it should be isn't it?)


I use it a lot, and find it to be quite tolerable once you get it. Its verbosity is a wart, but it's understandable when you understand what it is. ObjC has [[similar syntactical] issues].

The trick to it is not to over-use or abuse the language's many features. I tend to write C++ that is a fairly thin layer on top of C, using the STL for data structures and algorithms but using things like my own templates very sparingly.

I like Go, but it's really only well supported server side. Rust is promising but not ready for prime time.


Go seems to be slowly replacing C for server side and commandline utilities.

Server side due to its memory safety and easy concurrency.

Commandline utilities due to its easy to distribute staticaly linked binaries.


... easy to distribute HUGE statically linked binaries. Go solved the DLL hell and/or VM platform hell problem by just punting it.

Of course, I have wondered for quite a while if it might not be interesting to do away with DLLs in favor of static linking and then use both disk and memory deduplication to handle the efficiency issues.

Of course the problem here is: what happens when a major bug like Heartbleed is found in a library used by 500 things?


> Of course the problem here is: what happens when a major bug like Heartbleed is found in a library used by 500 things?

You run away screaming. Static compilation used to be the only option 30 years ago, and there are multiple reasons why mainstream moved away from it.


C++ is a swiss army knife that works with C, which I have learned very well and have great tools for. I understand the concern, but moving away is not so simple. That being said, I prefer well-designed C-style libraries in a lot of cases, since C++ libraries often have opinionated styles (the language is huge, after all).


Just like how intelligence organizations wraps their methods with "hunting pedophiles and terrorists".


Has anyone heard of something called "ignore"? It is possible to do online.


Less possible when you're getting hundreds of messages per day on all your online accounts with eg pictures of your children leaving school or your workplace.


No that actually sounds like a really good time to start ignoring things. You don't feed the trolls, real life or internet.

What's more inflammatory, ignoring a troll after he happens to find a picture of your children, or aggressively attacking their actions on their medium of choice? Don't feed the trolls.


Reddit do not officially have such a thing. The closest would be to use a browser equipped with the Reddit Enhancement Suite.


As in ignoring by not acknowledging the messages. This is not reddit specific, but for all sites. I can demonstrate on you right now.


what do you mean? is it like facebook's "hide all from X"?


Is https://en.wikipedia.org/wiki/Facade_pattern a God class? I like the idea if it only delegates to other classes. Its downside is the dependencies to many classes.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: