Code Smell 42 - Warnings/Strict Mode Off

Code Smell 42 - Warnings/Strict Mode Off

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

Compilers and warnings lights are there for help. Don't ignore them.


  • Missed Errors

  • Ripple Effect

  • Fail Fast


  1. Enable all warnings.

  2. Enable preconditions and assertions in production.

  3. Fail fast

  4. Design by contract

Sample Code



Most languages have warning levels. We should turn most of them ON.

We should run linters to statically analyse our code for potential problems.


  • Fail Fast


If we ignore warnings and the code moves on sooner or later it will fail.

If the software fails later it will be very difficult for us to find the root cause.

Defect will likely be near first warning and far away from the crash.

If we follow the Broken Windows Theory, we should not tolerate any warnings, so a new issue will not pass unnoticed in a sea of tolerated warnings.


More info


Photo by Noah Dominic Silvio on Unsplash

One man's crappy software is another man's full time job.

Jessica Gaston

This article is part of the CodeSmell Series.

Share this