• Redkey@programming.dev
    link
    fedilink
    arrow-up
    11
    ·
    edit-2
    4 days ago

    The Mikado Method, eh?

    (All together) Three junior devs at work are we,
    Busy and harried as devs can be,
    Compiler warnings flowing freely,
    Three junior devs at work!

    (Alice) Everything is a source of bugs! (Laughter)

    (Bob) When they wrote this, were they on drugs? (Laughter)

    (Carlos) Don’t touch our “World’s Best Coder” mugs! (Laughter)

    (All together) Three junior devs at work!

    • HaraldvonBlauzahn@feddit.orgOP
      link
      fedilink
      arrow-up
      8
      ·
      3 days ago

      You have to imagine Alice, Bob, and Carlos 25 years later, working on production code that was created like this.

      XKCD on this: https://m.xkcd.com/2730/

      By the way, I am currently working on a 20 year old code base that was in production use all the years and was continuously adapted. At least the people who wrote this were (more or less) knowing what they were doing. I guess I should ask for a pay rise…

  • villainy@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    4 days ago

    You’ve inherited a 300k lines of spaghetti code. What do you do now?

    Quit.

    NGL this Mikado Method sounds pretty good 😉

  • thenextguy@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    4 days ago

    I’m not a tdd guy, but I would reach for tests first. You don’t know the code yet. Testing is the only way to stay sane. And writing the tests if they don’t exist yet will help you learn the code.

    • kibiz0r@midwest.social
      link
      fedilink
      English
      arrow-up
      7
      ·
      4 days ago

      Yes, but you do need to be careful with what level you test at. Too high level and the tests may be slow, flaky, and difficult to focus onto small details. Too low level and they may just bake-in the existing implementation.

      • thenextguy@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        4 days ago

        That was such a huge problem on my last job. Most of the unit tests just executed the code and didn’t really test anything and any time you changed the implementation everything broke.

        Thankfully it was truly my last job. 😊

    • dandi8@fedia.io
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      I think this is compatible with TDD. It’s just fancy divide-and-conquer.