Live data from Hacker News

Why C++ is vastly superior to C

warp.povusers.org

21–30 of 123 posts

Re: Why C++ is vastly superior to C

#21
I've found that whenever someone argues "X is best", they've only worked in projects where "X" makes sense for them. At a start up a couple of years ago, we had an intern that was all hot and bothered over C++ and boost. After he expanded is horizons to web development and investigating scripting languages, he really enjoyed Ruby.

It depends on what you are working on, the libraries and tools available, and your comfort with what languages fit that paradigm.

I use C++ and Java on a regular basis now, but prefer C for systems programming, and Python for general web/scripting stuff.

Since we need to have a nit with C++ for this thread, can someone explain to me how debugging in C++ while using templates is superior?

Re: Why C++ is vastly superior to C

#22

For some things, C++ is better than C. For some things Lisp is better than either, and for yet other things, Python is better than them all. Why are people so insistent on declaring their view is absolutely right, with no arguments, everyone else is wrong, and that one language will rule them all? Trust me. For some things I do, C is vastly superior to C++, but I'm not going to try to convince everyone that C is bett…

I don't think this article is about declaring C++ the ruler of all languages. If you have an example of C being a better fit for a problem than C++, feel free to share it.

http://www.realworldtech.com/forums/index.cfm?action=detail&...

http://thread.gmane.org/gmane.comp.version-control.git/57643...

Re: Why C++ is vastly superior to C

#23
C++ gets a bad wrap from people who have never seriously used it. I'm glad to see someone slapping back. It's a fine language that is very useful and will be for decades to come.

Re: Why C++ is vastly superior to C

#24
post #20
post #7

When the argument is that C++ has too many features that interact in unpredictable ways and are virtually impossible to get right, arguing that C++ is superior because it has more features is perhaps a fine argument in some hypothetical universe in which the primary objection to C++ is that it is missing features, but by failing to grapple with the points raised by the opposition in the real universe, you will fail t…

What are some of these C++ features that interact in unpredictable ways? Just curious.

http://yosefk.com/c++fqa/defective.html isn't strictly limited to answering that question, but it touches on it a lot.

I know I'm flinging links around a lot here, but, well, this is all well-covered ground.

Re: Why C++ is vastly superior to C

#25

Apart from "use the right tool for the job", I always did wonder how C programmers cope without the STL containers: std::vector, std::list, std::set, std::map etc. Sometimes I need to map a string to a list of numbers. std::map >. Done. All memory allocation taken care of for you as well - nothing to leak. In C, how do you get by? You either have to reinvent a red-black tree each time you want that, or use some kind…

Fair point, but in systems programming where C is used a lot, the 'system' often/usually has the abstract data types you need, or you're in a lower level enough environment that you want your own custom/hardware specific solution.

Crude example: http://kernelnewbies.org/FAQ/LinkedLists

Re: Why C++ is vastly superior to C

#26
post #22

Earlier quoted context omitted.

I don't think this article is about declaring C++ the ruler of all languages. If you have an example of C being a better fit for a problem than C++, feel free to share it.

http://www.realworldtech.com/forums/index.cfm?action=detail&... http://thread.gmane.org/gmane.comp.version-control.git/57643...

The author of the OP also has a response to your second link:

http://warp.povusers.org/OpenLetters/ResponseToTorvalds.html

Re: Why C++ is vastly superior to C

#28
post #11
post #3

I know that C++ has some pretty neat features, but I feel comfortable and productive enough in C. I have never really felt that there was anything in C++ that I just had to have. If I need to something higher level there are plenty of choices of that already, and C is a great language for extending applications done in a higher level language. I think that the author has some good points. but I think both languages h…

> If C++ was really "vastly superior" to C then why are so many people still using C and using it productively? Why are so many people using Java (perhaps even more than C and C++ combined)? Does it make a good language? Absolutely not. In the case of such simplistic languages as C and Java, it's their simplicity that makes them a popular choice. Productivity: I am not sure all the C folks are as productive as they c…

> I am not sure all the C folks are as productive as they could've been if they switched to C++. Same people.

I'm pretty sure that C folks are much more productive using C than C++. Hating the tools you are using tends to lower productivity to a halt.

Re: Why C++ is vastly superior to C

#29

For some things, C++ is better than C. For some things Lisp is better than either, and for yet other things, Python is better than them all. Why are people so insistent on declaring their view is absolutely right, with no arguments, everyone else is wrong, and that one language will rule them all? Trust me. For some things I do, C is vastly superior to C++, but I'm not going to try to convince everyone that C is bett…

I think much language criticism miss the non-technical context which influences which language is the best tool for the job. We are good at providing technical arguments (Erlang is fun if you need concurrency, C is cool if you need to get close to the metal), but there are important non-technical issues.

Things like: How many people is on the team who have to work on the code? How big is the turnover among the developers? How experienced are they? How long is the code going to live? Will some people have to jump in and fix bugs in the code on short notice?

For example, I have noticed that I prefer a nice clean dynamic language like Python when I know I am only person on the project. But in cases where I had to work on and improve code of a dubious quality, I much prefer it to be in C#, since type analysis makes it a lot easier to figure things out and refactoring in a safer way.

To put it another way: I like to work with nice clean code in Python or Haskell, but when I have to work with bad code, I prefer to work with bad C# code.

Post reply on HN