r/learnprogramming • u/Happy-GoLucky365 • 6d 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
76
Upvotes
View all comments
0
u/vegan_antitheist 6d ago
That question makes as much sens as "Why is a screw driver better than a hammer?"
This is objectively wrong. Both are Turing complete and therefore as powerful as any programming language.
The jokes are probably about how C++ allows you do write much more efficient, optimised and complex code.
C++ prioritizes performance and control. Python prioritizes simplicity and development speed. Python has less boilerplate, no explicit type declarations, automatic memory management, and a simpler syntax. This means less control and because it's higher level you can't optimise as much when you write code for the python virtual machine, while in C++ you can optimise for specific hardware.
What helps is ignoring those who just make these stupid jokes and instead concentrate on actually learning all the concepts, patterns, tools, methodologies, etc. Programming is hard. But for those who like doing it, it's a lot of fun.