Here is a simple example. Say we have a function that checks if a question is visible. If it is visible does it have content. Then it returns true or falseinforms the user with an error message.
</syntaxhighlight>
Say we reuse this code about 25 times in our Form. Then the requirement changes and we need to extend the functionality to also check if there are only numbers in the box. We now have 25 functions to update, not just this one. This useful validation function uses quite a few lines of code. It can be made far more reusable by doing the following.
This useful validation function uses quite a few lines of code. It could be reusable by doing the following.=== Step 1 ===
</syntaxhighlight>
=== Step 2 ===
</syntaxhighlight>
=== Step 3 - Usage ===