fixing symptoms / not problems

fixing symptoms / not problems

  • Written by
    Walter Doekes
  • Published on

Some people seem to think that fixing the symptom is fixing the problem.

import random

def return_one_of(list):
    return list[random.randint(0, len(list))]

def say_something():
    try:
        print return_one_of(["Hello World!", "Hi!", "How you doin'?"])
    except:
        return say_something()

say_something()

Gah!

This is obviously an example, but there are people who do this and claim to have “fixed the problem”.

Let me reiterate: the fact that your code does not raise any exceptions does NOT mean that it is not broken code!


Back to overview Newer post: postgres / alter column / look closer Older post: django / mongodb / manage dbshell