1. Writing out input output relations for a function with quite a few examples before actually starting to write the function. Basically writing tests. It makes you realise what the function is actually supposed to do. I learnt this from How to Design Programs (htdp) book. It was a game changer.
2. Working on Fermi Problems aka Street Fighting Mathematics. I learnt from the books of Sanjoy Mahajan. They made me much better at estimating how the output to some input may be like.
What about you?
- laying out how I'm going to program before starting
- using TDD for most bug fixes and refactoring efforts
- learning how to steal the best parts of code from other people
- code reading everyday via PRs (my mental VM is pretty close to a real VM)
- learning algorithms and data structures (at least the basics, I'm no competitive programming pro)
- learning how to do code archaeology with git blame
I write a function that does what I’m trying to accomplish, like image upload.
It’s a small part that can be reused in some bigger system.
Then make it work with a few constraints: file size, file type.
I also hardcode stuff