In this letter, Dijkstra talks about readability and maintainability in a time where those topics were rarely talked about (1968). This letter was one of the main causes why modern programmers don’t have to trouble themselves with goto statements. Older languages like Java and C# still have a (discouraged) goto statement, because they (mindlessly) copied it from C, which (mindlessly) copied it from Assembly, but more modern languages like Swift and Kotlin don’t even have a goto statement anymore.

  • mrkite
    arrow-up
    4
    arrow-down
    1
    ·
    5 months ago
    link
    fedilink

    And yet it’s still easy to write spaghetti code in Java. Just abuse inheritance. Where is this function implemented? No one knows but the compiler!

    • 0x0
      arrow-up
      4
      arrow-down
      0
      ·
      5 months ago
      link
      fedilink

      You mean SpaghettiFactory()

    • SatouKazuma
      arrow-up
      3
      arrow-down
      0
      ·
      5 months ago
      link
      fedilink

      And don’t forget to use miracle sort for any sorting needs you have. Why do the work yourself when you can just hope it gets solved for you?!

    • warlaan
      arrow-up
      1
      arrow-down
      1
      ·
      5 months ago
      link
      fedilink

      That doesn’t make it spaghetti code though. In well-written OOP code you shouldn’t care where a function is implemented. The problem is a much too high level of abstraction. If your high level code is so abstract that it is only running tasks and handling messages there’s no way to write it in a way that prevents mistakes because you couldn’t possibly know what the actual implementations do.