r/learnprogramming • • 5d ago

Why is C++ better than Python?

Hello! I am new to programming. Im in college and we use Python for my classes right now.

I hear people make a lot of jokes about how C++ is more powerful than Python, and should be used instead. But why?

Feel free to give me any tips as well, on things that helped you be a better programmer, or just any insight you may have! Thanks so much

67 Upvotes

183 comments sorted by

View all comments

Show parent comment

0

u/xarop_pa_toss 5d ago

There's always the "assembly is the real low level language" guy isn't there? The post was about the differences between C++ and Python so that's the basis for my comment. Maybe we should all just program with NAND gates...

And a beginner isn't going to understand all the stuff your said and probably not even find it. But there are nice comparisons out there that show clear differences, which leads to other explanations on compiled vs interpreted languages for example. It's not that deep man

2

u/moratnz 5d ago

Given the amount of speculative execution, memory caching etc., that goes on in modern CPUs, no languages are 'low level' in the sense that people generally mean. Even good old C is numerous abstraction layers away from what the actual hardware is doing.

1

u/CowBoyDanIndie 5d ago

Ya, no modern high power cpu runs its instructions set natively, they are all emulated by microcode.

0

u/vegan_antitheist 5d ago

C++ is a high-level programming language. That's just a fact. A high-level language provides abstractions that allow you to express computations without directly dealing with the processor's instructions and hardware details. C++ does that. Loops, variables, types, even simple operators, like a+b, are high-level. The compiler handles instruction selection, register allocation and many other hardware-specific details.

This is a fact and your down vote doesn't change that.