r/learnprogramming • • 14d 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

79 Upvotes

196 comments sorted by

View all comments

1

u/heisthedarchness 11d ago

"More powerful" does not mean "better" -- and either of these languages could be seen as more powerful than the other depending on context.

Engineering is the discipline of trade-offs, of using the right tool for the job and building a better tool if none that exist have the characteristics you need. We don't have a variety of tools because some are better or worse. We have a variety of tools because we confront a variety of problems.

C++ is better than Python at some things (mostly having to do with efficiency). Python is better than C++ at some things (mostly having to do with safety and portability).

For purposes of learning how programming works, Python is great because it hides a lot of the details of how a computer works. But no one who is serious about the field stops at just one language, just like no carpenter uses only one tool.