Discussion Thread: DIP 1043--Shortened Method Syntax--Community Review Round 1

forkit forkit at gmail.com
Sat Feb 5 21:34:49 UTC 2022


On Saturday, 5 February 2022 at 21:17:23 UTC, Ola Fosheim Grøstad 
wrote:
> On Saturday, 5 February 2022 at 20:47:02 UTC, forkit wrote:
>> auto multiplyBy10 = (int a) => a * 10; // already exists.
>> auto multiplyBy10(int x) => x * 10; // proposed: Shortened 
>> Method Syntax
>
> I don't really care either way. It is in general a bad idea to 
> have to syntaxes for the same thing.
>
> It is certainly not logical though.
>
> Lambdas conceptualize mathematical expressions.
> Methods conceptualize messages.
>
> Two different modelling ideas.

I agree.

The real issue, is how developers decide the case for when to 
use, and when not to use one style of the other. Irregular mixing 
of the two dialects would not constitute good coding style in my 
opinion.

My primary concern about integrating mathmatical expressions like 
these into a programming language, has always been the extent to 
which one can understand them without training.

This continual evolution towards making programming languages 
appear more like Frisian, is in nobodys interest.. unless you 
already speak Frisian.



More information about the Digitalmars-d mailing list