Do we really need const?

Derek Parnell derek at nomail.afraid.org
Mon Sep 17 16:52:46 PDT 2007


On Mon, 17 Sep 2007 22:57:05 +0100, Regan Heath wrote:

> renoX wrote:
>> Bruce Adams a écrit :
>>> An example of one that catches me out quite often is:
>>> strcpy(src,dest) vs. strcpy(dest,src);
>> 
>> If it helps you'not the only one to have this kind of issue: some 
>> compilers even try to detect when people makes mistakes for 'memset'?
>> Both case show why function calls with passing the parameter by position 
>> instead of by keywords *sucks*.
>> 
>> Let's try it: do you think you would make the same mistake if you would 
>> call your function this way:
>> char[50] var_dest, my_src;
>> strcpy(dest: var_dest, src: my_src)
> 
> My eyes... aaarghh!

Or ...

  copy(from: var_dest, to: my_src);

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
18/09/2007 9:50:52 AM



More information about the Digitalmars-d mailing list