Hacker News new | ask | show | jobs
by edw 2155 days ago
Assembly code making poor choices can be outperformed by Python code making smart algorithmic choices. The sentiment behind "don't use Python for performance critical code" isn't wrong, but there's nuance. Programmers should make informed choices about space and time complexity regardless of the language being used.

Your typical assembly programmer may be far more aware of their obligation to do so than your typical Python programmer, so in my mind it's more important that languages occupying Python's ecological niche behave predictably. It can be challenging to balance that need against other constraints like limiting the number of abstractions someone needs to master in order to be productive.

1 comments

Sure assembly is overkill for most tasks, but Python's performance is so poor that you can sometimes write a brute-force double loop on C++ and have it outperform anything in native Python.

Sometimes raw performance does save developer time, because you don't have to worry that much about algorithm. :)

Preaching to the choir. It amazes me that the ML and Data Science folks have settled on anti-FORTRAN. (Or maybe, put that way, it’s less amazing.)