Languages
Post #2538 · source on Telegram
Cursed Ways to Increment X
Description
A tall multi-panel Spider-Man meme starts with three Spider-Men pointing at each other, labeled `x++`, `x = x+1`, and `x += 1`. Below, increasingly distorted Spider-Man drawings are paired with stranger equivalent-looking expressions: `x -= -1`, then `x *= 1 + 1 / x;`, and finally `x /= x / (x + 1);`. The technical joke is that many expressions can mathematically increment a value by one, but each rewrite gets less readable, more fragile, and more likely to break on edge cases such as zero or numeric precision.
Use J and K for navigation
Comments
8Comment deleted
The last one increments `x` and the probability that code review becomes a wellness intervention.
x /= x / (x - -1) Comment deleted
just because when x == "2": x + 1 = 21 Comment deleted
anx x - -1 equals to 3 Comment deleted
we can substitute -1 by some shit like cos(4atan(1)) Comment deleted
didn't work when x integer Comment deleted
3 case, i mean Comment deleted
x *= 1 + 1.0 / x Comment deleted