Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Readable code is better than efficient code (ashlan.com)
5 points by samemail88 on July 12, 2022 | hide | past | favorite | 3 comments


100% agree. But unreadable inefficient code often exists. What then?


There can be a good intellectual challenge in refactoring code like that to be both efficient and readable (although at some extremes, and depending on the programming language, perhaps there'll be conflict between those two goals).

All the better if that refactoring is in a FOSS application/library to save other people the repeat effort (and potentially gather further improvements).

Your question reminded me of Raymond Hettinger's excellent 2015 PyCon talk about refactoring functional-but-messy Python code: https://www.youtube.com/watch?v=wf-BqAjZb8M

(as previously discussed on HN: https://news.ycombinator.com/item?id=10023818)


Unreadable inefficient code should be caught in pull requests. If its already in the code base, it should be refactored as the code gets touched.




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

Search: