FANDOM


Prefer enum types to Boolean for function parameters. Limit the use of the Boolean type to function return types.

The reason is because when you have a function call such as:

 package.Configure( handleBlock, userContext, true );

the reader has no idea what ‘true’ means. If the third parameter were of type enum, such as:

enum ConfigureExisting
{
	dontConfigureExisting,
	doConfigureExisting
}

then the client call is more legible:

 package.Configure( handleBlock, userContext, doConfigureExisting );

This page is an example of Catching defects with Patterns.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.