4 ms·
As others have said, practice! Everyone has a (few) million lines of awful code in them initially. Some recent revelations I've had in the last few years that
by tiddles 6y ago
As others have said, practice! Everyone has a (few) million lines of awful code in them initially.
Some recent revelations I've had in the last few years that I've been applying with great effect:
- Write code that's clear, not clever. Other people who will have to read and understand it (including your future self) won't be impressed by "clever" code, it just makes it way harder to understand.
- Write code to be disposable. I know for a fact that in a few months time I'll have to revisit my code to refactor or add new functionality, and writing it with mindset that it should solve only the current problem and nothing else prevents code creep/YAGNI.