Live data from Hacker News

Popular Myths about C++, Part 3

isocpp.org

1–10 of 114 posts

Re: Popular Myths about C++, Part 3

#2
> “To understand C++, you must first learn C”

> “C++ is an Object-Oriented Language”

> “For reliable software, you need Garbage Collection”

> “For efficiency, you must write low-level code”

> “C++ is for large, complicated, programs only”

Well, 2.5/5 of those aren't myths. You certainly don't need to write low-level code for efficiency, C++ does a rather poor job of acting like an OO language, and you don't need Garbage Collection, you just need to not manage memory manually, for which solutions other than GCs exist.

You don't have to learn all of C to write C++, but unfortunately you have to learn C to understand other people's C++, because other people will not restrict themselves to the subset of C++ you consider respectable. That's true both for the C bits of C++ and for the obscenely complex corners of C++.

And C++ isn't just for large, complicated programs; it's for small, complicated programs too.

Re: Popular Myths about C++, Part 3

#3
In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely indefensible. It is almost 2015, why are we even talking about it? C++ was a mistake. A bad detour on the highway of computing.

Re: Popular Myths about C++, Part 3

#4

In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely indefensible. It is almost 2015, why are we even talking about it? C++ was a mistake. A bad detour on the highway of computing.

[deleted]

Re: Popular Myths about C++, Part 3

#5

In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely indefensible. It is almost 2015, why are we even talking about it? C++ was a mistake. A bad detour on the highway of computing.

So what's an alternative?

Re: Popular Myths about C++, Part 3

#8

In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely indefensible. It is almost 2015, why are we even talking about it? C++ was a mistake. A bad detour on the highway of computing.

Because C++11.

Re: Popular Myths about C++, Part 3

#9
post #7

The C greater function is unnecessarily long int greater(const void* p, const void* q) { return *(double *)p - *(double *)q; } would work just as well. EDIT: DON'T USE THIS, WONT ALWAYS WORK

That is technically undefined behavior, because the result of the double subtraction could very well be a number that is not representable within the range of a signed int.

Re: Popular Myths about C++, Part 3

#10

In 1995 C++ it wasn't a good choice. In 2000 it was a poor decision in most cases. In 2005 it was a bad decision in almost every case. In 2010 it was completely indefensible. It is almost 2015, why are we even talking about it? C++ was a mistake. A bad detour on the highway of computing.

So what's an alternative?

"C++ sucks" has become a bit of a meme around here. The upsides outweigh the downsides for a surprising number of cases. Every alternative is either immature, doesn't solve the use case that needs C++ or doesn't have the required libraries/tools.
Post reply on HN