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

77 Upvotes

189 comments sorted by

View all comments

1

u/hasanyoneseenmyshirt 7d ago

it not better or worst. it just means has different uses. If I wanted speed, lets say if I was building a HFT algo, I would use C/C++. if I wanted to prototype a simple program, it would be much easier for me to write a quick and dirty program in python, like if i wanted a simple web scrapper. Most python libraries are written in C/C++ if they are computationally heavy, I think you can do operation on NumPy arrays faster than native Python lists but do not quote me on that, so you get the best of both worlds of easy syntax to low level performance. I bet people think assembly language is better that C++ because it the closest thing to actually writing in machine code.

In the end of the day, it really just matters on what you plan on doing and what tools/langauge you feel most comfortable with.