this is almost a workaround for the lack of named parameters

foobar foo at bar.com
Mon Mar 25 05:36:01 PDT 2013


On Saturday, 23 March 2013 at 15:00:13 UTC, bearophile wrote:
> foobar:
>
>> Code that needs named parameters to be more readable is poorly 
>> designed code in the first place.
>
> Have you used a language where the usage of named arguments is 
> idiomatic, like Python, Scala or Ada? They are sometimes useful 
> even for well designed code, like functions with two arguments.
>
> Bye,
> bearophile

"idiomatic" is a relative term, tightly coupled to a specific 
language. Idiomatic D code for example is very different from 
idiomatic Haskell code.
Idiomatic Python style in D would be very unidiomatic D code and 
vise versa. Each language has its own conventions, styles, set of 
distinct features, etc, etc and trying to use "language A" style 
while coding in "language B" is like trying to fit a square peg 
in a round hole.
For instance, I would NOT use smalltalk naming conventions while 
writing say Java code. Both have very good and very consistent 
styles that are tightly coupled with their respective syntaxes 
and are very unsuitable to use in the other language.

In short, if you want to discuss python features, style or 
specific math plotting libraries, please post to the python 
mailing list, not D's NG.


More information about the Digitalmars-d mailing list