* Posts by Ian

1 publicly visible post • joined 4 Dec 2007

Bloody code!

Ian
Stop

A challenge

If (x==null) then return as the first line is only more understandable than if(x!=null) version if you do not follow the standard of a single exit point.

I use single exit point because when I return to maintain the code I do not have to follow the whole method inorder to determine the path through it. With a single exit point you always know where the code is going.

If your single exit point code is not easy to follow then the implemtation of the algorithym is bad.

I will put down a chanllenge, provide ANY NONE TRIVIAL multi exit code and I will refactor to single exit point and make it simplier and easier to maintain. Of cause because of the dificulties with Multi exit point you may have to explain what it does but then that only proves the point :)