Talk:Procedural programming: Difference between revisions

Content deleted Content added
Efficiency Claim
Line 30:
 
:That being said, if you, -has, have a way to improve the article, then by all means do so. You can start by placing your changes here and I (and hopefully others) will comment on them. If they are good suggestions, then they will be adopted, but even if they're not, it might lead to something better. --[[User:Andrew Eisenberg|Andrew Eisenberg]] 21:46, 27 October 2005 (UTC)
 
== Efficiency Claim ==
 
There was an efficiency claim under "Comparison with object-oriented programming" that I removed. There are two reasons I did this.
 
# The claim is a generalization without a reliable source.
# The claim is actually false.
 
From ''Effective STL'' by Scott Meyers, p.203:
 
:"The fact that function pointer parameters inhibit inlining explains an observation that long-time C programmers often find hard to believe: C++'s sort virtually always embarrasses C's qsort when it comes to speed. Sure, C++ has function and class templates to instantiate and funny-looking operator() functions to invoke while C makes a simple function call, but all that C++ "overhead" is absorbed during compilation. At runtime, sort makes inline calls to its comparison function while qsort calls its comparison function through a pointer. The end result is that sort runs faster. In my tests on a vector of a million doubles, it ran up to 670% faster, but don't take my word for it, try it yourself. It's easy to verify that when comparing function objects and real functions as algorithm parameters, there's an abstraction ''bonus''." (parenthetical statement removed, italics in original)
 
If you disagree and have a better source than Meyers, I'd be very interested to "talk shop" about this. :-) Cheers. /* [[User:PradeepArya1109|Pradeep Arya]] 09:33, 11 January 2006 (UTC) */