DEV Community

Discussion on: Wishful Coding

Collapse
 
jon_cage profile image
Jon Cage

I often do this but I take one more step back; Write the overall method that will do the job but fill it with comments indicating my intentions before I actually write the code. I find this really helps make you think about what you need before you commit to decided on the specifics of what you're going to implement.

For something really trivial like your example above, writing it in code works but in more complicated situations it can be another helpful trick to break a problem down.