Some weeks ago I finished reading Clean Code by Robert C. Martin, which is something I may have spoken about already, but I can't remember. Well it was an amazingly good read and it instantly changed a lot about the way I code and even the way I think about things. At first a lot of what was mentioned in Clean Code made the optimiser in me cringe and whince. Things like putting conditionals into a separate function and so on.
But later I realised that hey, modern computers are fast enough, some wasteful practices like that aren't going to hurt too much and the saved time in development can only do good. See, the thing is that if, for example, you encapsulate conditionals in separate functions you don't only achieve greater code readability, you also get the ability to change an important part of algorithm behaviour (when to do something) by changing a single function and the change automatically propagates throughout your code.
I believe that due to my new practices of writing code cleanly I have been able to develop Twitulater as much as I have in the past twelve days. It's reached version 0.3 of all things and is fast becoming useful. So far the version update cycle, starting from 0.1, has on average been 2.5 days and that, if you ask me, is quite astounding - especially taking into account this is the first time ever of me developing in Adobe AIR.
The reason developing can be so quick once you acquire clean code practicess is mostly that, as Uncle Bob says, developers spend much more of their time reading code than they do writing it and when that code is super readable it takes much less time to read. Furthermore, due to many of his advice, the code is also much more searchable and better structured so it doesn't take as long to find what you're looking for - this especially applies to us text editor types who abhor IDE's.
There is another reason that I believe is of even greater weight, now that I keep code clean I find that I can write large chunks of code, without testing, and have it working correctly the first time it's run. With Twitulater it's happened that I wrote a hundred lines of code, ran it, and it just worked, just like that.
Now all that's left for me to do is acquire test driven development practices so I can cut my debugging time in half. Oh and if you didn't glean from the rest of this post: You want this book.
Continue reading about Clean Code and speed coding
Semantically similar articles hand-picked by GPT-4
- Unit testing is anti-productive
- 25 lessons from 25 years of coding
- Five reasons you should develop in Adobe AIR
- Simple trick that lets you code twice as fast
- Make mistakes easy to fix
Learned something new?
Read more Software Engineering Lessons from Production
I write articles with real insight into the career and skills of a modern software engineer. "Raw and honest from the heart!" as one reader described them. Fueled by lessons learned over 20 years of building production code for side-projects, small businesses, and hyper growth startups. Both successful and not.
Subscribe below 👇
Software Engineering Lessons from Production
Join Swizec's Newsletter and get insightful emails 💌 on mindsets, tactics, and technical skills for your career. Real lessons from building production software. No bullshit.
"Man, love your simple writing! Yours is the only newsletter I open and only blog that I give a fuck to read & scroll till the end. And wow always take away lessons with me. Inspiring! And very relatable. 👌"
Have a burning question that you think I can answer? Hit me up on twitter and I'll do my best.
Who am I and who do I help? I'm Swizec Teller and I turn coders into engineers with "Raw and honest from the heart!" writing. No bullshit. Real insights into the career and skills of a modern software engineer.
Want to become a true senior engineer? Take ownership, have autonomy, and be a force multiplier on your team. The Senior Engineer Mindset ebook can help 👉 swizec.com/senior-mindset. These are the shifts in mindset that unlocked my career.
Curious about Serverless and the modern backend? Check out Serverless Handbook, for frontend engineers 👉 ServerlessHandbook.dev
Want to Stop copy pasting D3 examples and create data visualizations of your own? Learn how to build scalable dataviz React components your whole team can understand with React for Data Visualization
Want to get my best emails on JavaScript, React, Serverless, Fullstack Web, or Indie Hacking? Check out swizec.com/collections
Did someone amazing share this letter with you? Wonderful! You can sign up for my weekly letters for software engineers on their path to greatness, here: swizec.com/blog
Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com
By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❤️