Ali Spittel lays out 7 excellent tips for writing cleaner code.
- Use descriptive naming
- Functions should do one thing well
- Comments should tell the "why"
It's imperative to first learn rules like these, follow them for awhile, and then (and only then) you will be equipped to know when (and when not) to break the rules.