Design Philosophy, what defines a bug

42 Views Asked by At

I have a problem with an older coworker and his code. He manages an old legacy project (30 years, his baby, two thirds of his career). I joined his team and searching through his sourcecode I find things like this (pseudocode):

function (String) Integer
    Int statusCode = systemRoutine ( String, ReturnInteger )
    If statusCode != Normal
         ReturnInteger = 0
    Return ReturnInteger

He has a lot of this kind of codestyle, which I call "optimistic programming", because a text "blub" should not return 0, but a runtime error. The text should be tested beforehand if it can be an Integer. He disagrees. How can I make him understand, that that leads to errors and mor bugs down the line (which it does, but he has good rapport with the clients and can work around the misshaps). What are the technical terms in programming, so I can have a basis of my criticism. He is not a trained IT-Professional, but can be reasonable if I have good arguments.

I once was tasked with building a user interface and there was a special case, where the input wasn't sth I expected, so I let my program crash. Researching this crash I was able to eliminate 2 bugs from my code and harden it against wrong inputs. The client was mad, but I know the code will be more secure in the future, but now the client thinks my programms are unstable by design.

Any input would be appreciated

0

There are 0 best solutions below