News for hackers. Stuff that matters.
Re:Remove the ++ and –- operators by SilasX on Thursday December 03, 2015 @05:31PM (#10673229)
Then I take it you don't buy into the Python philosophy of "There should be one-- and preferably only one --obvious way to do it."

https://www.python.org/dev/peps/pep-0020/

Re:Remove the ++ and –- operators by nix0n on Thursday December 03, 2015 @06:11PM (#10673429)
To me, ++ is the one obvious way to increment. I use for loops constantly and think of incrementation as a different thing from addition.
Re:Remove the ++ and –- operators by SilasX on Thursday December 03, 2015 @07:12PM (#10673734)
Well yes, they are different from addition, but that still doesn't justify a special symbol for a special case of addition.

When your "increment by 1" is really just in the service of iterating over a set, then the natural, obvious way should be to use a separate idiom that abstracts the concept of iteration over that set, rather than dive into the details of how you get access to the next member. Which is what Python does: "for x in ...".

If the loop is not simply iterating over the set, but tweaking some value unpredictably and periodically checking, then there's nothing special about += 1 relative to += 2.

Re:Remove the ++ and –- operators by msellout on Thursday December 03, 2015 @07:23PM (#10673775)
Why are you incrementing inside a Python for-loop? Are you familiar with ``enumerate``? In most situations, Python provides an iterator that tracks state for you and it's not necessary to increment state explicitly in the loop.
Re:Remove the ++ and –- operators by nine_k on Thursday December 03, 2015 @07:36PM (#10673843)
In higher level languages, loops are not about incrementing.
Re:Remove the ++ and –- operators by koko775 on Thursday December 03, 2015 @07:09PM (#10673725)
To be clear, do you mean ++i or i++?
Re:Remove the ++ and –- operators by Grue3 on Friday December 04, 2015 @09:49AM (#10676576)
Neither does Python. For example, % operator and .format().