who wants pasta in their computer?

  • stingpie@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    19 hours ago

    After reading a lot of comments in this thread, I’m not sure I know what spaghetti code is. I thought spaghetti code was when the order of execution was obfuscated due to excessive jumps and GOTOs. But a lot of people are citing languages without those as examples of spaghetti code. Is this just a classic “I don’t like this programming language, and I don’t know much about it.” Or is there something I’m missing?

    • thedeadwalking4242@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      13 hours ago

      It’s more incredibly tangled and highly coupled code. It’s the kinda code where you can’t change anything because it causes a catastrophic cascade of issues. Basically where software engineers throw design out the window and just starting coding random bullshit that “works”

    • Endmaker@ani.social
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      18 hours ago

      Spaghetti is all messy and tangled up; spaghetti code is the same.

      when the order of execution was obfuscated due to excessive jumps and GOTOs

      That’s one way to make your code messy and thus achieve spaghetti code.

      In general, when some code is very poorly written, it becomes spaghetti code.

    • Quatlicopatlix@feddit.org
      link
      fedilink
      arrow-up
      4
      ·
      17 hours ago

      I work in a company that has a old codebse in c with tons of realtime intime stuff that is acessed via a shared memory from the realtime to the non realtime system. Tons of strucs get copied around then typecast to other structs and global variables all over the place. You never know where a variable is written to and where it is also acessed from or if it is just a copy. No assembly but still super obscure.