Very often I have seen developers fix an exception by just wrapping the code into
if ( variable != null ){ Code that is depending properties/methods of the variable}
So no more null exception error, problem solved, right? Not really, so now the method is really muted, and doesn't do anything! But hey they visible exception is disappeared from the tester/user and god knows what business rules are being side stepped.
Is there any literature on this or does this have name? I have seen it to often with developers that mark a task done and move onto other tasks so they have a high completed task rate vs the developers that actually try to find why null is being passed to the method in first place, rather than just mute the method to do nothing on null input.
Aucun commentaire:
Enregistrer un commentaire