Earlier this week, this excellent piece by Chris Parker made the rounds on Hacker News.
Here’s the thing: you are not ruthless enough. You are certainly not ruthless enough to your objects, and you probably need to be more ruthless to yourself.
This is true. Be ruthless. But not yet. Let’s see how Chris continues:
Being ruthless to yourself means every time you say “oh, I’ll just open up this internal bit over here…” use that moment to give yourself whatever negative feedback you need to go back and write the correct interface.
When you have an internal bit “over here”, and you have a good idea about what you’re trying to accomplish, then you should be absolutely ruthless. But when you’re first building something new, even if it’s just a new set of classes for a small feature, you should be a mild-mannered, dope-smoking, peace-loving hippy. Toss things out there. Share private internals with wild abandon. Build the messy, cobbled-together version, just to prove that it can work. Then clean it up.
Remember the old aphorism:
- Make it work
- Make it right
- Make it fast
Many people skip the second step, and they will encounter the evils that Chris explains. But other people get stuck on the first step, seeking the correct or elegant solution before they have any sense of the real problem space.
This rhythm reoccurs at all scales of the software development process. In minute-to-minute development, we can write a test, get it to pass, then refactor a little. With a small feature or bugfix, often “just do it” is the way to start - but before committing the code, review with a critical eye. At the week-to-week level, you need to mind your application architecture, but you also need to deliver real functionality and make sure that real users are happy with the software.
So be ruthless with code, not with ideas or concepts or half-formed architecture diagrams floating in your head. Produce code with joy, with courage, and (occasionally) with wild abandon - before you ruthlessly shape it into something great.