1. 77
  1.  

  2. 8

    One of the better histories I’ve read in some time. Thanks.

    1. 4

      I’m reminded of an article by…I think it was in The Creation of the UNIX Operating System but I’m not sure…where they said something like “Macros were invented. Someone had to invent them, and that someone was Douglas McIlroy.”

      (McIlroy also invented the concept of pipes.)

      (And a bunch of other UNIX tools.)

      (And participated in the design of a bunch of programming languages.)

      1. 4

        So the short version of this theory is: Someone hastily translated from german to “else.” We don’t know the source.

        Today I learned that else comes from proto-germanic alljas. This is also the root for the (old high) german alles which translates to “all”.

        It sounds plausible that they translated “any case” or “always” to “alle/alles” and then back to “else”.

        1. 2

          I’d guess “sonst”, which translates to ‘or else’, with the ‘or’ having been dropped.

        2. 4

          Why are they implying “if ..l then … else” isn’t proper English? I just looked up “else” in the Oxford Dictionary of English, and one of the meanings is:

          “or else”: Used to introduce the second of two alternatives: “he always had a cold or else was getting over an earache.”

          Leaving out the “or” is understandable for a computer language, since most languages (COBOL and SQL are exceptions) only use one-word reserved words.

          1. 3

            Quite interesting!

            I have spent some time this years to reduce the design debt created by programming languages accumulating if-then-else-statements, but also ternary operators, switch/case and pattern matching, and unifying it down to one contruct again.

            I have often worried whether some of my designs were diverging too much from ‘mainstream’, but I think this article demonstrates fairly well just how arbitrary the ‘mainstream’ designs were we ended up with in the first place.

            1. 2

              What have you come up with?

              1. 2

                See this.

              2. 2

                I’d be curious about what you converged on. It’s one of our open design points in Verona: we definitely want pattern matching on value or type, but we want to have as few control constructs in the language as possible.

                1. 3

                  The core insight is that the difference between if-then-else and pattern matching is that the latter allows splitting the conditional.

                  I introduced this to if-then-else and could therefore do away with separate syntax for pattern matching:

                  if 1.2 * x
                    .. === NaN     then "NaN"
                    .. .isInfinite then "Inifinity"
                    .. > 9000      then "Large"
                                   else "Small"
                  

                  or

                  if person
                    .. .age < 18                     then "18"
                    .. .name contains("ExampleUser") then "-1"
                                                     else "0"
                  

                  Patterns are done with is:

                  if person
                    .. is Person("Bob", $age) then "$age"
                                              else "0"
                  

                  I wrote more about this here.