News for hackers. Stuff that matters.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by aap_ on Sunday December 11, 2022 @06:26AM (#33942286)
I couldn't think of a worse clickbait title than this. The quote has nothing to do with C.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by karmakaze on Sunday December 11, 2022 @10:39AM (#33944042)
The quote seems to apply to the origins of C upon reading.

> One minor quibble was Strachey’s objection to the grammar of “IF … THEN … ELSE” statements. “I cannot allow my name to be associated with a definite recommendation to use ignorantly incorrect English,” was his view, as Hartley later wrote for Annals of the History of Computing. Strachey preferred “OR,” which conflicted with the way “OR” was used in nearly every other programming language in existence. Nonetheless, his preferences carried the day, and the CPL reference manual included “OR” in the place where users would have expected “ELSE.”

That seems like a pretty stupid thing to do--perhaps not at the time by the 'do'ers.

Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by xnorswap on Monday December 12, 2022 @05:10AM (#33952962)
I hadn't thought about it before, but I'd have gone with:

> IF THEN OTHERWISE

Which avoids overloading OR and maintains better grammar.

But I suspect shorter words were preferable when space was a premium everywhere not least on the display itself.

Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by Y_Y on Monday December 12, 2022 @05:52AM (#33953289)
WHEREUPON x PURSUANT y CONTRARIWISE z
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by matheusmoreira on Monday December 12, 2022 @01:34PM (#33958323)
I remember saving this code from somewhere.

  #include <stdio.h>

  #define PREACH printf
  #define SHOULD_GOD_WILL if
  #define EACH_AND_EVERY_CREATURE_UNDER_GODS_LIGHT for
  #define OTHERWISE else
  #define RETRIBUTE return
  #define ALONG_WITH &&
  #define THUS }
  #define LET {

  int main() LET
      EACH_AND_EVERY_CREATURE_UNDER_GODS_LIGHT (int i = 0; i < 100; i++) LET
          SHOULD_GOD_WILL (i % 5 == 0 ALONG_WITH i % 3 == 0) LET
              PREACH("Fizzbuzz!\n");
          THUS OTHERWISE SHOULD_GOD_WILL (i % 5 == 0) LET
              PREACH("Buzz!\n");
          THUS OTHERWISE SHOULD_GOD_WILL (i % 3 == 0) LET
              PREACH("Fizz!\n");
          THUS OTHERWISE PREACH("%d\n", i);
      THUS

      RETRIBUTE 0;
  THUS
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by irrational on Monday December 12, 2022 @09:09AM (#33954737)
Wherefore art thou utilizing contrarwise? Dost thy senses leave thee?
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by Smaug123 on Monday December 12, 2022 @12:15PM (#33957281)
twitch

"Utilize" first arose in 1807 if Merriam-Webster is to be believed, well past the period you're quoting; and "dost" should agree with the number of its noun "senses". ("dost" is second-person, but you need something third-person.) In this context I also don't really like the continuous present of "are you utilizing", but I can't put words to why. I believe "hast thou taken leave of thy senses" is actually recorded to be idiomatic.

By the way, ChatGPT suggests (where I've fixed its analogous error in the word "doth"):

> Pray tell, wherefore dost thou employ the term 'contrariwise'?

Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by jolmg on Monday December 12, 2022 @09:57AM (#33955276)
Haskell uses `otherwise`. Example use:

  greater x y
    | x > y     = x
    | otherwise = y
In Haskell's case, this is a conditional syntax that's alternative to if-then-else, so `else` was already taken. `otherwise` is just a conventional constant for `True` that's chosen for readability.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by Y_Y on Monday December 12, 2022 @12:48PM (#33957697)
Which lets you write gems like:

    if otherwise then not
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by captainmuon on Monday December 12, 2022 @04:19AM (#33952624)
Maybe language changed since then, but to me 'else' sounds right and 'or' sounds wrong:

    IF (condition) THEN (do-this) ELSE (do-that).
I think 'or' would not go with alternative commands, but with an alternative condition:

    IF (condition) THEN (do-this) OR (other-condition) THEN (do-that).
If you don't want to use 'else' then 'otherwise' would sound idiomatic, too.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by smcl on Monday December 12, 2022 @06:32AM (#33953541)
Remember that there’s already two commonly used elements of logic and programming (bitwise OR, logical OR) that may well form part of condition/other-condition, so while if/then/or may (subjectively) scan a little better in isolation, I think “else” might have been the right call
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by GTP on Monday December 12, 2022 @08:10AM (#33954266)
According to the article, the stupid thing was developing a new language just because you built a new computer. But the efforts in developing this new language (CPL) are what lead to C.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by aap_ on Monday December 12, 2022 @04:18AM (#33952612)
Sure, somebody admitted to doing something stupid, but the title is clearly meant to attract all the C bashers by pretending the quote is from someone who was involved in the development of C.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by fanf2 on Monday December 12, 2022 @02:27PM (#33959006)
There is a neat history of the early syntax of conditional expressions here https://github.com/e-n-f/if-then-else/blob/master/if-then-el... titled “if-then-else had to be invented”. It seems “else” originated in Algol 60 as a hasty translation from German. The CPL project started in the early 1960s when it was not yet certain that Algol-style block structure and keywords would become the common basis of most programming languages.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by cesaref on Monday December 12, 2022 @04:41AM (#33952777)
I don't remember this in BCPL, so I presume it was one of the changes from CPL?
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by dang on Monday December 12, 2022 @11:55AM (#33956994)
The article does talk a lot about the origins of C, so it's fair for that to be in the title. We can make it more accurate by throwing in CPL and BCPL too.
Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by rramadass on Monday December 12, 2022 @11:35PM (#33964886)
Agreed. The title is garbage (Ars should know better).

But the article is a good History of C and worth a read.

Re:“A damn stupid thing to do” – The origins of CPL, BCPL, a... by observer4 on Sunday December 11, 2022 @10:14AM (#33943843)
LOL. That's right. Well observed. Just the "origins of C" would be a lot more honest. I also liked the commentary on theory and practice, which could have something to do with C and UNIX and the whole story.