4 Lifeboats for Your Projects

I like the metaphor of the lifeboat used in this post written by Jacopo Romei[1]. But I want to slightly turn away from the original meaning of the post and concentrate on this sentence:

lifeboats don’t add anything up to a nice sunny sailing day

During development, there are several things that you should add and can be considered as "lifeboats".

1. Good Comments and Code Documentation

This should be obvious. It makes you save time and headaches when you need to understand quickly someone else's piece of code (or remind you why you've made that choice five years ago) while fixing a bug, adding a feature or integrating it into another project.

The faster you are in modifying your application, the happier your customer will be.

2. Add Checks for "Unexpected" Situations

We are so used to develop for modern PCs that checking for hardware limitations (out of memory, disk full, etc.) has become a far remind. But in these years a brand new class of devices with limited resources appeared: smartphones and tablets. How many time have you seen apps crashing without any notification?

But even a super-duper PC can run out memory, for example if a video editing application is running or if there is a browser with 100 open tabs. Never take for granted that all  resources are available for your process.

In few words, try to not forget that RAM and disk are not infinite.

3. Logging System

There's nothing worst than a customer that reports a crush that he's not able to reproduce. Without a logging system you cannot understand what's happened and thus you cannot fix the bug. And what's more important you cannot ensure the customer that it will never happen again.

With a well-created log file, you can reproduce the exact sequence of steps that lead to the issue and (hopefully) find the bug. Moreover, a good log may let you discover weird things that may cause future bugs (for example, a series of managed exceptions indicating that a file is corrupted or reporting a different version of a shared object).

Create meaningful logs and provide an easy way for your customers to send them to you.

4. Unit Tests

You have just added a feature, ended a refactoring session or fixed a small bug: what should you do now? Ensure that you didn't caused some side effect. And the only way is using unit tests to check every sensible piece of your code.

When you have done with these tests, you can sleep quiet.

Conclusions

None of these things will make you sell one more copy of your software, but they will help you in the future, while debugging a specific issue or adding a new function in a short time. They will make you save your time and possibly not lose a customer just because you aren't able to reproduce a bug. They will make you work better and with more confidence and peace of mind.


Cover image taken from Wikimedia Commons (public domain).


  1. Jacopo Romei: Blog, Twitter ↩︎