Are we sure that goto is dead?
Last week, during a code review I found this code (I cut some lines to keep the post short)
// [Cut] case USER_AGENT: // [Cut]...various code.... goto default; //we want it to be added to serverVariables case CONTENT_TYPE: // [Cut]...more code (with some "if") goto default; //we want it to be added to serverVariables case USER_LANGUAGE: ParseUserLanguage(variableValue); break; default: ServerVariables.Add(variableName, variableValue); break; // [Cut]...continue...
No words.
Posted in Emanuele DelBono | 3 comments
3 Comments so far
Leave a reply
RSS



looks like it’s time to introduce some design patterns and better OO principles to your team! do some training and then challenge the team (everyone on the team) to come up with some alternative solutions to this chunk-o-code.
Yep! I absolutely will try it. If someone wrote that code means that the Code principles are not clear.
A computer scientist is someone who, when told to ‘Go to Hell’, sees the ‘go to’, rather than the destination, as harmful.