Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sloppy code would be using the wrong data structures and algorithms. Sloppy code would be optimizing nothing at all.

If you write things with good big O performance, for almost all of your lines of code you're done. It will perform fine.

Bloated messes don't come from writing a bunch of business logic in python instead of C, not while processors are this many orders of magnitude faster than they used to be. They comes from layers and layers of abstractions, or doing things completely the wrong way.



But if you're processing 10's of thousands of records in an O(n) loop, it will still be 10's of thousands of times slower than processing a single record in that loop. i.e. having good big O still doesn't mean the code will be fast.


Are you saying this is a scenario where O(1) is possible? Then "good big O" is O(1). Code that is O(n) is a mistake.

If you're saying the fastest method is O(n), then sure, no method can guarantee fast processing of the entire list. But that fact sure isn't python's fault!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: