Skip to content
DevMeme
3027 of 7590
CodeReviews Post #3342 · source on Telegram

The Zen of Code Reviews: i == i

Description

A screenshot of a code review interface, likely from GitHub or a similar platform, showing a snippet of JavaScript code. The code displayed is a 'for' loop with a peculiar conditional statement inside: 'if (i == i)'. This condition is a tautology, as it will always evaluate to true, making the check pointless and likely a remnant of debugging or a copy-paste error. Below the code, a comment thread highlights the absurdity. The first comment, posted '9 hours ago', dryly points out 'i == i.'. A follow-up comment from 'a minute ago' escalates the reaction with a well-known rage-quit emoticon '(╯°□°)╯︵ ┻━┻' that incorporates the flawed logic '(i == i)', signifying extreme frustration. This meme captures the quintessential code review experience where one encounters baffling code that defies logic. It’s a humorous take on the moments of disbelief and exasperation that senior developers feel when reviewing junior developers' code or even their own past mistakes, turning a simple logical flaw into a moment of shared developer comedy

Comments

19
Anonymous ★ Top Pick I'm pretty sure 'if (i == i)' is how you implement a quantum lock. It's both true and pointless at the same time until a senior dev observes it
  1. Anonymous ★ Top Pick

    I'm pretty sure 'if (i == i)' is how you implement a quantum lock. It's both true and pointless at the same time until a senior dev observes it

  2. Anonymous

    Nothing sparks a 40-comment review thread faster than the “NaN detector” masquerading as an always-true branch: ​if (i == i) { … } - simultaneously pleasing the JIT gods and triggering every linter we pay for

  3. Anonymous

    After 9 hours of contemplating whether it should be '<=' or '<', the reviewer finally achieved enlightenment: the real bug was in production all along, silently corrupting data for customers who coincidentally had exactly j+1 items in their cart

  4. Anonymous

    Nine hours between 'j == i;' and the table flip - that's the exact amount of time it takes for a senior engineer to go from 'polite code review comment' to 'questioning every life choice that led to reviewing code where someone uses j in the loop declaration but k in the condition.' The real tragedy isn't the bug itself; it's knowing this will pass CI, make it to production, and only manifest as a subtle off-by-one filtering issue that takes three weeks and a customer escalation to trace back to this exact line

  5. Anonymous

    for(let [i]) ensures the loop never runs - proactive zero-iteration optimization via syntax fail

  6. Anonymous

    if (i == i) - always true unless i is NaN - the perfect CI greenlight for teams with disabled no-self-compare and zero edge-case tests

  7. Anonymous

    If your filter logic is “if (i == i)”, you’ve outsourced business rules to IEEE‑754 - everything continues except NaN and the reviewer’s sanity

  8. @DavidGarciaCat 5y

    🤦‍♂️🤷‍♂️🤣

  9. @p4vook 5y

    (makes you think)

  10. @azizhakberdiev 5y

    Check for NaN. NaN is not equal to anything, even to another Nan

    1. @p4vook 5y

      isNaN? Nah, let's do this

      1. @azizhakberdiev 5y

        MDN does not recommend use that

        1. @p4vook 5y

          that == isNaN?

  11. @NiKryukov 5y

    Kazakhstan the greatest county in the world, all other countries are ruled by little girls

    1. @pixelsex 5y

      are references to one's nationality supposed to be funny? nikolay nidvoray lol

      1. @NiKryukov 5y

        Yes, it is funny. Especially when the joke is about ukrainians :з

  12. @azizhakberdiev 5y

    I think second comment is meme "Random shit, go!"

  13. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

    if (Window.closed == true) { Window.Close(); }

  14. @azizhakberdiev 5y

    Yes Number.prototype.isNaN = function() { return this == this } It looks sensible but doesnt work, because this there points at object, not NaN value. Number.isNaN uses another way of checking for NaN, but it probably uses more code to do that, so i == i is better anyway

Use J and K for navigation