Quality of code

Not  all code are created equal. Some pieces of code are more important than others. The code that powers critical parts of a nuclear power plant is hopefully of a much higher standard than the code behind this site, but how do you recognize which quality of code you should aim for when developing websites?

A website may not have one set level for all content – usually the various pieces which make up the site (no matter if it be classes, files or functions – in PHP). On the level you’re looking, let me suggest, for each piece you judge the required (minimum) quality on two simple parameters:

Business/Real world value: What’s the consequence if the code breaks? are you loosing money? or is it “just” an embarrassment”? The higher the stakes the more effort should be put into the code.

Scope of impact: How large a part of your website breaks if the code fails.

While you may not have a precise scientific way of measuring the two, I’m quite certain, that most developers have a pretty good gut feeling on both, and ought to be able to set a suitable quality level using just that.

Is it so or are there better ways to find acceptable quality levels?

  • Well seems like i´ve heard that before in the real world… 🙂

    It ain´t (should´nt be) difficult for developers to make the right decission in this type of case – no the real issue and the really critical part of this problem will be found by following this case:

    The Powerplant Problem:
    Reactor 1 AND reactor 2 are close to meltdown caused by two different pieces of code that can not be solved at the same time.

    Developer group – 3 persons:
    One understands both errors fully and can fix both “the right way” and estimates the fix to 1 week per reactor. 14 days not less.
    The two other deveopers could be able to fix the problem correctly – perhaps – but they don´t excatly know for how long this will take.

    The interesting part is – what will the safetyteam choose if they ONLY get 10 days before one of the reactors are melting down?

  • Well seems like i´ve heard that before in the real world… 🙂

    It ain´t (should´nt be) difficult for developers to make the right decission in this type of case – no the real issue and the really critical part of this problem will be found by following this case:

    The Powerplant Problem:
    Reactor 1 AND reactor 2 are close to meltdown caused by two different pieces of code that can not be solved at the same time.

    Developer group – 3 persons:
    One understands both errors fully and can fix both “the right way” and estimates the fix to 1 week per reactor. 14 days not less.
    The two other deveopers could be able to fix the problem correctly – perhaps – but they don´t excatly know for how long this will take.

    The interesting part is – what will the safetyteam choose if they ONLY get 10 days before one of the reactors are melting down?

  • Well seems like i´ve heard that before in the real world… 🙂

    It ain´t (should´nt be) difficult for developers to make the right decission in this type of case – no the real issue and the really critical part of this problem will be found by following this case:

    The Powerplant Problem:
    Reactor 1 AND reactor 2 are close to meltdown caused by two different pieces of code that can not be solved at the same time.

    Developer group – 3 persons:
    One understands both errors fully and can fix both “the right way” and estimates the fix to 1 week per reactor. 14 days not less.
    The two other deveopers could be able to fix the problem correctly – perhaps – but they don´t excatly know for how long this will take.

    The interesting part is – what will the safetyteam choose if they ONLY get 10 days before one of the reactors are melting down?