Too many if statements

You could possibly use a dictionary. Dictionaries store references, which means functions are perfectly viable to use, like so: operationFuncs = { Operation.START: strategy_objects.StartObject Operation.STOP: strategy_objects.StopObject Operation.STATUS: strategy_objects.StatusObject (…) } It’s good to have a default operation just in case, so when you run it use a try except and handle the exception (ie. the … Read more

Who wrote this programing saying? “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” [closed]

I thought ChrisW’s research was right, and I tried to confirm it by doing the same thing. I found John Woods’ name in 1991 in this thread: Usage of comma operator Bill Mitchell View profile More options Sep 26 1991, 1:57 am In article <5…@ksr.com> j…@ksr.com (John F. Woods) writes: […] Always code as if … Read more