• neidu3@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    3
    ·
    13 days ago

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

    • Kairos@lemmy.today
      link
      fedilink
      arrow-up
      3
      ·
      13 days 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.

    • SpaceCowboy@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      13 days 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.

  • Slashme@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    8 days 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.

  • 9point6@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    13 days ago

    Isn’t it more COBOL than FORTRAN in terms of getting paid?

    I thought FORTRAN was pretty much exclusively used via SciPy in research & academia these days.

    COBOL is still powering the world economy on mainframes

  • Bubbaonthebeach@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    13 days 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!