Re:Quicksort in Swift
by nkeets on Thursday June 05, 2014 @12:01AM
(#7850155)
So, what convincing cases have you find of i += 1 over i = i + 1?
[ Parent
| on HN ]
It reduces code redundancy, especially when 'i' is something more descriptive. Though if someone were to claim that the redundancy of i=i+1 is a trivial price for settling on one consistent multipurpose construct, I wouldn't put up a fight. :)
Consider a more descriptive variable name and hopefully it becomes obvious:
sheepCounted += 1
vs. sheepCounted = sheepCounted + 1