Is it normal to forget how your own code works?
1 min readJan 10, 2018
Absolutely! You should always view your future self like a complete stranger reading and trying to understand your code. And you should act accordingly today, to spare your future self some headaches.
What you can do
- Write tests that document your intentions
- Refactor mercilessly to always have the simplest possible code fulfil the current requirements
- Use self-explaining names for variables, methods, classes. Don’t abbreviate!
- Don’t use cool programming language tricks. Err on the side of longer but more descriptive code
- Use common design patterns as a kind of meta language
- Comment sparsely! Too many and long comments are usually a sign of unreadable code (readable code needs very few comments)
- And a lot more …