code readability
Two definitions I picked up from one of the best courses I’ve taken.¹
- syntax: the rules that say what counts as valid code. punctuation, keywords, structure
- semantics: what that code means. what it does, what it represents
Which gave me a definition I still use: readability is syntax that makes semantics obvious.
- not imperative versus functional
- not tabs, spaces, or where the braces go
- whether a value is being moved or copied
- whether I’m holding a reference or the thing itself
- whether a loop mutates what it touches or leaves it alone
A good language makes semantics obvious. When the language won’t, I try to do it anyway.
¹ CS3110, Cornell’s OCaml course.