who wants pasta in their computer?

  • palordrolap@fedia.io
    link
    fedilink
    arrow-up
    9
    ·
    2 days ago

    For writing loops, many early BASICs had FOR/NEXT, GOTO [line] and GOSUB [line] and literally nothing else due to space constraints. This begat much spaghetti. Better BASICs had (and have) better things like WHILE and WEND, named subroutines (what a concept!) and egads, no line numbers, which did away with much of that. Unless you were trying to convert a program written for one of the hamstrung dialects anyway, then all bets are off.

    Assembly style often reflects the other languages people have learned first, or else it’s written to fit space constraints and then spaghettification can actually help with that. (Imagine how the creators of those BASICs crammed their dialect into an 8 or 16K ROM. And thus, like begetteth like.)

    C code style follows similarly. It is barely concealed assembly anyway.

    COBOL requires a certain kind of masochist to read and write. That’s not spaghetti, it’s Cthulhu’s tentacles. Run.

      • palordrolap@fedia.io
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        A lot of the original C coders are still alive or only very recently gone (retired, or the ultimate retirement, so to speak), and they carried their cramped coding style with them from those ancient and very cramped systems. Old habits die hard. And then there’s a whole generation who were self-taught or learned from the original coders and there’s a lot of bad habits, twisted thinking and carry-over there too.

        (You should see some of my code. On second thought, it’s probably best you don’t.)

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

          You should see some of my code. On second thought, it’s probably best you don’t.

          thats the same warning i give to anyone looking at ~/scripts. particularly ~/scripts/bas, ~/scripts/js and ~/scripts/bat_bkp (which is copy of /mnt/msdos/jp/batch)

          all code in those folders is like that