<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Delphi, methods and default values. Convenience or contract enforcement?	</title>
	<atom:link href="https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/</link>
	<description>Talk about Technologies, Software Architecture and Management</description>
	<lastBuildDate>Fri, 04 Dec 2009 15:43:52 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Yosh		</title>
		<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/comment-page-1/#comment-12217</link>

		<dc:creator><![CDATA[Yosh]]></dc:creator>
		<pubDate>Fri, 04 Dec 2009 15:43:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=324#comment-12217</guid>

					<description><![CDATA[I waiting of delphi 64bit]]></description>
			<content:encoded><![CDATA[<p>I waiting of delphi 64bit</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Fabricio		</title>
		<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/comment-page-1/#comment-8928</link>

		<dc:creator><![CDATA[Fabricio]]></dc:creator>
		<pubDate>Mon, 01 Sep 2008 21:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=324#comment-8928</guid>

					<description><![CDATA[(the blog engine eat the comments)
Serge,

[Defaul Parameter vs Overload - not comment the syncronizing]
For me, they different tools for different needs:
Default parameters - 
  Need: hide optional parameters
  Advantages: does not add any implementation code.

Overloading 
  Need: type translator/cruncher. When you need the class method
        to work with new datatypes or simplifying the use of the
        existing functionality. Lets do some pseudocode: class A 
        is a list of 
        objects of the class b. Class B have the following 
        properties: Name, Cost, Distance. With overloading you do:
        (*...*)
        function Add(pClassObj: TClassB):Integer; overload;
        function Add(pName:String; pCost:Currency; 
                  pDistance: Integer):Integer;
        (*..Implementation..*)
        function TClassA.Add(pClassObj:TClassB):Integer;
        begin
          (* do some house keeping and *)
          Result := inherited AddObject(pClassObj.Name,pClassObj);
        end;
       
        function TClassA.Add(pName:String; pCost:Currency; 
                  pDistance: Integer):Integer;
        var 
          Aux:TClassB;
        begin
          Aux := TClassB.Create;
          (* Set the properties with the parameter values *)
          Result := Add(Aux);
        end;
         
  Advantage: 
        It&#039;s obvious in the above example that overloading gave
        result to cleaner and readable code.


[About the syncronization of the declarations 
  in interface and implementation sections of a unit]
  It&#039;s ooooooooooooooooooold bug in Delphi.]]></description>
			<content:encoded><![CDATA[<p>(the blog engine eat the comments)<br />
Serge,</p>
<p>[Defaul Parameter vs Overload &#8211; not comment the syncronizing]<br />
For me, they different tools for different needs:<br />
Default parameters &#8211;<br />
  Need: hide optional parameters<br />
  Advantages: does not add any implementation code.</p>
<p>Overloading<br />
  Need: type translator/cruncher. When you need the class method<br />
        to work with new datatypes or simplifying the use of the<br />
        existing functionality. Lets do some pseudocode: class A<br />
        is a list of<br />
        objects of the class b. Class B have the following<br />
        properties: Name, Cost, Distance. With overloading you do:<br />
        (*&#8230;*)<br />
        function Add(pClassObj: TClassB):Integer; overload;<br />
        function Add(pName:String; pCost:Currency;<br />
                  pDistance: Integer):Integer;<br />
        (*..Implementation..*)<br />
        function TClassA.Add(pClassObj:TClassB):Integer;<br />
        begin<br />
          (* do some house keeping and *)<br />
          Result := inherited AddObject(pClassObj.Name,pClassObj);<br />
        end;</p>
<p>        function TClassA.Add(pName:String; pCost:Currency;<br />
                  pDistance: Integer):Integer;<br />
        var<br />
          Aux:TClassB;<br />
        begin<br />
          Aux := TClassB.Create;<br />
          (* Set the properties with the parameter values *)<br />
          Result := Add(Aux);<br />
        end;</p>
<p>  Advantage:<br />
        It&#8217;s obvious in the above example that overloading gave<br />
        result to cleaner and readable code.</p>
<p>[About the syncronization of the declarations<br />
  in interface and implementation sections of a unit]<br />
  It&#8217;s ooooooooooooooooooold bug in Delphi.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Serge Dosyukov		</title>
		<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/comment-page-1/#comment-8920</link>

		<dc:creator><![CDATA[Serge Dosyukov]]></dc:creator>
		<pubDate>Sun, 31 Aug 2008 19:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=324#comment-8920</guid>

					<description><![CDATA[Ops! Yes, you are right about that, except that refactoring in Delphi today is a little bit too much. To compare, you can look at implementation in Refactor! by Developer Express.]]></description>
			<content:encoded><![CDATA[<p>Ops! Yes, you are right about that, except that refactoring in Delphi today is a little bit too much. To compare, you can look at implementation in Refactor! by Developer Express.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Brian		</title>
		<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/comment-page-1/#comment-8918</link>

		<dc:creator><![CDATA[Brian]]></dc:creator>
		<pubDate>Fri, 29 Aug 2008 17:36:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=324#comment-8918</guid>

					<description><![CDATA[Newer Delphi IDEs have change parameters as a refactoring tool. On the name for a method press CTRL-SHIFT-X. Or right click and select Refactoring, change parameters. 

I do miss CodeRush&#039;s delcaration view that I had in Delphi 6 which would show me the declaration and/or implementation for the method I was tryinig to call.]]></description>
			<content:encoded><![CDATA[<p>Newer Delphi IDEs have change parameters as a refactoring tool. On the name for a method press CTRL-SHIFT-X. Or right click and select Refactoring, change parameters. </p>
<p>I do miss CodeRush&#8217;s delcaration view that I had in Delphi 6 which would show me the declaration and/or implementation for the method I was tryinig to call.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Serge Dosyukov		</title>
		<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/comment-page-1/#comment-8917</link>

		<dc:creator><![CDATA[Serge Dosyukov]]></dc:creator>
		<pubDate>Fri, 29 Aug 2008 13:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=324#comment-8917</guid>

					<description><![CDATA[I think number of spent hours by programmers is much less. Contract once established could be only changed during a new development cycle.
I am not sure though if you are being sarcastic or serious. :) I liked your Delphi 2010 proposal in the past.

I have decided to bring up the subject because of small debate I have few days ago which then lead to &quot;old&quot; C# discussion and Delphi comparison.

Now, would it be good to have an option for synchronization between declaration and implementation? Yes, and there is number of IDE extensions which allow to do just that - be able introduce a new or modify parameters and having code synchronized accordingly.]]></description>
			<content:encoded><![CDATA[<p>I think number of spent hours by programmers is much less. Contract once established could be only changed during a new development cycle.<br />
I am not sure though if you are being sarcastic or serious. 🙂 I liked your Delphi 2010 proposal in the past.</p>
<p>I have decided to bring up the subject because of small debate I have few days ago which then lead to &#8220;old&#8221; C# discussion and Delphi comparison.</p>
<p>Now, would it be good to have an option for synchronization between declaration and implementation? Yes, and there is number of IDE extensions which allow to do just that &#8211; be able introduce a new or modify parameters and having code synchronized accordingly.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: naf		</title>
		<link>https://blog.dragonsoft.us/2008/08/28/delphi-methods-and-default-values-convenience-or-contract-enforcement/comment-page-1/#comment-8915</link>

		<dc:creator><![CDATA[naf]]></dc:creator>
		<pubDate>Thu, 28 Aug 2008 23:01:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=324#comment-8915</guid>

					<description><![CDATA[
This would all be moot if Delphi was intelligent enough to automatically synchronize the interface and implementation sections (including comments and defaults).

It would probably require less than 1000 manhours on CodeGears end and would save twenty million hours in lost productivity each year (conservatively based on 1,000,000 Delphi users saving five minutes each day).  I doubt there is any single change CodeGear could make that would offer that kind of productivity return.

I&#039;m amazed more Delphi users are not annoyed by this blatant contradiction of DRY and shocked that CodeGear have not addressed this remnant of 1980&#039;s programming.
]]></description>
			<content:encoded><![CDATA[<p>This would all be moot if Delphi was intelligent enough to automatically synchronize the interface and implementation sections (including comments and defaults).</p>
<p>It would probably require less than 1000 manhours on CodeGears end and would save twenty million hours in lost productivity each year (conservatively based on 1,000,000 Delphi users saving five minutes each day).  I doubt there is any single change CodeGear could make that would offer that kind of productivity return.</p>
<p>I&#8217;m amazed more Delphi users are not annoyed by this blatant contradiction of DRY and shocked that CodeGear have not addressed this remnant of 1980&#8217;s programming.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Minified using Disk
Database Caching 10/83 queries in 0.054 seconds using Disk

Served from: blog.dragonsoft.us @ 2026-04-05 04:47:06 by W3 Total Cache
-->