• Bubbaonthebeach@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    Code that has lasted, with some maintenance, for 50+ years vs code that doesn’t work from day 1? What advances we have made!

  • Slashme@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    Remember that Fortran has an arithmetic if statement. You can write

    IF (expression) s1, s2, s3
    

    where s1, s2 and s3 are labels. If the expression is negative, it jumps to s1. If it’s 0, to s2 and if it’s positive, to s3.

    It also has goto variable. You can do

    INTEGER a
    ASSIGN 20 TO a
    ASSIGN 17 TO a
    GO TO a
    20 PRINT *, "foo"
    17 PRINT *, "bar"
    

    and it’ll print “bar”. In this snippet of code, everything seems quite logical, but imagine debugging spaghetti code written using these patterns.

    Oh, it also has

    GO TO (s1, s2, ... , sn), N
    

    First, N is converted to an integer. If N is 1, it goes to label s1. If N is 2, it goes to s2. If N is less than 1 or greater than n, it does nothing.

  • 14th_cylon@lemmy.zip
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    the fortran code was probably written by someone who knew what they were doing and didn’t need 1 gb of libraries to implement the save button.

    and the fact that the code survived till today does say something about its quality. i don’t think this is hard choice.

  • neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 month ago

    Fortran. At least it was comprehensible to a human brain once upon a time. And probably efficiently written.

    • SpaceCowboy@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      1 month ago

      Yeah really. It would be some tough sledding at first, but it would be far better than looking at some code with some nicely named methods and variables with lots of comments (with emoticons!) for days… only to find out it does absolutely nothing.

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

        Wow you’re right! Your comment:

        ✅ Makes a valid point

        ✅ Does it consisely and with meaning

        ✅ Doesn’t repeat itself unnecessarily

        Would you like me to compliment your commenting skills further?

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

      On the other hand, you know the Fortran works and you can break it.

      The vibe code is already broken.

      I’m still pounding the Fortran button as hard as I can.

    • Kairos@lemmy.today
      link
      fedilink
      arrow-up
      0
      ·
      1 month ago

      If you’re good at assembly you’ll be fine once you get past the bad formatting, short names, etc. that was common at that time.

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

    I would genuinely love to find a job coding FORTRAN, mainly because it means I’d almost certainly be doing some kind of scientific computing. Way better than most tech jobs that involve boring CRUD work you don’t care about at best, or actively making the world worse implementing the whims of some billionaire sociopath at worst.

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

      Also, the code base will likely be pretty small. If something’s made to be delivered on punch cards and run on devices that measure their memory in KB or maybe MB, it’s not going to be a ton of code. Even if it’s pure assembly, it’s going to be easier than a huge automatically generated codebase.

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

          Compared with any modern codebase that’s still tiny.

          From what I can see Rollercoaster Tycoon was hand-written by a single person, so it by definition cannot be huge.

          • AnarchistArtificer@slrpnk.net
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 month ago

            I wish that the code was open source, because it’d be super interesting to be able to look under the hood of a game like Rollercoaster Tycoon

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

              It kinda is. Assembly is a 1:1 machine-code equivalent, so you just have to run the game through a disassembler and you get the “source”. You just dont get the documentation.

  • ranzispa@mander.xyz
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    I like Fortran very much, but don’t get me wrong: maintaining Fortran code from 69 must be a huge pain in the ass. It is certainly code written by researchers who have no idea about programming practices. It is sure full of exceptions everywhere, all variables are 2 characters long. The codebase grew over the years and is now several millions lines of code, most of which is the same functionality copied everywhere with slight changes. You have no idea what each subroutine is supposed to do, and it doesn’t help that most algorithms used in there were never published or documented.

    I think I’ll go with the vibe coding for this one.

    • Amberskin@europe.pub
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      Fortran IV (and anything before Fortran 77) is a pain in the ass.

      But I’d take it any day before code allucinated by a shitty token predictor.

  • deegeese@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    The Fortran is tight, works, and has 50 years of field testing.

    Much rather work on something old and proven than new and slapdash.