[OT] Sharp Regrets: Top 10 Worst C# Features
Chris via Digitalmars-d
digitalmars-d at puremagic.com
Mon Aug 24 02:52:09 PDT 2015
On Friday, 21 August 2015 at 19:58:04 UTC, Tobias Müller wrote:
> "Chris" <wendlec at tcd.ie> wrote:
>> [...]
>> As if most people were too stoooopid to grasp the concept that
>> `x++` is
>> the same as `x += 1` (which is intellectually as 'challenging'
>> as `x++`, by the way).
>
> Because it's not.
> ++x is the same as x+=1, not x++.
>
> Tobi
This distinction is only relevant if there are two variables
involved (i.e. assignment):
`y = x++;`
where
`y = ++x;`
does in fact yield a different result (most likely the desired
one).
If you work on the same variable, `x++;` is fine. Thus, I don't
agree with Python's philosophy.
More information about the Digitalmars-d
mailing list