• HeartyOfGlass@piefed.social
    link
    fedilink
    English
    arrow-up
    104
    ·
    edit-2
    27 days ago

    “I stopped reading code because I was too busy writing a gauntlet of unit tests”

    Sounds like 100x productivity to me.

    Edit: also, general note - I think you kneecap your argument when you start with “I’m older than you”.

  • w33n1s@lemmy.world
    link
    fedilink
    English
    arrow-up
    96
    ·
    26 days ago

    Been coding for about 30 years now, am I the only one who still LIKES to code? Who still LIKES to try writing a new approach to something, watching it fail, figuring out what went wrong, taking notes, learning from mistakes, and noticing improvements in their own code? Cuz it’s starting to feel like it. Web development already lost me with the culture of “glue a bunch of bulky shit together that you didn’t write and call yourself a ‘dev’ to the ladies” but this AI shit is getting absurd. And it doesn’t even work! Look at how shitty all the operating systems are getting. Look at all the total slop on the app stores. It’s depressing as hell.

    • one_old_coder@piefed.social
      link
      fedilink
      English
      arrow-up
      22
      ·
      26 days ago

      I love coding and learning new languages. I’d rather move to another industry than reviewing vibe coded crap all day long.

    • HopeOfTheGunblade@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      16
      ·
      26 days ago

      We need to build a culture that values process and making beautiful things for their own sake, not simply Pile Dollars Higher, which is killing the planet and making us all miserable.

    • ItsMeForRealNow@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      26 days ago

      I also do. One unique important thing that agents rob you of is time with your code - you don’t get to craft it so you remember just as well as you would have if you copied answers for a test.

      • w33n1s@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        26 days ago

        That’s an excellent point. With my larger personal projects, which I have to put away for weeks at a time due to my (not-at-all-programming) job, I can come back and (more or less) dive right back in because I used patterns and organizational structures familiar to me. And if I’m digging into a particular thing, I can eventually remember all the trials and tribulations that went into the decisions I made to get to that point.

        With AI code you get none of that, like you said. I can’t imagine not knowing or understanding why something works the way it does, and releasing it, with my name on it, for others to use.

        • baltakatei@sopuli.xyz
          link
          fedilink
          arrow-up
          4
          ·
          edit-2
          25 days ago

          Student: “Hey, thanks for the Bash script! It didn’t know you could use the mapfile built-in to populate an array using standard input lines without a while loop. mapfile -t my_array < <(seq 1 10) is really handy!”

          Vibe coding guru: “I have no idea what you’re talking about. That sounds like plumbing. You should let AI handle those details. Focus on the big picture.”

        • architect@thelemmy.club
          link
          fedilink
          arrow-up
          2
          ·
          26 days ago

          All of the software I use is broken to shit. If major corps can release broken shit software to waste my time all day then seems like shipping broken code is actually the norm. So if it works then you are one step ahead regardless if you use ai or not.

          Also, as a pro artist (and you all are similar), no one gives a fucking shit about the tools or software or how much blood you spilled (or didn’t) making what you made as long as they can use it.

    • MonkeMischief@lemmy.today
      link
      fedilink
      arrow-up
      9
      ·
      26 days ago

      Right there with you. I suck at it but I still find the pursuit worthwhile!

      This crap is brought to you by the people who are positively baffled that someone would want to learn to make music, and enjoy the process, instead of just have it generated so they can hit “publish” and supposedly be making money off of it with zero real effort besides “having an idea.”

    • ramjambamalam@lemmy.ca
      link
      fedilink
      English
      arrow-up
      9
      ·
      26 days ago

      I too enjoy actually writing code. I feel fortunate that I was able to make a career out of something I enjoy so much. I am not sure that most people had that experience. Alas, it seems like the industry is paying me to set up guardrails and supervise AI agents. I am not sure how long this will last, but at least I know that I will always be able to enjoy programming as a hobby if nothing else.

      • thevoidzero@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        26 days ago

        Yeah, I think it used to be like that, then because programming paid a lot everyone started wanting those jobs even if they didn’t like actual programming.

      • w33n1s@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        26 days ago

        I’m glad you have enjoyed it as a career. I never even tried – I have a dumb rule that I won’t do anything I truly love for work. I guess because I don’t want others ruining it. lol

        • ramjambamalam@lemmy.ca
          link
          fedilink
          English
          arrow-up
          1
          ·
          25 days ago

          It’s a blessing and a curse. On the one hand, I have much less time and patience for personal software projects. I prefer to do carpentry or sports as a change of pace. On the bright side though, the experience I’ve gained from working professionally makes the projects I do tackle go much more smoothly than when I was an amateur.

    • Jerkface (any/all)@lemmy.ca
      link
      fedilink
      English
      arrow-up
      8
      ·
      edit-2
      26 days ago

      Of course many people like it. It’s literally a highly addictive loop. But when you are a senior developer on a team, it’s kind of a waste of resources for most projects. Writing code is not the hard part.

      • Hackerman_uwu@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        25 days ago

        Scrolled way too far for a lucid take like yours.

        This seems to be a bit of an echochamber.

        I wish people would just be a little more honest. When they say “writing code” they actually mean hunting through stack overflow for bits of code you can string together. Take stack overflow out of the loop for argument sake. Your a unicorn information superhighway ninja. Snowcrash hasn’t left your bedside for decades. Mountain Dew and volt cans litter the floor space of your home …and you’re still just orchestrating a bunch of libraries you never saw the source code of.

        I think a lot of people built their identity on being coders and that’s why they hate where the industry is going.

    • HerbGrower@slrpnk.net
      link
      fedilink
      arrow-up
      7
      ·
      26 days ago

      Reject their web development culture and make your own sites that run smoothly on devices using a fraction of the bandwidth theirs do.

    • 100_kg_90_de_belin@feddit.it
      link
      fedilink
      arrow-up
      7
      ·
      26 days ago

      I had the same problem with translating back in the day. I really liked tackling a text in a foreign language. In the end all the pros of computer-aided translation boiled down to lining the pockets of translation agencies with even more money while paying translators peanuts.

    • yermaw@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      26 days ago

      I never got round to doing it properly. Just simple stuff, but i get a little braingasm when it finally does what I want it to and I kind of understand why.

      Made a simple game last time, following tutorials and trying to stitch others code to cobble together roughly what im trying to do. Tested a new feature by having it change colour when you hit the object at certain angles. I forget what it was supposed to do, that was just to test the concept works.

      My wife couldn’t understand why I was jumping around the room shouting WOOOOO when it actually did it.

    • abc@suppo.fi
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      25 days ago

      ~25 years here and I started getting bored about 15 years ago.

    • anotherandrew@lemmy.mixdown.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      25 days ago

      I’m about the same vintage as you I think (50 this year), programming since my pre-teens and I still enjoy it, although I long ago strayed away from “pure” programming - I work almost exclusively in the embedded space where I design the hardware and firmware, including the HDL. If I were making applications or doing anything web based I’d have been bored a long, long time ago.

  • HazardousBanjo@lemmy.world
    link
    fedilink
    arrow-up
    54
    ·
    edit-2
    27 days ago

    I’m significantly older than you. I started coding in the late 60’s

    Yeah, appeal to tangentially related experience, age and arrogance aren’t a way to inspire confidence in your work.

    We live in the perfect times to display that experience, age and arrogance haven’t been working in almost any field, from politics to LLM development. We’ve yet to witness any system that operates well, while also eliminating human oversight. It doesn’t matter the guard rails you put in place. They’re only as strong as your personal ability to evaluate your own product, which itself is a conflict of interest.

    Edit: Also, you can’t use your own credentials to assert the integrity of work you aren’t even actually doing yet passing as your own.

  • kryptonianCodeMonkey@lemmy.world
    link
    fedilink
    arrow-up
    42
    ·
    edit-2
    27 days ago

    He fails to mention that he has AI also generate and do all of those tests, which means, A) he has no quality supervision over his quality supervision. Speaking from experience, AI can and will break a test in order to pass it rather than fixing the code if it randomly decides to. It is not always reliable and does not have even the baseline of good sense you would expect a brand new junior dev to have. And B) he’s probably spending 3 times as much on tokens used for generating and running tests than he is already using on code generation. That’s only going to be sustainable while these tokens remain cheap, which won’t be for much longer, my guy.

    Also it is always fun when someone asks you basic questions about your code and you have to admit complete and total ignorance because you neither wrote nor read a single line of it. How are you going to sell confidence in your black box that even you haven’t peeked inside?

    • ZILtoid1991@lemmy.worldOP
      link
      fedilink
      arrow-up
      23
      ·
      27 days ago

      The D Language Foundation tried to incorporate LLMs in the unittests, and they created something akin to assert(5 + (funcToTest(846) * 0) == 5) early on, now they want to use it to rewrite the standard library from scratch, because “it has become better since”.

      • kryptonianCodeMonkey@lemmy.world
        link
        fedilink
        arrow-up
        31
        ·
        edit-2
        27 days ago

        The other day I had Claude write some code that failed a unit test. It was failing at a step that ran assertEquals(actualMap, expectedMap);. The reason it was failing was because one of the values in the map, a UUID, is automatically generated in the code. In the test, it has been hard coded.

        Anyone with any sense would know you need to handle that misalignment. Omit that field from the match assertion? Set that UUID based on the generated value instead of hardcoding it? Anything like that would work just fine.

        But Claud’s solution was to change that assertion to assertTrue("The actualMap and expectedMap will never be equal because the values of ID will never match");. So the test always passes and it explicitly notes that they will not match. I would have fired a Junior Dev on the spot for writing that solution.

  • douglasg14b@lemmy.world
    link
    fedilink
    arrow-up
    38
    ·
    27 days ago

    None of this actually proves that they aren’t writing slop. It just proves that the slop that they’ve written passes your tests.

      • douglasg14b@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        25 days ago

        I mean, screw performance. You can get away with a lot of shitty performance and still have a completely functional application. However, the kind of slop that happens around module boundaries that turns your codebase into a giant pile of workarounds and hacks really sucks.

        And AI is particularly bad at this, as AI almost always prefers to work around a problem or do everything it can to meet the plan the user approved, even if that plan meets reality, it has problems. Which tends to lead to cascading misalignment with intentions and cascading infrastructure and architectural technical debt.

        All of which culminate in less stable software, lower likelihood of long-term support of that software, and worse performance.

    • Caveman@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      27 days ago

      I never understand why you wouldn’t want to read the code. I prevent a massive amount of correct slop by just skimming. The LLM will 10 times out of 10 never ask “this code will be a massive duplication of exact same behavior, do you want to refractor it?” because it’s trained to finish a task without asking if possible.

      Uncle Bob now writes code for his tests instead of tests for his code. I know it’s TDD but it always seemed backwards to me.

      Unit tests for logic, integration tests for outside apis, e2e for features is the sweet spot IMO.

      • GoatSynagogue@lemmy.worldBanned
        link
        fedilink
        arrow-up
        3
        ·
        26 days ago

        Claude and most other of the top coding agents will check the codebase for existing patterns and functionality specifically so it doesn’t duplicate behaviours etc. Have you used any of them recently? That’s one of the first things it does before even writing a line of code.

        • Caveman@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          26 days ago

          I use Claude/Codex, if it finds a thingy that’s reusable it’ll use it but it’ll never create it or ask if it should be created in my experience. I find that it doesn’t create new components but just replicates the existing one.

          Within same file is a different story though, it does write helper functions to share logic which is proper.

      • Zannsolo@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        26 days ago

        I generally only use ai to write code I know what it should look like but don’t want to type it all out.

    • UnderpantsWeevil@lemmy.world
      link
      fedilink
      English
      arrow-up
      24
      ·
      27 days ago

      “I use a hammer”

      “Well, I use a device that applies an enormous amount of pressure constrained to a very particular point in space”

      “How much does your device cost?”

      “$200/mo and the company loses money every time I swing it. You?”

      “$12 and I’ve had this thing for 20 years.”

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

      That’s how I read it.

      But “the industry” is also telling us, we should be using AI to write all of our test code. So why is this guy writing anything at all?

  • sirdorius@programming.dev
    link
    fedilink
    arrow-up
    28
    ·
    27 days ago

    Isn’t this just the natural evolution of TDD? Write tests, pass them, don’t care about how garbage the code is to make them pass

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      19
      ·
      26 days ago

      What he is describing is what you are supposed to do for human written code also.

      • zbyte64
        link
        fedilink
        arrow-up
        15
        ·
        edit-2
        26 days ago

        I’ll do all that when the spec is written in stone.

  • melfie@lemmy.zip
    link
    fedilink
    arrow-up
    25
    ·
    26 days ago

    I see all the tests are passing on this PR, so I won’t even review the code. LGTM.

    🙄😖

  • vrighter@discuss.tchncs.de
    link
    fedilink
    arrow-up
    22
    ·
    26 days ago

    this guy has always struck me as a shitty coder. His “clean code” is the ugliest shit i ever saw. This confirms it.

  • carrylex@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    27 days ago

    Translates to:

    “I created this (unit) test that tests code that does not exist yet…”

    Alright AI bro keep your copium…

        • vanillama@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          27 days ago

          Agreed, you find the right shape for the code as you build and try stuff, adding the tests right after makes most sense, unless maybe you’re just testing an API or something

          • Zannsolo@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            26 days ago

            I mean I’m theory for any planned method you would know the input and expected output before the coffee is written.

            • ThirdConsul@lemmy.zip
              link
              fedilink
              arrow-up
              2
              ·
              26 days ago

              Except that then you’ll shape your interfaces to drive tests nicely, instead of being, you know, sane and useful (been there, done that).

              • 3abas@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                26 days ago

                Unit tested test for accuracy, if your code isn’t “shaped to drive tests nicely”, it’s bad code.

                They enforce requirements. You do start with code, you start with the “shape”, you architect how your application should be developed and you write unit tests for the functions you already know you want but haven’t written the logic to yet, the unit test validates the logic so you don’t spend 2 hours hunting down a missing negative sign.

            • vanillama@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              26 days ago

              As I said, an interface can easily be tested, but if it’s internal implementation I normally make a design, implement it, and I usually come up with other ideas and I like having the fluidity of making changes as I prototype and such, that way I’m not constrained by a test yet. After I’m done, and documented my choices if necessary, then I add the tests.