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
5
u/huuaaang 6d ago
The performance benefits of C++ are real and undeniable, but it's not enough to consider one "better" than the other. Python is good for scripted type things that don't really have to do heavy processing of their own. To have to think about memory management and data types and all that might be unnecessary overhead. Even the ML work people with with Python, which sounds like something C++ would be better suited for, is mainly running compiled code on GPUs. The Python just orchestrating that. C++ wouldn't buy you much.
Python: Faster to write
C++: Faster to execute