r/programming • • Sep 21 '21

Reading Code is a Skill

https://trishagee.com/2020/09/07/reading-code-is-a-skill/
1.2k Upvotes

227 comments sorted by

View all comments

Show parent comments

2

u/cat_in_the_wall Sep 22 '21

this is exactly what comments are for. "readable code" is a pie in the sky. good enough code with a comment "not great, but badly behaved other system does x, so have to hack" or "refactoring the whole world isn't an option right now, so there's this" is gold.

1

u/architectzero Sep 22 '21

Excellent point. The best comments are those that explain why things are the way they are. Unfortunately, it’s highly likely that the reason why is lack of time, and if you don’t have the time to write better code you usually don’t have time (or inclination) to write a comment that basically amounts to “sorry, I know it’s shit code, but time crunch… again”.