• xthexder@l.sw0.com
      link
      fedilink
      arrow-up
      18
      arrow-down
      1
      ·
      17 hours ago

      The best refactors always remove more lines than they add. This is a horrifying ratio if no new features were included.

    • mcv@lemmy.zip
      link
      fedilink
      arrow-up
      4
      ·
      17 hours ago

      Yeah, adding that many lines does not sound like a cleanup to me. Unless it’s mostly adding unit tests.

    • lengau@midwest.social
      link
      fedilink
      arrow-up
      7
      ·
      13 hours ago

      Ive done a few of those, but they were all preparatory refractors, pulling out bits of code to turn them into standalone functions that are only used once because my next PR uses them, and then adding unit tests for those new functions. -100 or so lines of code, +300 or so when you take into account the new docstrings, etc.

      (The secret to doing these preparatory refractors is to actually do them after writing the “next” PR so you’re not unnecessarily refactoring stuff you’re going to touch.)

      • mertn@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 hours ago

        I once tasked a guy with writing a floppy disk driver. He wrote two completely different drivers. One for drive A, and another for drive B. Maybe the AI doing the refactoring was trained on that sort of code.

  • kibiz0r@midwest.social
    link
    fedilink
    English
    arrow-up
    78
    arrow-down
    1
    ·
    1 day ago

    It is wild that Anthropic decided to go with “Claude”, as in “Claude Shannon”, as in the guy who formally proved that information degrades every time it passes through a channel that can’t represent it in a mathematically reversible way.

    If you can’t theoretically produce the original code, given the “refactored” code… congratulations, you have lost information.

  • Gyroplast@pawb.social
    link
    fedilink
    English
    arrow-up
    64
    ·
    1 day ago

    Perfection is achieved, not when there is nothing more to add, but when there is nothing more to take away. — Antoine de Saint-Exupére

    +55653, -937? That is not beauty, even if it all “worked”.

    • regdog@lemmy.world
      link
      fedilink
      arrow-up
      32
      ·
      1 day ago

      I would say a few new lines are OK if they at least improve the readability of the code.

      But given that AI was doing the work, I would say it is even less readable now.

      • Gyroplast@pawb.social
        link
        fedilink
        English
        arrow-up
        31
        ·
        1 day ago

        Slinging random quotes at Jr. devs works best if you have one for every rebuttal:

        Everything should be as simple as it can be, but not simpler. — Albert Einstein

  • hansolo@lemmy.today
    link
    fedilink
    arrow-up
    24
    ·
    1 day ago

    If the movie Tron were true, or The Matrix, and code was alive and sentient, things like this would be horror on the level of the Star Trek: TMP transporter accident.

    • MangoCats@feddit.it
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      15
      ·
      1 day ago

      It depends on the size / complexity of what they’re trying to port, of course, but it’s not at all unusual for a programmer to be the main income source for a median household and to take a year on a project. Or, be a member of a 5-10 programmer team that takes 2-4 years to develop a project. In a “butts in seats” office world like we mostly had before 2020, that was a LOT of commute miles driven to make that software, way more than $1000, and energy consumption for the households and the offices and their HR, accounting and other administrative overhead…

      • Grail@multiverse.soulism.net
        link
        fedilink
        English
        arrow-up
        8
        ·
        22 hours ago

        Counting energy consumption by a programmer’s children as a cost of code generation? That’s the most capitalist thing I’ve read in a month!

        • MangoCats@feddit.it
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          2
          ·
          22 hours ago

          Not acknowledging the costs of a programmer’s children is the ultimate late stage capitalism.

      • wonderingwanderer@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        22 hours ago

        Yes but how many billable hours did they get for this 320-minute ordeal?

        Spending $1000 on transportation costs commuting to and from work over a span of 2-4 years is completely different from burning through $1000 dollars of tokens in a single workday.

        Especially if the boss now demands the same amount of output from you every day as the new normal.

        And that’s not to mention how the energy and water consumption happens on a much shorter timescale than the drawn out one you needed to cite to make it seem comparable.

        • MangoCats@feddit.it
          link
          fedilink
          arrow-up
          1
          ·
          25 minutes ago

          Aggregate, because they’re courting billions of potential users, the energy and water consumption of AI agents is concerning.

          One project? For a continuous 320-minute (5.33-hour) project using Anthropic’s Claude Fable, the estimated electricity consumption ranges from 203.2 Wh to 406.4 Wh, while the associated water consumption ranges between 0.39 Liters and 0.77 Liters. https://www.computing.co.uk/news/2026/ai/new-dashboard-estimates-energy-consumption-of-claude-gpt-and-gemini

          It takes about 100-150ml of diesel fuel to generate 406 Wh of electricity, you’d be lucky to get an efficient commuter car to travel even 3 miles on that much fuel, and the driver will consume more than 0.77 liters of water during a day, especially if they take a shower.

          The growth has been explosive, and the newly added datacenter capacity isn’t being done well or sustainably in a lot of cases, but if you assume that OP’s job could be done well with assistance from Fable if he put in 10x the effort, that’s still likely to land on the net lower impact to the environment than if he commuted to an office for a week to do the same.

          The real question, even before LLM “AI”, is: is this a job worth doing? Right now, a lot of people are “playing” with AI doing things they never could attempt before. Some small fraction of that is useful - how small is the question, and how long before we slow down on the frivolous uses?

        • MangoCats@feddit.it
          link
          fedilink
          English
          arrow-up
          1
          ·
          21 hours ago

          320 minutes of wall clock time on Fable tells you nothing, cost could be anywhere from $2 to $2000.

  • MangoCats@feddit.it
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    8
    ·
    1 day ago

    Maybe you (the Claude porter) should have written a few requirements and specifications to test to first?

    1998 a company bought our software that had been developed (part time, by a single programmer) since 1991, first in C/DOS, then refactored into Borland VCL/C++ in 1997. Buyers declared they would refactor it into MFC/Win 32 because it was “easier to hire good MFC/Win 32 programmers than VCL programmers.” So, they went and found two “good MFC programmers.” They assessed the job carefully and declared that it should be about 6 weeks to do the port - just a straight copy of the existing funcfionality into the new API - no need to add features or change anything.

    3 months later, they hired 2 additional MFC programmers. The new assessment was that they had made “good progress” and would be done in another 2-4 weeks.

    3 months after that, they declared that they had big plans for future development of the software, and they were “90% done with the port” but they’re going to “build up the team” and they hired another 3 programmers with a position open for what would be the 8th member of the team, but they were “looking for just the right candidate” for that spot.

    9 months after starting, I casually asked one of the programmers how the port was going and he said: “we’ve got about 80% of the original functionality working in the new system, and most of the development is starting to turn toward newly identified business needs.” “So, you don’t need the other 20% of the original feature set?” “Oh, no, we need that, it’s core to the business case, it’s just taking time to make it happen in MFC.” These were “good programmers” - no turnover, management happy with their efforts.

    The original programmer was me, straight out of school, no management or mentor. The spec came from the company owner one feature at a time as ideas hit him I’d basically write them down on an electronic “sticky note” and when it was working to his satisfaction we’d throw that sticky note away, the code was the documentation. Eventually, the industry started requiring documented testing, so we hired an intern from the local college and she made some documents recording her ad-hoc testing of what the owner verbally described to her as the things the software should be doing, but mostly she read the code as her specifications. This was actually state of the art in the 1990s in most places I interacted with.

    About 18 months before the 1998 buyers came around, we had another company try to reproduce about 10% of the original program functionality independently as a module in their existing software; this was agreed (insisted by the buyers, actually) to be done without our code to model from - just using our front-end hardware to collect the data. Instead of building a team, they hired a series of programmers, usually in 2s, and they’d usually quit after about 6 months. I think it was the 5th set of 2 programmers there that finally got that feature working.

    So, 320 minutes would have been a pretty impressive port effort, but did you really expect the chainsaw to cut the whole forest down and load it onto logging trucks for you?

    I wonder, in the “none of it works” area, how many days it would take to write requirements / specifications for what is expected and how long it would take Fable to fix the port to meet all those expectations? Probably quite a bit less than a year for one or two “good developers,” I would guess.

    • chloroken@lemmy.ml
      link
      fedilink
      English
      arrow-up
      8
      arrow-down
      34
      ·
      23 hours ago

      You sound like such a fucking loser it is incredible.

      AI fanatics will never cease to amaze me in unpleasant ways.

        • chloroken@lemmy.ml
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 hour ago

          Ah yes, thank you sh.itjust.works user for the weaponized false concern. A tactic employed by shitbrain reactionaries with absolutely nothing constructive to add.

          Was it me calling AI bros losers that made you look for a way out?

        • daq@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          3
          ·
          20 hours ago

          So strange when I see replies to ml comments. I’ve had all those servers blocked since I started using Lemmy on all the instances I use.

          • chloroken@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            1 hour ago

            Bury your head in the sand so the scary communists don’t accidentally convert you!

          • ChickenLadyLovesLife@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            14 hours ago

            I never notice when a user or a thread comes from ml until I say something that is real-world uncontroversial like “Stalin had some people murdered” and get flamed for it. I’ve never really felt the need to block servers on Lemmy but ml sure makes me think about looking up how to do it.