Walter Meester
HoogkarspelNetherlands
General information
Category:
Coding, syntax and commands
Environment versions
Network:
Windows 2003 Server
>I'm 100% with John and Craig on this. As John pointed out your parameter statement is crying out for a structure to be passed in rather than that xml stuff. A strong-typed object will ensure your param is correct and your method can do the (single) task it should be doing.
Static typed objects (note that VFP is strong typed too) only ensure that the type is according to the signature of the methods. It however says noting about whether the values of the parameters are valid.
>Also agree about the exit point. You are using return as a way of breaking out of a process when you hit a certain point. Not a good idea. Much better to set variables at each stage ( if you are checking for bad conditions there may be more than one. Even in testing it would be good to find out about all of them on one pass)
I tend to agree. Only in very exceptional circumstances (e.g. performance) I might opt for a single early bailout. IMO, its good practise to have a single return.
If find myself using the DO CASE structure a lot to avoid deep nested IFs and keep the code readable.
Walter,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only