Visit Official Exploding Ads Website

Friday, December 4, 2015

jheriko comments on "Remove the ++ and –- operators"

By jheriko

usually when people say this what they mean is revolting and difficult to read things.


i’ve heard this sort of thing about a++ = b++; and variants thereof, which is the classic example of this.


a lot of the times i have seen this stuff it is in the middle of even more revolting code too… like some 1000 line function (which could be 10 functions and has comments inside of it that delineate the obvious splits) with a gigantic switch statement (which could be a class, or in C a function pointer), containing loops, where there are 20 lines like the above but even more difficult to read in a row (which could have been a nested loop with identical logic referring to some constant data) – to think of the most recent example i faced.


sadly i’ve seen this sort of stuff so many times for so long that i find it easy to read, but it is intrinsically difficult involving precedence and the post-increment gotcha, and it gets worse if there is even more being done than just a straight copy.



link


Read more here: https://news.ycombinator.com/item?id=10674829



jheriko comments on "Remove the ++ and –- operators"

No comments:

Post a Comment