Clever code feels good to write and terrible to maintain. Here’s how I aim for clarity instead.
Name things well
Good names remove the need for comments. If a function needs a paragraph to explain it, it probably needs a better name or a smaller scope.
Keep functions small
A function should do one thing at one level of abstraction. When it grows, extract.
Make the common case obvious
Optimize the reading path for the 90% case. Push edge cases to the edges.
Readable code is a gift to your teammates — and to yourself.