version: multiple conditions

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 17 10:24:50 PDT 2015


On Tue, 16 Jun 2015 03:10:01 -0700, Walter Bright wrote:

> I have yet to see a single case of "needing" boolean versions that could
> not be refactored into something much more readable and maintainable
> that did not use such.

and i have yet to see such cases for multiplication operator. it's 
cryptic, it's hard to read, it looks like line noise. isn't this clear 
and readable?

  a = 5.mul(12);

and now see the stupid line noise, introduced by "*":

  a = 5*12;

wtf?! what is that star? some trash from modem?! surely, people can write 
a function to do multiplication if they need it:

  T mul(T a, T b) { T res = a; foreach (_; 1..b) res += a; return res; }

simle and elegant. yes, it doesn't work with floats or negative `b`, but 
hey, it's for readability! if you want to process negative `b`, write 
`mulneg`!

so i'm sure that "*" as multiplication should be removed from the 
language.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150617/8364a19b/attachment.sig>


More information about the Digitalmars-d mailing list