• jbrains@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    18 days ago

    I don’t know what those first two sentences are doing. This kind of thing is exactly what mesmerized young me and puts wise me off.

    One thing worse than appealing to authority is appealing to your own authority.

    • ViatorOmnium@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      18 days ago

      No. Everyone in tech that’s not a mediocre tech bro has known Uncle Bob is an overrated quack for a long time.

        • lobut@lemmy.ca
          link
          fedilink
          arrow-up
          0
          ·
          18 days ago

          He’s very popular, written several books and spoken at many events. Most notably he’s written Clean Code and the follow up I never bothered reading and he’s a die hard advocate of TDD and also one of the authors of the Agile Manifesto. I met him a few times after his talks.

          I generally “like” Uncle Bob or Robert C Martin insofar as he advocated for better software design and had some good ideas and all that. I personally hate TDD but when you talk to him and stuff, he’s more flexible and nuanced than he can come across. The problem is when he comes up with (or runs into) a new “philosophy” he becomes evangelical about it and it seems like he doesn’t have as much nuance. Sadly though, growing up with his fans in the software industry has been a pain because they’d hear something from him or Fowler or Beck or whoever and then try to reshape the codebase like typical Magpie Developers.

          • Valmond@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            0
            ·
            17 days ago

            The agile manifesto, ugh. We’ve been through one like that every 5-10 years since forever (super programmers, team this, pair program that), and it’s all about managerial control, no one trusts the developer.

            Except in magic fairy land where “agility” is so productive etc.

            • lad@programming.dev
              link
              fedilink
              English
              arrow-up
              0
              ·
              18 days ago

              I expected it to be a jest, but they look serious. It might even not be too bad of a language in other circumstances

          • queerlilhayseed@piefed.blahaj.zone
            link
            fedilink
            English
            arrow-up
            0
            ·
            18 days ago

            I haven’t read it in a while but I remember finding it very helpful. I think Martin is a guy who had a good idea and wrote a good book, and then everyone told him he was smart and right, and I think if that happens enough a person will start to believe it. Happens to a lot of people who “achieve success”, whether or not success is merited. Then he kept on saying things he thought and assumed he was smart and right, and some people kept listening because they liked Clean Code, and agreeing because so many other people said he was smart and right, and it snowballed.

            I think once you hit a certain level of intellectual celebrity you can sustain your own momentum without needing to understand or respond to criticism, and that’s how people who become famous, like Bob Martin, can turn out the way they do. It happens gradually, and then one day you look at the guy and think “What happened? Was he always like this?” and the answer is yes and no: yes they always said what they think, and no, they weren’t always trapped at the bottom of their own opinion gravity well, slowly becoming a caricature of themselves because their thoughts are no longer guided by the thoughts of their peers.

            • Feyd@programming.dev
              link
              fedilink
              arrow-up
              0
              ·
              18 days ago

              had a good idea and wrote a good book

              I read the book after asking some junior engineers why they kept insisting on breaking straightforward tasks that could be a single pure function into a web of stateful method calls and learned they were being recommended it by another senior dev.

              That book is one of the major contributors to the object oriented enterprise Java from the 90s that everyone universally loathes.

              I personally think this discussion is probably the greatest thing he had contributed to software engineering, and not because it puts him in a positive light. https://github.com/johnousterhout/aposd-vs-clean-code/blob/main/README.md

              • queerlilhayseed@piefed.blahaj.zone
                link
                fedilink
                English
                arrow-up
                0
                ·
                18 days ago

                Oh yeah, the “functions should be short” thing. I think it’s a truism in all fields that novices have to learn a rule before they learn how to recognize the nuances of the rule, and even the “does one thing” guide is hard to implement if you’re in a strict rule-following culture, as many coding shops are, especially for juniors.

                It is a big problem especially in enterprise code, where a failure to rule-follow can have severe consequences, and I think the way Martin addresses the problem of function length in Clean Code could stand to be improved upon. However, I think the nature of technical argument is to identify a problem (functions that bloat over time because people keep adding bits to it) and propose a solution (functions over X lines get scrutiny, functions with names like doXandY() get scrutiny, etc), and then the next step, as Ousterhout does in that interview, is to challenge and bring nuance to those proposals in the form of new solutions. The problem with Clean Code is not that the text is imperfect, but that the text was canonized as some kind of Coder’s Bible for a long time, and that prevented a lot of people from seeing or ingesting the criticism of those imperfections, so the imperfections become conventions with inertia that have to be uprooted painstakingly.

                Could that interview have happened a decade earlier? Yeah, I think it would have been helpful. Did such an interview happen earlier? I don’t know; my impression is that Martin did little to encourage criticism of his work, and I think that is a professional failing, but I’m also not a close Bob Martin watcher and if he had tried, genuinely tried, I’m not sure I would have seen it. I think wildly successful books often take on a life of their own that authors only partially control, and I have a hard time faulting Martin exclusively for every failure of nuance that was magnified alongside the beneficial parts of the book. I think a lot of Martin’s recommendations about how to analyze code for readability did more good than harm if for no other reason that they normalized discussions about how to evaluate the readability and maintainability of code and why it’s important instead of just focusing on whether or not the code “works correctly” in the moment. I still teach people to monitor their “WTFs per minute” as a heuristic for code quality; I find it very helpful for junior devs to identify both bad code and their own misunderstandings. I think critically analyzing names is excellent advice for all coders. I’m flipping through my own copy and the first thing I underlined back when was “Professionals use their powers for good and write code that others can understand.” I think that’s very good advice for new coders.

                Thanks for the link, by the way. I had never seen that before. I haven’t read the whole thing yet but it’s on the list. And I’m reading back through Clean Code for the first time in a long time.

                • Feyd@programming.dev
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  17 days ago

                  I could maybe give him some leeway if the examples in the book itself showed responsible code, but they simply do not

                • ThirdConsul@lemmy.zip
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  17 days ago

                  Pure function = no side effects, no internal state. If you run a pure function twice with the same input, it will give the same output.

                  Example of pure function

                  (a,b) => a+b
                  

                  Example of inpure function

                  let c;
                  
                  (a, b) => {
                     c++;
                     return a+b;
                  } 
                  
      • BradleyUffner@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        18 days ago

        I’ve got a co-worker that worships every word that falls out of Bob’s mouth hole. Nice guy, but not a good developer.

  • ZoteTheMighty@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

    I’ve actually found a lot of success with the opposite where I write the code and AI writes the unittests. I would have otherwise written a few unit tests, but AI makes typically 20x that many. Since my code is already documented, it can get lots of good context. I typically instruct it to check the branch’s diff relative to main and test only those changes. I might skim them over, delete some that don’t make sense in context and would never pass, and update one or two. Typically after a few rounds of iteration, I have tons of tests I would never have written on my own, and a human-made feature.

      • Huginn12@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        17 days ago

        In a perfect world yes, but even after all the solution in and planning, once a developer gets into the request and looks at the code things often change.

        Requirement only written test steps are rarely going to be enough to cover every scenario. Saying this as a 10 year ba veteran

  • thedeadwalking4242@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

    I’ll say it again for the people in the back, even if you are a vibe coding twat, well designed code is a MUST even more so.

    If you want your LLM to preform even to the crappy level they can the codebase needs to be clean.

  • carrylex@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    18 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
          0
          ·
          18 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
            0
            ·
            17 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
              0
              ·
              17 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
                0
                ·
                17 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.

  • Mirror Giraffe@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    18 days ago

    If it’s his own products and no-one else needs to work that code I don’t see a big problem with it, but the ways I’ve seen agents treat a code base just to pass tests is horrible.

    • BradleyUffner@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      18 days ago

      Bob writes books about software development and has a huge following of mediocre developers that graduated in to management. Unfortunately what Bob says and does affects way more than just Bob.

  • Avicenna@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

    Except LLM agents are known to do weird things to succeed. I have heard of an LLM agent working with automated theorem proving languages using stuff similar to is_prime(x): return True to get the proof it was asked to. Now embed this in a 20000 line code full of such functions, good luck. They have their use but it is not this. And this is especially bad to hear from someone who used to claim that having functions with more than six variables is bad design because it is hard to maintain. A software fully written by an LLM is the epitome of unmaintainability. LLMs are productivity enhancers, information reteievers, nice debuggers and good to discuss questions with to see if there is an angle you miss. That is all this if you can put aside all the ethical concerns related to them ofcourse. But they are not automated software coders.

    • IndustryStandard@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      17 days ago

      That is why you ask the LLM to find bugs and other instances where the first LLM cheated. The checking LLM will try to find abuse with all its might.

      • Avicenna@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        17 days ago

        It really turns into a tug-of-war, see my answer below. Despite it being quite good at debugging imo still requires a human in the loop for it not run in circles after a “bug” that is almost never relevant in practice but whose fix complicates the code.

        Try asking independent LLMs to find bugs in a code consecutively (fixing the founds bugs in between) and even after the rightfully major bugs are resolved, the independent newer instances will keep suggesting fixes (those which sometimes undoes its previous “fixes”).

        • IndustryStandard@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          17 days ago

          That is why you ask for visualizations and test real failure scenarios to see if they are detected properly.

          Large language models are not the same as they were 5 years ago. Pumping trillions of dollars to automate software engineering did som what pay off… They are really quite good nowadays despite the amount of hate they still get. Often they can detect sloppy mistakes by human coders too.

          Do not trust them blindly but test their results. Or use them only to generate tests on your artisan handwritten code to see if it can detect any mistakes.

    • Jerkface (any/all)@lemmy.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      17 days ago

      When you’ve been project managing interns and junior developers for 50 years, you have seen weirder shit than AI can ever dream of.

      • Avicenna@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        17 days ago

        For sure, but you don’t accept code from an intern without review much less have them write a full software without any supervision.

        • Jerkface (any/all)@lemmy.ca
          link
          fedilink
          English
          arrow-up
          0
          ·
          17 days ago

          Which is exactly what the original tweet was saying, is it not? Honestly, another LLM can read the code better. He’s still performing rigorous reviews.

          • Avicenna@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            17 days ago

            I found debugging code with LLM most productive when I am in the loop. Don’t get me wrong it can quite often find tricky bugs, those requiring some sort of reasoning (i.e connecting together multiple relevant pieces of information to arrive at the conclusion). However it often also suggest fixing issues that are almost always irrelevant in practice yet the fix complicates and bloats the code. LLM itself even accepts it when confronted. That is the main problem, in an attempt to overachieve at the task it is given, it can do deceptive or impractical things that can have negative effects. You might try to fix this with a config file but it just turns into a tug-of-war. So I find it more practical and trustable to simply eyeball the bugs it has found, implement (or ask LLM to implement) corrections to those and be amazed at how it found some of those bugs.

            Ofcourse if you have asked LLM to write the software from scratch, you don’t stand much chance of vetting the bugs via eyebaling. You have to spend much more time to understand how relevant they are. So your only option really is to defend the position of fully autonomous LLM coders…

  • melfie@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

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

    🙄😖

  • nanometer1625@thelemmy.club
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

    I had a discussion with my boss today about potential ways to write code with AI and have confidence in the results without reviewing every line. You’d also have to automate the reviews in some way, and therefore also a way to confirm that the reviewer AIs are working properly, etc. The conversation discouraged me because it made me feel like I’ll end up being a manager of AIs who write the code and test cases, and I’ll just be an ape who manually tests some of the behavior before approving it for release. This is essentially what managers have been doing with human development and QA engineers in the past, but even so, I have a really hard time letting go and not reviewing every line of code myself.