5 ms·
No; learn C, because there is a lot of C code out there, and then learn a high-level language like Haskell, Lisp, OCaml or Python. C++ is only worth knowing if
by betterunix 13y ago
No; learn C, because there is a lot of C code out there, and then learn a high-level language like Haskell, Lisp, OCaml or Python. C++ is only worth knowing if you need to maintain legacy code; if you are writing new code you should steer clear of it.
- FooBarWidget 13y agoYeah, I'm sure that Clang, the new compiler that everybody is so fond of, is "legacy code". Oh yeah, let's put Chromium, Firefox, and all of KDE on that list too. As a person who is proficient in both C and C++, I find this constant war ridiculous. Neither languages are obsolete ok? Which one is best for you depends on the circumstances. Stop speaking in absolutes.
- wrongc0ntinent 13y agoAnd tons of DSP.
- rtpg 13y agoI know people argue that it's not exactly the same, but isn't standards-compliant C accepted in C++ anyways? Why make the distinction if you're going to use a subset anyways.
- Jach 13y agoIncompatibilities Between ISO C and ISO C++: http://david.tribble.com/text/cdiffs.htm http://david.tribble.com/text/cdiffs.htm
- deleted 13y ago[deleted]
- w4rh4wk5 13y agoI am already familiar with C, as well as Python, Go, Java and a few other scripting languages.
- betterunix 13y agoThen perhaps you should take a look at a completely different paradigm e.g.: https://en.wikipedia.org/wiki/Constraint_programming https://en.wikipedia.org/wiki/Constraint_programming
- mlangdon 13y agoAs long as we're taste testing paradigms, second on the totem pole has got to functional. Can you support why the OP should look at constraint programming, or do you just wish more people would?
- betterunix 13y agoWell, look at what I replied to: "I am already familiar with C, as well as Python, Go, Java and a few other scripting languages." In terms of relevance in the real world, those languages cover pretty much all bases. The only reason I can see for learning more languages would be to learn entirely new ways to think about programming i.e. different paradigms. Functional programming is fine as far as that goes, but constraint programming is even more radically different (it is not likely to be viewed as simply a "style" of programming that can be used in C or Python), so I mentioned it.
- InTheSwiss 13y agoTo directly answer your question then: Yes. C++ is certainly something you should learn. Now only you will truly know if C++ is suitable for the tasks you do but unless you work at a university then chances are C++ will be good to great for whatever you need.
- bstamour 13y agoI tend to write a lot of systems-level code, and the reason I choose C++ over C is because C++ gives me more power to build useful abstractions, while still letting me drop down to the bit-twiddling level if I need to. I do enjoy high level languages (in particular Haskell) but C++ is still the king on my servers.
- InTheSwiss 13y agoPython yes as it is helpful in many different places but Haskell and OCaml?! I know this is HN but these languages are pretty niche and only really used to any serious degree within academia. C++ is still one of the most flexible languages for application development on every major platform and with C++11 it has had a massive resurgence. Compare how things were a few years ago to the massive amounts of work places like Microsoft are putting into their C++ technology offerings. Visual Studio 6 all the way to Visual Studio 2010 had god awful C++ support outside of what Microsoft wanted to offer. With 2012 and now 2013 things are a hell of a lot better. Check out Microsoft's GoingNative 2013 stuff. As for C it is a great language but it is pretty much only for either old stuff or system level stuff. In the real world I see people pick C++ over C if possible.
- orclev 13y agoThe point is, C is worth learning because of what it teaches you. Likewise Haskell and OCaml are worth learning because they'll make you a better programmer. C++ is only worth learning if you're looking for a career in the gaming industry and therefore need to know it to get a job. C++ is a terrible language that does pretty much everything wrong. The fact that it's only with C++11 that the language starts to become bearable should tell you something. Learning C++ will not make you a better programmer, it will make you a more employable programmer, although even there something like Java or PHP will make you a even more employable programmer. If you're doing any embedded programming you're going to be using C. C++ is pretty much exclusively used in the gaming industry, and there mostly because of historical reasons more than anything else (all the popular frameworks are written in C++).
- asynchronous13 13y ago> C++ is pretty much exclusively used in the gaming industry I'm curious how you've come to that conclusion? C++ is used in most of the major web browsers, most of the major database engines, most of the major office program suites, it's widely used at Adobe, Microsoft and Google... C++ is in the top 5 of most language popularity rankings (TIOBE, langpop). Sure, C++ has its issues, but claiming it's only used in one industry is way off base.
- nly 13y agoI think you have that backwards. If anything, C code should be considered legacy code. C++ is capable of filling all the domains C dominates.
- jpmec 13y agoNope, can't do it unless you strip out things that are inherently C++. C++ does too many things "for the programmer's benefit" to allow it to fill the domains that C is good at. They are different languages with different benefits.
- nly 13y ago> Nope, can't do it unless you strip out things that are inherently C++ It's likely that your idea of what is 'inherent' to C++ is just wrong. First of all, C++ is almost a superset of common C so, yes, it can can really replace C entirely and completely. Whatever grievances you have with the language don't change the reality that even embedded code benefits from, and has been gaining ground in, C++ for quite some time. In any case, I'm not arguing C++ is inherently 'better' than C. I'm just saying betterunix's assertion that C++ is somehow 'legacy', and C somehow isn't, is weird and illogical.
- betterunix 13y ago"I'm just saying betterunix's assertion that C++ is somehow 'legacy', and C somehow isn't, is weird and illogical." We do still have a need for a low-level language; C is not the greatest language but it gets the job done. There is also quite a bit of C code out there, proof-of-concept code, reference implementations, etc., and so not knowing C means being cut off from all of that. C++ is not as commonly used for such things, or if it is then only a minimum subset of it is used, and it has no advantage over C as a low-level language. The high-level features of C++ are polluted with low-level concerns that serve as nothing more than a distraction; this has not changed with C++11 and it does not look like it will change with C++14. So really, the only good reason to be learning C++ in this day and age is if you need to extend or maintain some part of the massive body of already-written C++ code. In other words, if you need to deal with legacy code.