Two principles of code readability I had drummed into me in my mid-20s:

1. "Comprehending" code means being able to correctly predict what it will do without running it.

2. A unit of code is "comprehensible" if you can predict what it will do without having to look inside any other units it uses. Boxes should be meaningfully labeled so you don't have to open them to see what they do.

Jason Gorman (@jasongorman@mastodon.cloud)