News for hackers. Stuff that matters.
Re:Quicksort in Swift by neurobro on Wednesday June 04, 2014 @11:53PM (#7850132)
I do, only because I've never seen a convincing case where unary increment/decrement improves the code in any way (and I've searched).
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?
Re:Quicksort in Swift by neurobro on Thursday June 05, 2014 @12:24AM (#7850217)
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. :)
Re:Quicksort in Swift by exogen on Thursday June 05, 2014 @12:26AM (#7850222)
Consider a more descriptive variable name and hopefully it becomes obvious:

    sheepCounted += 1
vs.

    sheepCounted = sheepCounted + 1
Re:Quicksort in Swift by Someone on Saturday June 07, 2014 @03:59PM (#7862926)
It can easily get way worse once you consider classes and their properties:

    pInterface->m_someField[currentItem] += 1;