top | item 20495752

(no title)

pmorais | 6 years ago

I’d argue that until C++11 C++ was /objectively/ a terrible language and the only reason people used it (and continue to use it) is because it’s nearly 40 years old and therefore ubiquitous. C++ is a language that is literally famous for being famous. I know I certainly wouldn’t be using it if I had any other viable (high performance) language with the same ecosystem, support and tooling. It’s not “battle tested” it’s just too big to fail, and therefore a lot of smart people have dedicated a lot of effort to developing tools and standards that make it just barely passable for enterprise use.

discuss

order

GuiA|6 years ago

> literally famous for being famous [...] not battle tested

> “[no other] viable high performance language with the same ecosystem, support and tooling”

This comment strikes me as deeply contradictory. I have qualms with C++ as any other C++ programmer, but saying it’s famous for being famous is just ridiculous.

C++ has been used to operate nuclear submarines, airplanes, pacemakers, financial systems, ... over the last few decades. I’d like to know what you consider “battle tested”.

pjmlp|6 years ago

C++ is part of my favourite languages list, despicte some of the flaws, which I also criticize.

I belive that if Java and .NET actually had a proper AOT toolchain since day one, instead of being commercial only (Java's case) or doing basic optimizations (NGEN), there would be even less use cases for its use.

EDIT: typo

mathw|6 years ago

I concur. I used to work with C++98 (roughly, we had some weird levels of compiler support for some of it) and it was utterly foul. The only reason to use it was that there weren't really any better alternatives at the time. We needed something relatively manageable with really high performance, and that's what we got, but my goodness was it a mess in practice.

Modern C++ is much better, unfortunately there's stuff from the past they can't ditch without breaking compatibility so it really isn't much better - yes it's got better tools, but nothing's going to make you use them unless your compiler has some clever analysis features you can turn on and do things like make raw "new" an error.

mikekchar|6 years ago

I haven't written C++ code since the 90's, but I enjoyed writing code that way. I've also written Java code and C# code (in the late 90's and early 2000's). I enjoyed C++ at least as well as those. Some things are better, some things are worse. I've been doing some Rust lately and probably I would reach for that before I would reach for C++. There's a lot I don't like about Rust. I think it would be great if someone designed a language in about 5 years from now that contains all the things learned about Rust, but was designed from the beginning to solve the problems elegantly. Still, it's a fun language to use.

For me modern C++ is interesting, but it has even more of the problems that Rust has. There are lots of good ideas that help fix problems we've seen over the last 40 years or so (man, I'm old...), but I think unless you are already a C++ programmer it's probably more convenient to start with a language that was designed from the beginning to solve those problems. If someone paid me, I'd very happily write C++ code again, though.