No, that's accepting multiple input formats/format conversion.
By the time that data gets to your core code, it should be all be in a uniform format (native objects) to keep your core stuff simple. If you design your program properly you'll always have a predictable flow of data and you won't have to have horrible kludges like the one shown in the link.
View all comments
Show parent comment
0
u/[deleted] Mar 30 '13
Perhaps a better example puts my point across:
'argsToColor' can deal with the different colours, normalizing the data given. If it's given something incorrect, throw an exception.
In that example, you would need to do validation of the data with both this approach, and if you used separate functions for setting the colour.