Skip to content
DevMeme
2893 of 7435
When ‘eat half’ is implemented to the letter, programmer style
Communication Post #3198, on Jun 7, 2021 in TG

When ‘eat half’ is implemented to the letter, programmer style

Description

Meme composed of two parts. At the top is a screenshot of a tweet from user @King_Chris_Jr_ reading, “I told my brother he can eat half of my grapes.” Filling the main frame is a plastic produce tray containing roughly a dozen grapes, every single one precisely sliced in half with the interior bitten out, leaving perfectly hemispherical grape shells of green and red fruit. Along the bottom in bold white text with a black outline it says, “Must be a programmer…”. The joke hinges on the literal, specification-driven interpretation - rather than eating half the quantity of grapes, the brother consumed half of each individual grape - mirroring how developers sometimes follow ambiguous requirements exactly but not as stakeholders intended, highlighting communication gaps and requirement ambiguity common in software engineering

Comments

35
Anonymous ★ Top Pick Product: “Eat half the grapes.” Senior dev: for (g of grapes) bite(g, 0.5); Architect: “Perfect - another spec that confuses cardinality with per-item semantics. Queue the ‘clarify requirements’ epic.”
  1. Anonymous ★ Top Pick

    Product: “Eat half the grapes.” Senior dev: for (g of grapes) bite(g, 0.5); Architect: “Perfect - another spec that confuses cardinality with per-item semantics. Queue the ‘clarify requirements’ epic.”

  2. Anonymous

    This is what happens when you ask someone who's spent 20 years writing unit tests to share their food - they implement the requirement exactly as specified, pass all acceptance criteria, and somehow still manage to break the social contract

  3. Anonymous

    This is what happens when you don't write comprehensive acceptance criteria. The implementation is technically correct - the best kind of correct - but the product owner is going to have questions in the retrospective. Classic case of 'works as coded, not as intended.' Should've specified: 'GIVEN a collection of grapes, WHEN sharing half, THEN provide 50% of the total count as whole units, not bisect each element in the array.'

  4. Anonymous

    Classic spec pedantry: mapped 'halve' over every grape for 100% literal compliance, but zero grasp of user intent - just like that 'flexible' API that breaks on every edge case

  5. Anonymous

    'Eat half my grapes' is why we write acceptance criteria - otherwise someone maps halve() over the array instead of take(length/2), and both are ‘technically correct’ until the odd-grape prod incident

  6. Anonymous

    “I said ‘eat half my grapes’; he implemented map(g => split(g, 2)) and ate one shard - zero off-by-one, perfect fairness, and a reminder that specs need units.”

  7. @Demiid2 5y

    LMAO

  8. @flyingshine 5y

    i don't get this joke seems like i'm a programmer

    1. @SuperiorProgramming 5y

      This one is even better 🤣🤣😅

  9. @fish_liqueur 5y

    const grapesToEat = grapesTotal.map( grape => { return grape / 2});

    1. @azizhakberdiev 5y

      foreach

    2. @azizhakberdiev 5y

      Sure, but we could easily reduce number of grapes by half doing next: grapesTotal.length = +(grapesTotal.length/2).toFixed()

      1. @RiedleroD 5y

        memory leak

        1. @azizhakberdiev 5y

          It's js

          1. @RiedleroD 5y

            memory leak

            1. @azizhakberdiev 5y

              Why?

              1. @RiedleroD 5y

                because I can

              2. @Roman_Millen 5y

                When you code while you are stressed you'll start loosing your memory

          2. dev_meme 5y

            Hey, but jokes aside You still could make memory leak in js. And in dynamic languages in overall there is no problem to shot you leg by leaking memory

            1. @azizhakberdiev 5y

              JS has its own garbage collector which deletes all inaccessible objects and values.

              1. dev_meme 5y

                Yeah, and you, as developer, could make such a mess that GC will never clean shit after you

                1. @azizhakberdiev 5y

                  I know what I do and gc does. It marks each object and value beginning from window (global) object to the deepest childs of objects. All unmarked values will be deleted as gc could not find access to them

                2. @azizhakberdiev 5y

                  We can make memory leak only if there some kind of infinite loop which pushes data into array or sth like that, or in regexp which called catastrophic backtracking, but it is not so much memory leak as 100% cpu consumption

                  1. dev_meme 5y

                    he-he, it's much easier

                  2. dev_meme 5y

                    There is your entry point https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management

      2. @RiedleroD 5y

        jokes aside, can you just modify the length of an array like that?

        1. @azizhakberdiev 5y

          Array.prototype.length is get/set method. When we reduce it it deletes or creates elements

          1. @RiedleroD 5y

            what happens if you increase the array size?

            1. @RiedleroD 5y

              does it just create null objects?

              1. @azizhakberdiev 5y

                undefined

                1. @RiedleroD 5y

                  aight, that seems reasonable

            2. @fish_liqueur 5y

              Wow, infinite grapes!

          2. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

            What if you have an array with values in it, decrease the length, change the last one, restore its length. Are the ones deleted ot were they just inaccessible?

            1. @affirvega 5y

              https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length

  10. Deleted Account 5y

    Hahahahah. Its like while ( not half ) do eat

Use J and K for navigation