The Builder Pattern

If you have a fairly long constructor i.e. a constructor with more than 3 arguments and there is a likelihood that constructor arguments could be passed in the wrong order, then consider introducing a parameter object or perhaps apply the builder pattern. An example of a long constructor would be: Using the builder pattern, you can construct your objects like this
Read More

Recursion

Key points to consider with recursion are base conditions and special cases. Recursive functions invoke themselves(they recurse). Iterative functions tend to be much more efficient compared to recursive functions.  Choose carefully between the two.
Read More
Top