who wants pasta in their computer?

  • dosuser123456@lemmy.sdf.orgOP
    link
    fedilink
    arrow-up
    33
    ·
    edit-2
    1 month ago

    ps: you know something you wrote is funny when taken out of context when someone screenshots it and after a while youre sent the screenshot of your message

  • Redkey@programming.dev
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    1 month ago

    Assembler, BASIC, Old C code, Cobol…

    …Pascal, Fortran, Prolog, Lisp, Modern C code, PHP, Java, Python, C++, Lua, JavaScript, C#, Rust…

    The list is infinite.

    Show me a language in which it is impossible to write spaghetti code, and I’ll show you someone who can’t recognize spaghetti code when it’s written in one of their favourite languages.

    • UnrepentantAlgebra@lemmy.world
      link
      fedilink
      arrow-up
      10
      ·
      1 month ago

      The obvious solution is to use Rust’s upcoming “spaghetti checker” feature. Once the compiler decides that your code is too messy to be maintainable, it refuses to compile.

      • dosuser123456@lemmy.sdf.orgOP
        link
        fedilink
        arrow-up
        4
        ·
        1 month ago

        great, now the compiler wont let me modify my programs (i really should get better at coding because i seem to only know to do spaghetti)

    • dosuser123456@lemmy.sdf.orgOP
      link
      fedilink
      arrow-up
      2
      ·
      1 month ago

      thats exactly what the “you get the idea” line meant, i was only giving some examples because if i did itd be literally every language

      (also modern c is spaghetti, but old c is even more. legacy code is spaghetti no matter the language)

  • stingpie@lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    1 month 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?

    • Endmaker@ani.social
      link
      fedilink
      English
      arrow-up
      8
      ·
      edit-2
      1 month 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
      cake
      link
      fedilink
      arrow-up
      4
      ·
      1 month 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.

    • thedeadwalking4242@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      1 month 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”

  • CrazyLikeGollum@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 month ago

    Is an assembler not a compiler for an assembly language?

    Is saying “I wrote code in assembler” not functionally equivalent to saying “I wrote code in GCC?”

    Note: this is a genuine question, not sarcasm.

    • dosuser123456@lemmy.sdf.orgOP
      link
      fedilink
      arrow-up
      7
      ·
      1 month ago

      well, in my country (spain) assembler and assembly are basically used interchangeably, so i do that a lot. will take into account for future posts tho.

    • gadfly1999@lemm.ee
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 month ago

      Anywhere I’ve actually seen it used , assembler and assembly were pretty much interchangeable. Assembly code is probably technically correct, but you could be writing code for the assembler so nobody will actually be confused. Per your example, you might say “I wrote code in MASM,” to reference a specific assembler. Again nobody that’s actually worked with any of this would bat an eye at the usage.

  • peoplebeproblems@midwest.social
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 month ago

    Calling assembler code spaghetti isn’t really that fair. I mean granted, everything ends up as “syscall” this and that, but it’s still more like one long spaghetti noodle with some meatballs and sauce.

    Old C code, written for like microelectronics suffers from it, sure.

    But for that gud spaghetti you gotta getti the BASIC and Cobol programs. Thems is good spaghetti.

    (And we’re going to ignore python right)

  • Eiri@lemmy.ca
    link
    fedilink
    arrow-up
    4
    ·
    1 month ago

    Sometimes I call my colleagues Italians 🤌

    (None of them are from Italy, but that pasta!)

    • dosuser123456@lemmy.sdf.orgOP
      link
      fedilink
      arrow-up
      2
      ·
      23 days ago

      windows xp kernel included dirty hacks from when ms-dos 6.22 was in active development and not released yet and they might still be there in 10