3 ms·
You learn from experience. Trial and error, experiment, and mentoring. You study code that works and code that doesn’t.
by gregjor 6y ago
You learn from experience. Trial and error, experiment, and mentoring. You study code that works and code that doesn’t.
- svrma 6y agoAre there any books or resources your can suggest? I feel like my accuracy in thinking about corner cases have been stuck around 65% for a while and I'm looking for ways to improve.
- gregjor 6y agoI had to learn what we used to call “desk checking” when I started programming, out of necessity. Desk checking is reading through your code and “running” it in your head, keeping track of state on paper. You learn to notice edge cases because at every step you have to think about the next possible states. After some practice you get better at this and it becomes more automatic. This isn’t practical for large code bases, but you can do it with individual functions and chunks of code. I still work this way but I don’t think it’s a common technique anymore.
- sixstringtheory 6y agoyou can probably find some good ones here if you haven’t tried it before: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=books&sort=byPopularity&type=story https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...