Hacker News new | ask | show | jobs
by jack_codes 1424 days ago
Maybe not a 'trick' but writing comments before I dive into the code helps me structure my thoughts and then piecemeal the work.
3 comments

Yep, I write comments to figure out what I'm doing, and then the code writes itself. It's gotten to the point where it's hard to code without writing the comment first, and usually the comment gets rewritten multiple times before I write a single line of code (thus saving me rewriting dozens of lines of code multiple times.)
I write comments and create lists for what should happen.

As I go through the list, I take the line and place it above the code.

Besides helping me go through things, it also helps anyone that comes in months after to work on it.

yep, I use them as a blueprint for what I'm going to write...
That's not necessarily a trick I meant, but definitely a good piece of advice. Do you keep them in the codebase after implementation or is it just for you while developing to sort things out?
I remove them unless they explain some of the trickiest part.