Tuesday, September 12, 2006

I have to disagree with Don on the use of enums instead of booleans. Using an enum instead of a boolean may be more readable but you are bound to run into a true, false, maybe wtf.

Instead of a long parameter list I like to use a parameter object

So instead of:

string SomeStringManipulation(strInput, true, false, true, true, false)

I would use the following:

string SomeStringManipulation(StringManipulationArgs args)

Now if I want to change the number of arguments that are passed into the SomeStringManipulation function I only have to change it in one spot and the code is more maintainable.

Tuesday, September 12, 2006 6:26:38 PM (GMT Standard Time, UTC+00:00)  #    Comments [5]  | 

Theme design by Jelle Druyts

Pick a theme: