Problem with using && as shorthand for if

bearophile bearophileHUGS at lycos.com
Fri Aug 20 15:32:16 PDT 2010


Jonathan M Davis:
> Well, Andrei is definitely a fan of using D for small scripts, so arguments that 
> something shouldn't be done because it's intended for scripting aren't going to 
> fly with him. Personally, I find it a bit weird, but I don't really care. I 
> probably won't code that way, but I don't mind that it's an option.

Even small scripts need to be tidy. And I don't like that stupid shortcut in a language that tries to be safe as D. Andrei is wrong here.

A problem with similar shortcuts is that they save you few chars and they look handy, but sometimes they later come back to bite your ass. Perl is a good example of this.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list