Improve Your Methods Definition (Part 3)
Improving methods definition would dramatically enhance your code readability and maintainability. The following are major practices that need to be considered while defining your methods. Parameters & Overload Methods Before digging deep, we need to define in brief what an overload method is. Basically, an overload method is having two or more methods within the same class, whereas these methods share the same exact name but differs from each other in one or more of the following: Parameters data types. Number of parameters. Order of parameters. So initially, and based on the previous definition, overload methods are all about changing the signature of a method based on the manipulation in its passed parameters, which would lead – if not used properly and wisely – of having multiple versions of the method not knowing which version is being used, and what is the value behind having all these methods definitions, thus: Make sure to use overload methods only if y...