Talk:Overloading

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ebybymic (Talk); changed back to last version by Lukas Korsika)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://oleqatyqi.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
 
----
 
=[http://oleqatyqi.co.cc CLICK HERE]=
 
----
 
</div>
 
 
I disagree with this. I think method overloading can make code easier to read, as long as the overloaded methods perform the same basic task.  
 
I disagree with this. I think method overloading can make code easier to read, as long as the overloaded methods perform the same basic task.  
 
Two areas where it might be useful to overload methods is having default parameters to customise the functionality of the method (for instance, calculateMetrics might have an additional bool specifying whether to compute the extra, CPU intensive metrics which are only sometimes needed).
 
Two areas where it might be useful to overload methods is having default parameters to customise the functionality of the method (for instance, calculateMetrics might have an additional bool specifying whether to compute the extra, CPU intensive metrics which are only sometimes needed).

Latest revision as of 03:11, 25 November 2010

I disagree with this. I think method overloading can make code easier to read, as long as the overloaded methods perform the same basic task. Two areas where it might be useful to overload methods is having default parameters to customise the functionality of the method (for instance, calculateMetrics might have an additional bool specifying whether to compute the extra, CPU intensive metrics which are only sometimes needed). Another time when it might be useful is for different types. If you have a applyMagicFormula(float) method, it might make sense to overload it for ints, to reduce casting.

What do people think? --Lukas Korsika 01:53, 21 October 2010 (UTC)

Personal tools