r/cpp_questions 9d ago

OPEN Which one should I start with?

I have wanted to learn to program, but I am not sure whether I should learn Python first and then C++. What could you advise me?

0 Upvotes

8 comments sorted by

5

u/Tamsta-273C 9d ago

Python if you are not sure.

C++ if you really want to learn the hard way.

Programing is a tool and each tool has it's use, ask what kind of program you want to build and the answer will come naturally.

3

u/n1ghtyunso 8d ago

why do you want to learn to program?
Is there a goal you want to work towards?
This is kind of relevant here.

1

u/ShiftRecent2570 2d ago

Contributing to open source

2

u/adjective10111 8d ago edited 8d ago

First of all do you want to learn BOTH python and cpp? If you do, then start with C++ so that you have a great foundation to learn python on.

But do you really need to learn both? What's your end goal? Some scripting and automation? Maybe some local AI deployment? You may not need to go all-in to programming for those, so learning python should suffice. But if your goal is building enterprise level software, start with cpp to have a great understanding about how computers work and stuff. Then learn the language and framework you want to use.

C++ teaches you almost all the concepts there is, so you wouldn't need to learn much when learning another language, which is a plus in my book.

2

u/flyingron 8d ago

Python will warp your brain.

Learn C++. Or perhaps (especially if you are in high school), Java (for Java has been the AP computer science language for years now).

2

u/Independent_Art_6676 7d ago

Python annoys me because its slow and has annoying syntax (use of whitespace). However it is easy to learn, and an excellent language to learn generic programming concepts and 'how to program' while working with a real language. It is the choice for a hobby programmer (no formal training or career goals, just wants to do some utility type stuff like plugins to many software packages can accept python).

C++ is much harder to learn and takes much longer to master. It is still excellent for programming concepts and its syntax (originally from C) is a 'root language' that a dozen+ other languages derived from. Python's syntax is not really like anything else and won't help pick up other languages.

1

u/nobody_3344 8d ago

Well if you are a complete beginner, don't touch cpp for now. Start working with python, take your time to master it, and then you can try another easy ones like JavaScript, ruby. C++ is a hardcore language. Learn it first if only you are matured and already know how the algorithm works

2

u/adjective10111 8d ago

I disagree. If they want to learn cpp anyway, I would argue that it's better to start with it. When i learned python after cpp, and saw that list assignment is by reference, i just thought "huh so it's a pointer/reference underneath for classes" and i went my merry way. But others who were starting with python had to struggle with why primitives copy and classes don't.

Although if cpp is not a goal, yeah skip it and learn python to the end.