Live data from Hacker News

Why does everyone here seem to dislike C++?

news.ycombinator.com

21–30 of 46 posts

Re: Why does everyone here seem to dislike C++?

#21
post #8

For an EE, C++ is a pretty good language, in that it lets you get very close to the hardware. Most of the people who criticize it don't work in that world.

As a computer engineering student (the programming counterpart to electrical engineering), I still prefer C over C++. I dislike C++ because it's just so unbelievably complicated and hard to learn. There's a special place in hell for the abominations C++ calls error messages. Clang helps, but not enough unfortunately.

Im suprised that nobody has mentioned golang, which is generaly described as the successor to "c".

Re: Why does everyone here seem to dislike C++?

#22
Not everyone here dislikes C++. C++ is a good language for some things, and a bad language for others. In particular, C++ is not a good fit for web development and an especially bad fit for the type of web applications that the majority of people on HN work on. If you had asked people who make AAA games or create more performance sensitive applications you would likely see a different opinion of C++.

Re: Why does everyone here seem to dislike C++?

#23
post #2

Try learning Python, Java, Erlang/Lisp/OCaml/Haskell, Prolog, and then look back at C++. You'll see what's the reason.

This type of comment is really unproductive. Not only does it not answer the question, it dismisses it with an air of superiority. I happen to know Python, Java, Lisp, OCaml, Haskell, and Prolog, and wouldn't use anything other than C++ for my day job.

Re: Why does everyone here seem to dislike C++?

#24
I for one don't. C and C++ runs the software that runs the world. From operating systems to embedded systems to browsers to whatever you can think of. Even the interpreters/VM's of all other languages (Python/Java/Ruby/...) are written in C/C++. All other languages have about 0.1% of the impact that C and C++ has. People who love other languages hate that. And haters will be haters. I for one am super happy that people choose other languages. Please do that! Less competition for me.

Re: Why does everyone here seem to dislike C++?

#25
post #4

Compared to plain C, C++ tends to become unmaintainable. Everybody knows a tiny subset of the huge language, yet must somehow work together on a team. People do not stick to a common subset of the language that everybody is comfortable with, especially considering team members that will be hired in the future. In theory, C++ can be as fast as C. (officially lacking the "restrict" keyword, but otherwise fine) In pract…

Whether code is maintainable or not depends on the developers, not the language. I have worked on million+ line C++ projects that were very maintainable. And also on much smaller Ruby projects that were a total cluster f* and impossible to maintain. Don't blame the tools. A good developer can write excellent clean maintainable code in ANY language.

Re: Why does everyone here seem to dislike C++?

#27
For me a lot comes down to the tooling.

* How do I start a new project

* How do I build/test/cross compile the project

* How do I add dependencies and optionally vendor them

If someone could 'reboot' c++ so it ships a decent standard library and update the tooling to work something like go or rust I'd be interested.

One of the projects I've been working on in go parses some csv files, stores the data in a sql database and presents a simple http json rest api. Could I write this in c++? yes. Do I know how to do all the bullshit needed to get a c++ project going that includes csv+sql+json+http libraries? no.

Re: Why does everyone here seem to dislike C++?

#28
post #9

Apart from school, let me give you an advice. If you have a brain that can handle multiple levels of OO in c++ across multiple threads; keeping multupltformness in mind and crunching out optimized code with all that you learned in your data structure classes, stick with C++. The pay is way better (like three times more here in Toronto) than anything web or app related, the working hours are more sane, and stuff are u…

> The pay is way better (like three times more here in Toronto) than anything web or app related Web developer with 5+ years experience can expect 75K+ in Toronto (according glassdoor / reddit / google search). And both python jobs and such salaries are available. I doubt C++ developer can make 225K in Toronto. Even if some one does like you, it's an exception.

Re: Why does everyone here seem to dislike C++?

#29
When you learn/taught any new programming language you learn about the primitives of the language and how to combine them to create programs. You will create simple programs to test the understanding of the language and get used to the features of the language in terms of how to solve a problem. On the other hand, the world of professional software development is very very messy, instead of creating program you end up creating these enormous complex software systems. Most importantly its not like that you get requirements, you implement them and you are done, instead you will keep getting new requirements over time which in most cases are conflicting with the existing requirements and the system needs to keep evolving to handle this mess forever. Handling this evolution over time is the most important feature of any language/tools/platform and it seems those people who don't like C++ have been through the frustration of handling that evolution of software in C++.

Re: Why does everyone here seem to dislike C++?

#30
post #28
post #9

Apart from school, let me give you an advice. If you have a brain that can handle multiple levels of OO in c++ across multiple threads; keeping multupltformness in mind and crunching out optimized code with all that you learned in your data structure classes, stick with C++. The pay is way better (like three times more here in Toronto) than anything web or app related, the working hours are more sane, and stuff are u…

> The pay is way better (like three times more here in Toronto) than anything web or app related Web developer with 5+ years experience can expect 75K+ in Toronto (according glassdoor / reddit / google search). And both python jobs and such salaries are available. I doubt C++ developer can make 225K in Toronto. Even if some one does like you, it's an exception.

I wish I was pulling that kind of money here. From my anecdotal experience, I had friends that started at 35k/y as frontend devs, and 65k / year at IBM for c++ , both fresh out of univ. I agree that 75k with few years under the belt seems reasonable.

But, we should move to where the 225k jobs are it seems :)

Post reply on HN