Re:Remove the ++ and –- operators
by isomorphic on Thursday December 03, 2015 @04:16PM
(#10672699)
I think forcing me to use "+=" in Ruby reminds me that it's really a method call (which can be overridden), rather than an increment operation on primitive types.
[ Parent
| on HN ]
++ and -- (both versions of each) would end up being method calls as well in Ruby or Python. They're even overridable in C++.
Re:Remove the ++ and –- operators
by odonnellryan on Thursday December 03, 2015 @04:37PM
(#10672847)
Yes, this exactly! While rarely a good idea, it does give you super powers when dealing with specialized libraries, or when writing your own :)
Re:Remove the ++ and –- operators
by paulddraper on Friday December 04, 2015 @09:41AM
(#10676536)
Have you ever written a container (with an iterator)?