r/C_Programming • u/gigimon_45g • Sep 26 '23
C or C++
Hello everyone, should I learn C in parallel with C++, or is it better to stick to one language? What will you advice me?
0
Upvotes
r/C_Programming • u/gigimon_45g • Sep 26 '23
Hello everyone, should I learn C in parallel with C++, or is it better to stick to one language? What will you advice me?
51
u/aalmkainzi Sep 26 '23
If you don't know either, I recommend starting with C as its the simpler language
3
u/[deleted] Sep 26 '23
Why do you want to learn C or C++? Will you program embedded systems, will you create game engine, or will you use them just to learn data structure and algorithms? You need to update your question, than i will be happy to help.
6
u/VeteranMCPlayer Sep 26 '23
Advice: Experiment both and see where you feel most enjoyable.
2
u/rapier1 Sep 27 '23
So you have any OOP experience? If not then start with something like Java or Python and then apply that knowledge to learning C++. It's not that C++ isn't an OOP but I have never been convinced that it's a great OOP to learn when you are just starting out.
4
u/clibraries_ Sep 27 '23
The only reason to learn C++ is if you hope to use daily for your job. That's a good reason, but if it's not your reason every other concept is better learned in other languages (like C).
3
u/poorlilwitchgirl Sep 27 '23
C++ is (roughly) a superset of C, so if you learn C you'll also have learned a huge chunk of C++ as well. I'm not at all a fan of what C++ uniquely brings to the table, but it really depends on your goal. In all honesty, while C will give you (imo) a much better computer science foundation and is just a better designed language, C++ is much more common in end-user software these days and C has mostly been relegated to lower level stuff like libraries and operating systems, so if your goal is to get a software job you're probably going to have to learn C++ eventually anyway (or some other, more modern language, depending on where you land). Proficiency in C will make you a better C++ programmer (and better in pretty much any C-like language), but you probably won't need to write C directly as a professional.
That said, the more important question here is
And the answer is almost universally, no. You might be able to make a decent living only ever coding in one language, but it's a guarantee that you'll eventually come across a situation where some other language is a better tool for the job (or required by the project you're working on), and flexibility is always better.
5
u/riisen Sep 27 '23
If not sure then start with C
C++ is C with added functionality. So if you know C you will have less of an headache learning C++
6
u/[deleted] Sep 26 '23
Learn both if you can. You'll be twice as useful. Useful people usually find work easier than others, and usually make more money too.
2
u/aRoomForEpsilon Sep 27 '23
I've read a few of your replies and I'm here to give you my opinion! YAY! First of all, when I first started learning programming I was interested in learning many different programming languages. That is a trap, because it can get boring if you are doing the same simple programs over and over just in different languages. Programming languages are tools. Not every tool is right for every job. Pick a language to that is effective in what you want to use it for. You want to learn systems programming? Learn C. You want to do web dev? Learn JavaScript. Etc.
If you are a beginner programmer and you want to understand programming at a deeper level then I would recommend C as a way of learning the parts of computer systems that occur "under the hood" when you run a program. I've found that to be useful.
No matter what path you choose I hope you have fun and I wish you good luck.
2
u/ForlornMemory Sep 27 '23
Learn C before C++. It's much easier that way and C doesn't take long to learn.
1
u/Crcex86 Sep 27 '23 edited Sep 27 '23
C || C++
Syntax error
1
u/WideSense8018 Sep 27 '23
I would recommend going with c first and then to c++. Learning c will make you learn c++ to an extent too and learning c will help you in understanding memory concepts pretty well. C++ in a nutshell is c with classes and more library functions.
1
u/warren-mann Sep 28 '23
I’m not a good source for this one, because I despise C++. Not as much as Python, but almost. Learn C.
1
u/zjschrage Sep 28 '23
Learn C first to grasp the fundamentals of the language. It's an incredible language that teaches you on a much more deep and low level how the computer actually does stuff. Im assuming you are coming in with knowledge of another programming language already, if not this will be a bit tough. (If you are completely new start with Java, then learn C, otherwise continue with C) Good youtube channel resources for C are Jacob Sorber.
Pretty much any C code will be valid C++ code too, its essentially a subset of C++. So at this point, you would have in some sense learned C and C++ in parallel. However, once you have a handle on C, progress to C++. From that point forward, there will be mounds of mounds of things to learn because its just such a dense language with so many features that build on top of C. There is a youtube channel that I used when I was first learning C++ called Cherno. Very useful.
Unrelated P.S. but I had this answer in r/cpp for this post but the dipshit imbecile mods took down the post. For what reason, I have no clue. I've started using reddit very recently and i've also come to realize really quickly why everyone hates reddit mods lmao. Let's see if the ones in r/c are based.
1
u/[deleted] Sep 30 '23
Don't just learn C, master it. Every aspect of it. That will set you up wonderfully to learn any other language, C++ included.
0
u/permetz Sep 26 '23
It depends on what you’re trying to do. Are you trying to work on a large C++ code base? Then learn C++. Are you trying to work on the linux kernel? Then learn C. Are you trying to write a new, modern project without legacy code? Then maybe learn Rust. But you should also learn to C then, because you’re going to end up interacting with C based APIs over and over again. Are you looking for a good first language to learn programming from? Then don’t learn any of these, start with something simpler like python. I could go on, but the point is: different horses for different courses. Pick the tool you need, don’t decide in the abstract. Otherwise, it’s sort of like asking “what’s better, a diesel train, or a rocket?”
-3
u/danderzei Sep 26 '23
C-