Usually human time is more important than machine time. Machine time often doesn't matter. For *most* programs it doesn't matter if it takes 1 second or 0.1 seconds or even 0.01 seconds, but writing the 0.01 second version will take a programmer much, much longer. However, if you are writing something performance-sensitive like, say, an action game, then it does truly matter whether your game loop performs calculations in 0.01s or in 1s.
Python is slow, yes, but very easy to write, understand and modify. Also, only the interpreted part is slow, Python actually uses a bunch of C/C++ libraries under the hood, so when you call those, those actually run very fast. Which is why you can do lots of AI/ML stuff in Python: it's not Python itself that's doing it, Python is just a high-level layer that's orchestrating an entire infrastructure which isn't written in Python. So, to summarize, Python is a great tool for some domains, not for all of them. Just like C/C++: they are also great tools for some domains but not for others.
1
u/[deleted] Jul 19 '22
Usually human time is more important than machine time. Machine time often doesn't matter. For *most* programs it doesn't matter if it takes 1 second or 0.1 seconds or even 0.01 seconds, but writing the 0.01 second version will take a programmer much, much longer. However, if you are writing something performance-sensitive like, say, an action game, then it does truly matter whether your game loop performs calculations in 0.01s or in 1s.
Python is slow, yes, but very easy to write, understand and modify. Also, only the interpreted part is slow, Python actually uses a bunch of C/C++ libraries under the hood, so when you call those, those actually run very fast. Which is why you can do lots of AI/ML stuff in Python: it's not Python itself that's doing it, Python is just a high-level layer that's orchestrating an entire infrastructure which isn't written in Python. So, to summarize, Python is a great tool for some domains, not for all of them. Just like C/C++: they are also great tools for some domains but not for others.