You heard this before: “The code should be its own documentation”. I don’t like this phrase. There is some truth to it, but I don’t feel it’s completely accurate. It misses some cases where the code is not, and should not, be its own documentation. When the code is the documentation? Documentation adds complexity to […]
Clean Code
You’re not shipping your computer
Not all computers are the same. Here, you are entitled to go Duuuh!, but bear with me. What works on some computers, does not always work on the others. Why does it happen ? And more importantly, what can you do to protect yourself ? Over the years I spent a lot of time on […]
Can you have code comments and clean code ?
Comments have the programming world divided. There are those who argue that you don’t need comments, code should be self-explanatory and you shouldn’t need to add anything. In the other corner, there are those who like to add their fair share of code comments. I want to share some code comments best practices with you. The […]
How to do code reviews
You have just been assigned to review the code your team wrote. This sounds like a challenge. Here are some quite reasonable questions you might have: What do I have to do ? What am I looking for ? Am I doing this thing right ? I’m going to try to answer these questions in […]
What are code reviews: just the essentials ?
Code reviews, also known as peer reviews, are a process in which another person, or several other persons, have a look at your code and give suggestions for improvements and spot potential issues before they cause actual problems for real people. Now, I feel obligated to mention that code reviews are only one of many […]
How to step up your automated tests game
This is a follow-up of my previous post here. If you’ve ever had to write automated tests, you might have some bad memories lingering around. Automated tests have a way of becoming troublesome as time goes by. You end up spending more time fixing the tests than adding actual features. When that happens, you don’t care […]
Testable code design patterns
As you might have realized by now if you follow this little blog (and you should), I’m a huge fan of automated tests. If you’re not, I assume it’s because you either don’t find them useful, or you find them hard to add. Tests are useful because code breaks. My code, his code, everyone’s code […]
Be a more productive coder – Some metrics you should use
What does make a good coder ? Is it the number of lines of code they write in a day ? How about the number of work hours they put in the office? Maybe it’s how fast they code, how quickly they solve any given issue? Well, as you might have guessed by now, I […]
How to write better code – 6 things I did not found on the first page of google search results
I know there are millions of answers to this question (I for one get 484,000,000 hits on google when I search for How to write better code). They all seem to revolve around the same general idea, so I will not be repeating that. You are free to do a google search yourself and read through those. […]
Dealing with legacy code – the bane of our existence
Unless you are really, and I mean really, lucky, you are bound to be stuck on a legacy project with a thousand-year-old codebase. Maybe not a thousand years, but close enough. If it’s any like the code I have been working on, it’s big, really big, it’s complicated, no one really understands how it fully […]