One of the first tips I give developers just starting out is not to code first. Some already get it and others give me the stink eye, at least until they hear the rationale.
It’s fun to code. And languages are powerful tools that can enable you to do anything. Especially the higher-level languages or frameworks that provide convenience utilities to say… write to an output steam and not have to worry about the buffer or garbage clean-up.
The thing is, coding can quickly go in the wrong direction. Or, even if you are on the right track, you probably don’t have the big picture worked out if you are working on anything of tangible size. So, what inevitably happens is having to rework code that doesn’t solve the problem (or rather, all the things).
My never-fail solution – write pseudo-code with pen and paper first.
This is always my first step, even with something seemingly trivial. Nothing is easier to start from, no bootstrap code required. It may not be the “fun” way to start, but I guarantee it will save effort in the long run, and enable you to build bigger, better solutions because you’ll have the pre-work to support your coding efforts.
What’s more fun than building awesome stuff in less time, and right the first time?