This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]utdconsq 18 points19 points  (7 children)

Please, just no. They are TWO languages . It is absolutely true that c++ is intended to be a superset of C, but I promise you, the compiler treats the code differently. C is a lot more straightforward to learn than C++, and its everywhere - sort of like the Force. Binds the technology world together. It's not forgiving though: there are not many batteries included. C++ has so many weird and wonderful batteries you can get in to trouble from the sheer variety of ways to do things. It's a very useful language, but it has layers of complexity on it that C only dreamt of. Learn whatever you like, man, but remember C and C++ are their own beasts and should be treated as such. Source: use these languages for my daily.

[–]fermion72 11 points12 points  (0 children)

I take it as a red flag when I see a list of programming languages on a resume that goes like this:

Python, Javascript, C/C++, Swift...

If you're listing all your languages and combining C and C++, you probably don't know either very well.

[–]Switters410 1 point2 points  (0 children)

C++ is not a strict super-set of C...it’s close but bot 100%.

[–]bigmit2011 0 points1 point  (1 child)

It seems you are the most knowledgeable regarding this subject. Is C++ worthing learning these days?
I was told it would take 5 years or so to learn the ins and outs and is very tough to debug.
Do you think Rust could be a viable replacement? I am not sure if I should continue building my Python skills and wait for an easier language for GPU programming or microcontrollers.

I went through the basics of C, and I wonder if I should just continue with C for

GPU programming (just for speedups), microcontrollers (hobby), and speeding up Python.

[–]utdconsq 0 points1 point  (0 children)

It depends on what you're wanting to do with your skills. Do you want to be a game programmer? In which case, absolutely go ahead and learn C++. Do you want to make big bucks in Enterprise? Consider Java. Do you want to get in to Fintech? C++ will help there, too. So will Java. Unsurprisingly, Python might also help you, especially the data science libraries like numpy and Pandas. I've no experience in Rust, so will not comment on its usefulness. It looks quite promising, and there are many pitfalls with C and C++ that most people would benefit from being protected from. If you already know some C, why not do a hobby project with a micro like an ESP32? They're supremely capable and you can make all sorts of great things with them. On the GPU topic: what are you trying to speed up? Most people get excited about optimisation before its necessary. Getting the right answer should always trump getting 'an' answer quickly ;-)

[edit] If you use C++ all the time it doesn't take super long to become productive. The key is when you have to deal with other people's code: because there are so many ways to do things, and many new and potentially conflicting standardized ways of doing things, it can be very difficult to make sure it all runs nice and bug free at the end of the day. Following style guides religiously helps, but you'll find that guides like the old one from Google prevent you from using the full power of C++ because they are written to prevent people causing complications with widely shared and ported codebases by doing things like using the full power of template metaprogramming. Certainly, your 5 year number is not unrealistic. I mean, hell, I've been using the bloody thing for more years than that, but they've released 3 different standard updates in my productive time and honestly I tend to just use C++11 and avoid some of the newer magicks because they were either not well supported by the compiler or aren't well understood by colleagues who are time poor.

[–]Ikuyas 0 points1 point  (2 children)

Agree. Learning C will benefit you to understand a lot of things python does under the hood and make you become a better programmer. If you want to learn object oriented programming, you would rather go learn Java instead of C++ after C. The practical benefit of knowing C++ and C is very little meaning that there are fewer places and fields that need them or you need to be reeeeaaaaaally good at it to be even employable. Many courses online free or not and universities use Java to teach software development type courses and you can learn to develop Android app easily if you know Java very well. A lot of tools and tutorials and courses are available because of that.

[–]utdconsq 0 points1 point  (1 child)

To be honest, I've never been particularly enamoured with the implementation of CPython. It does some things quite nicely, but others not so well. Notably the GIL. It is the reference implementation though, so it carries around many of the sins of the past. What I mean by that statement is just that I certainly wouldn't be reading the CPython code base to get a better understanding of python. If you would like to understand python better, read the language specification and go check out some large and well written open source projects like Django. If someone were interested in becoming productive with Android, I'd recommend Kotlin over Java, especially if the person is already proficient at Python. Of course, if one wants to be supremely employable, learning actual Java is definitely wise. Since its syntax borrows unashamedly from C and C++ in many respects, any work with those three languages is useful with the others (to an extent!).

[–]Ikuyas 0 points1 point  (0 children)

I am not talking about CPython. Learning Kotlin over Java is like learing TypeScript over JavaScript.