Killing the comma operator
Claude via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 12 01:29:37 PDT 2016
> int x;
> while( scanf("%d", &x), x!= 0) // until user input 0.
> {
> //do something with x
> }
>
> Does anybody think that this is a useful case of comma operator?
I think it's not a safe way to write code. The only time I use
comma in C (outside for loops) is when I write some clever macros
to do some boilerplate. Comma-operator may have some use in C,
but I reckon it makes no sense in D and adds some confusion.
So I join the majority: KILL IT!!
(WITH ACID...)
More information about the Digitalmars-d
mailing list