• DreamButt@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    7 months ago

    Ngl that’s like baby levels of nasty code. The real nasty shit is the stuff with pointless abstractions and call chains that make you question your sanity. Stuff that looks like it’s only purpose was to burn the clock and show off a niche language feature. Or worse than that even is when the project you inherit has decade old dependencies that have all been forked and patched by the old team

    If all I had to worry about was organization and naming I’d be over the moon

    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      Git commits with message saying “pushing changes” and there are over 50 files with unrelated code in it.

    • criss_cross@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      My favorite was an abstract class that called 3 levels in to other classes that then called another implementation of said abstract class.

      And people wonder why no one on our team ever got shit done.

  • mcv@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    7 months ago

    I can live without documentation and comments, but then you’ve got to write really well-structured, self-documenting code. Which means long variable names (or better: local constants) that describe exactly what’s in them, and function names that describe clearly what the function is for, and readable code that shows what it does.

    But perhaps expecting that kind of discipline from people who lack the discipline to write documentation, was not entirely realistic.

  • OmgItBurns@discuss.online
    link
    fedilink
    English
    arrow-up
    1
    ·
    7 months ago

    I once worked with a guy who would actively remove everyone else’s comments any time he touched someone else’s code. Only comments he made during code reviews? “Does this comment need to be here?”. The code was a barren, commentless place.

  • ChickenLadyLovesLife@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    7 months ago

    There are no comments in the code

    At my last job, I was assigned to a project being run by a straight-out-of-college developer who felt that not only were comments unnecessary, they were actually a “code smell”, a sign of professional incompetence on the part of whoever added them. It’s an insane philosophy that could only appeal to people who have never had to take over an old codebase.

    • CodeBlooded@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Or, it appeals to people that have had had to take over an old codebase where the comments were all lies.

      “Code never lies. Comments sometimes do.”

      • ChickenLadyLovesLife@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        7 months ago

        It’s funny, the exact same logic applies to method and variable names. There’s no compiler that ensures that a method’s name accurately describes what the method does or ensures that a variable’s name accurately describes what the variable represents. Yet nobody ever says “you shouldn’t use descriptive method and variable names because they might be misleading”. And this is hardly academic: I can’t count the number of times I’ve run into methods that no longer do what the method name implies they do.

        And yet method and variable names are exactly what people mean when they talk about “self-documenting” code.

  • GreenKnight23@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    longest file I have ever maintained contained 50,000 lines of code.

    fifty THOUSAND.

    forgive me for not weeping for 2000 lines.

    my advice, don’t fucking touch it. pull out as much functionality out of it into other things over time.

    there will come a day when you can throw it away. maybe not today, maybe not tomorrow… but some day.

    • meekah@discuss.tchncs.de
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      Yeah, been there. The codebase I worked on also had a single method with 10k lines.

      The database IDs were strings including the hostname of the machine that wrote to the DB. Since it was a centralized server, all IDs had the same hostname. The ID also included date and time accurate to the millisecond, and the table name itself.

      Me: Mom, can we have UUIDs? Mom: We have UUIDs at home UUIDs at home: that shit

      • rbn@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        7 months ago

        You should add the local weather forecast, a random fun fact and the canteen menu of the day to the key to make it more interesting to read.

    • Hotzilla@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      I was working on a project that had 100 000 line oracle database PL/SQL procedure that ordered a work order from subcontractor. It was just one single function. That was called by classic asp + visual basic COM component.

      Oh Lord, I get Vietnam flashbacks about it.

  • Epzillon@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    Jesus i worked at exactly this kind of project once. The only other dev was also very hostile and protective of this position. He did not want me there in the slightest. Took about 6 months before we cancelled the contract since this dude was just actively harrassing me in Teams DMs on the daily and he just ignored all my concerns regarding maintainability since “he could understand the code” and i was probably just “not experienced enough”.

    Don’t downplay what this does to your mental health. 5 years of workplaces like this and I’m now starting to see a therapist due to exhaustion disorder symptoms in my goddamn 20s. Take care our there!

    • tiramichu@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      So infuriating when you have some dickhead making themselves unfireable by intentionally convoluting the codebase and chasing out any other hire. And even worse when management bought into it and think the guy’s an actual irreplaceable genius.

      Probably even believes it himself. I hate narcissists.

  • catnip@lemmy.zip
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    7 months ago

    Those are rookie numbers. We got functions with 5000+ lines and 20 levels of indentation directly in the user-interaction event handlers :)