• ImgurRefugee114@reddthat.com
    link
    fedilink
    arrow-up
    72
    ·
    3 days ago

    It’s not a glass, it’s the

    hydrationContainerManagerObjectFactory

    Not to be confused with the

    hydrationContainerManagerTypeFactory

    Which is the template

      • jaybone@lemmy.zip
        link
        fedilink
        English
        arrow-up
        15
        ·
        3 days ago

        Some of those patterns were actually good design, until everyone went overboard with them. Now the pendulum has swung the complete opposite way and there’s a ton of duplicate code often generated from actual templates.

    • unwarlikeExtortion@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      you mean

      glass Glass;

      which is almost worse than stringing together random fancy words.

      (Edit: added backticks for that nice mono font)

  • Ftumch@lemmy.today
    link
    fedilink
    arrow-up
    37
    ·
    3 days ago

    That’s not a good comment. What it is should be clear from the naming and context. A good comment explains the why when that is not obvious:

    // This glass is at 50% capacity because we don't want it to overflow if it rains
    
    • one_old_coder@piefed.social
      link
      fedilink
      English
      arrow-up
      13
      ·
      3 days ago

      And in 5 years you will wonder why the glass is under the rain because someone didn’t put that in the specifications.

      • hakunawazo@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        2 days ago

        A software tester walks into a bar

        Runs into a bar.
        Crawls into a bar.
        Dances into a bar.
        Flies into a bar.
        Jumps into a bar.

        And orders:

        a beer.
        2 beers.
        0 beers.
        99999999 beers.
        a lizard in a beer glass.
        -1 beer.
        “qwertyuiop” beers.
        Testing complete.

        A real customer walks into the bar and asks where the bathroom is.

        The bar goes up in flames.

  • Racoonwithbenefits@lemmy.zip
    link
    fedilink
    arrow-up
    19
    ·
    3 days ago

    While filling the glass: glass is half full

    While emptying the glass: glass is half empty

    Context matters

    Comment would be whether glass is being emptied or filled

    • OwOarchist@pawb.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      3 days ago

      Comment would be whether glass is being emptied or filled

      What if it’s neither (and unknown which it was previously), and the glass is just sitting there?

  • UpperBroccoli@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    10
    ·
    3 days ago
    /**
     * @brief This is the coffee cup class
     * 
     * This class describes a cup or mug that neatly integrates a
     * container for vectors of cCoffee instances with a fully
     * functional handle to carry the cup or mug around. Used for 
     * pretty much everything.
     */
    class cTallGlass : public cGlass {
    
            • xthexder@l.sw0.com
              link
              fedilink
              arrow-up
              3
              ·
              edit-2
              3 days ago

              Eh, my bad. I figured that was somewhat optional given it’s English and already kind of an adaptation. Fixing it is more effort than I’m willing to put in tho

              The whole Wikipedia page on English Haiku makes it seem like there’s a lot of room for interpretation

              • OwOarchist@pawb.social
                link
                fedilink
                English
                arrow-up
                2
                ·
                3 days ago

                I figured that was somewhat optional

                It is somewhat optional.

                While there are certain elements that are traditionally included in a ‘proper’ haiku, those elements are not universal, even in very old, traditional haiku. @jerkface@lemmy.ca is being too harsh and speaking too absolutely here. A non-traditional haiku is still a haiku.

                – Your friendly neighborhood literature major.

  • sunbeam60@feddit.uk
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    Feel like we’re missing an overflow joke here!

    Or something like: // initialise a glass using max water value as indicator that glass is unused

  • dan@upvote.au
    link
    fedilink
    arrow-up
    8
    ·
    3 days ago

    AI loves inserting comments like this.

    Either that or 20-line comments documenting the bugs in the old code, what this code does differently, and the exact implementation.

    Comments describing the exact implementation become stale very quickly. Comments shouldn’t explain what the code does (eg “add two to rowCount”); they should explain why it does it (eg “include header and footer row in count too”). Extra details are what the commit message is for, and history is what source control is for.

    I call it out in a lot of my code reviews (“code looks good but clean up the AI slop comments before landing”) but a lot of other developers don’t care as much about code and documentation quality.

    • partofthevoice@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      It really pisses me off when the fucking thing starts referring to the patched code as “updated” in the README, comments, function names… Stupid bot needs to be told not to implicitly refer to prior versions of the code, always regarding current state as initial release. Why the shit do I even need to say that?