www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - We should deprecate C-style declarations

reply Don <nospam nospam.com> writes:
Before TDPL is published, I think we should finally get rid of C-style 
declarations. Supporting two styles of declarations just causes 
confusion, and AFAIK it doesn't have any benefits -- for example, it 
doesn't significantly help in porting code from C. D declarations are 
just better. And there are bugs such as this one, which seem to require 
abandoning C declarations:


function call

At the very least, can we make sure that TDPL doesn't commit us to 
retaining them forever?
Nov 15 2009
next sibling parent Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
Don wrote:
 Before TDPL is published, I think we should finally get rid of C-style
 declarations. Supporting two styles of declarations just causes
 confusion, and AFAIK it doesn't have any benefits -- for example, it
 doesn't significantly help in porting code from C. D declarations are
 just better. And there are bugs such as this one, which seem to require
 abandoning C declarations:
 

 function call
 
 At the very least, can we make sure that TDPL doesn't commit us to
 retaining them forever?
 
Yes please please please please please
Nov 15 2009
prev sibling next sibling parent #ponce <aliloko gmail.com> writes:
Don Wrote:

 Before TDPL is published, I think we should finally get rid of C-style 
 declarations. Supporting two styles of declarations just causes 
 confusion, and AFAIK it doesn't have any benefits -- for example, it 
 doesn't significantly help in porting code from C. D declarations are 
 just better. And there are bugs such as this one, which seem to require 
 abandoning C declarations:
 

 function call
 
 At the very least, can we make sure that TDPL doesn't commit us to 
 retaining them forever?
 
Yes please. There is no real use for: int myvar[4]; instead of: int[4] myvar; and porting from C requires some rewriting anyway.
Nov 15 2009
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Don wrote:
 Before TDPL is published, I think we should finally get rid of C-style 
 declarations. Supporting two styles of declarations just causes 
 confusion, and AFAIK it doesn't have any benefits -- for example, it 
 doesn't significantly help in porting code from C. D declarations are 
 just better. And there are bugs such as this one, which seem to require 
 abandoning C declarations:
 

 function call
 
 At the very least, can we make sure that TDPL doesn't commit us to 
 retaining them forever?
I agree. Walter and I agreed that TDPL will not even mention the C-style declarations for functions and arrays. There are a couple of other older features (such as "length" in array index expressions) that, again in agreement with Walter, TDPL does not mention and are on the road to deprecation. Andrei
Nov 15 2009
parent Frank Benoit <keinfarbton googlemail.com> writes:
Andrei Alexandrescu schrieb:
 ...(such as "length" in array index expressions) ...
finally yay!
Nov 15 2009
prev sibling next sibling parent bearophile <bearophileHUGS lycos.com> writes:
#ponce:

 Yes please. There is no real use for:
 int myvar[4];
 
 instead of:
 int[4] myvar;
 
 and porting from C requires some rewriting anyway.
When you translate this C code: int a[4][10]; You have to remember to invert them to convert them to D: int[10][4] a; As time passes, D gets less and less similar to C. Eventually D will look like Scala ;-) Bye, bearophile
Nov 15 2009
prev sibling next sibling parent Jesse Phillips <jessekphillips gmail.com> writes:
Thanks Don for keeping this page up to date:


http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel
Nov 15 2009
prev sibling next sibling parent =?ISO-8859-1?Q?=c1lvaro_Castro-Castilla?= <alvcastro yahoo.es> writes:
Don Wrote:

 Before TDPL is published, I think we should finally get rid of C-style 
 declarations. Supporting two styles of declarations just causes 
 confusion, and AFAIK it doesn't have any benefits -- for example, it 
 doesn't significantly help in porting code from C. D declarations are 
 just better. And there are bugs such as this one, which seem to require 
 abandoning C declarations:
 

 function call
 
 At the very least, can we make sure that TDPL doesn't commit us to 
 retaining them forever?
 
++votes;
Nov 16 2009
prev sibling next sibling parent Sean Kelly <sean invisibleduck.org> writes:
Don Wrote:

 Before TDPL is published, I think we should finally get rid of C-style 
 declarations. Supporting two styles of declarations just causes 
 confusion, and AFAIK it doesn't have any benefits -- for example, it 
 doesn't significantly help in porting code from C. D declarations are 
 just better. And there are bugs such as this one, which seem to require 
 abandoning C declarations:
 

 function call
 
 At the very least, can we make sure that TDPL doesn't commit us to 
 retaining them forever?
Yes, please!
Nov 16 2009
prev sibling next sibling parent Trass3r <mrmocool gmx.de> writes:
Don schrieb:
 Before TDPL is published, I think we should finally get rid of C-style 
 declarations. Supporting two styles of declarations just causes 
 confusion, and AFAIK it doesn't have any benefits -- for example, it 
 doesn't significantly help in porting code from C. D declarations are 
 just better.
Absolutely, do it.
Nov 16 2009
prev sibling parent Bernard Helyer <b.helyer gmail.com> writes:
On 16/11/09 04:27, Don wrote:
 Before TDPL is published, I think we should finally get rid of C-style
 declarations.
Yes please.
Nov 22 2009