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

Show parent comment

1

u/heisthedarchness 4d ago

You can absolutely write a Python bootloader or OS kernel. All you need is a tool that can turn your Python bootloader or OS kernel into machine language.

You know. What a compiler does. Without a tool to translate C++ into machine language, you can't write a C++ bootloader or OS kernel.

That tool exists: it's the Python interpreter.

1

u/cmdr_iannorton 3d ago

there is no such tool, python is a high level language, it doesn't deal with machine level memory, there is no compiler that will distil your 2 line hello world python program into a raw machine level executable that doesn't rely on an OS. There are some niché boards that can run python directly, much like there are javavards, but you absolutely cant compile a python script to a bootloader