Skip to main content

Timeline for Why was `!` chosen for negation?

Current License: CC BY-SA 4.0

35 events
when toggle format what by license comment
Jan 20 at 18:58 comment added CoffeeTableEspresso @TobySpeight I think the fact that that looks like double bitwise negation is a pretty obvious reason why that wasn't chosen.
Aug 11, 2024 at 3:09 comment added ssokolow @dave Not necessarily, though. C is a hugely influential language, syntax-wise, so that could be read as "Every use of ! I found for this meaning was in a context that took influence from C, but I can't find anything C borrowed it from."
Aug 10, 2024 at 16:35 comment added dave On re-reading this question, it seems to follow the common idea that someone was 'the first' to do something, and others followed it. There's often no supporting evidence for this; independent designers can reach the same conclusion without being aware of others doing the same,
Aug 10, 2024 at 15:13 comment added Toby Speight Given that we ended up with && and || for logical operators corresponding to bitwise & and |, I think it's surprising we didn't end up with ~~ for negation.
Jun 15, 2022 at 14:15 comment added Eljay @ChrisH • In earlier ASCII, the ¦ at 0x7C (broken bar) was to distinguish it from | (vertical line) as the alternative glyph at 0x21 (normally ! (exclamation mark)), which was a concessions to 6-bit character set computers. Later ASCII changed that glyph assignment. Earlier IBM PC computers still had ¦ in its extended ASCII character set.
Jul 1, 2021 at 19:11 answer added DPaden50 timeline score: 1
Jun 18, 2021 at 12:27 history edited user3840170 CC BY-SA 4.0
edited tags
Jun 17, 2021 at 17:48 answer added dfrib timeline score: 24
Jun 17, 2021 at 4:33 answer added account-minute timeline score: 1
Jun 17, 2021 at 2:48 comment added dave It occurs to me that, in a language that did not confuse boolean and integer types, - would have worked for logical negation. Did any language do that?
Jun 16, 2021 at 20:13 comment added Matija Nalis @dan04 vertical bar (both with hole and without) history even in ASCII (which is far from single exact standard, but rather myriad of partly incompatible revisions) is riddled with incompatible changes, see jkorpela.fi/latin1/ascii-hist.html for example
Jun 16, 2021 at 19:18 comment added Maury Markowitz # is a better approximation of ≠, and was used as such in most BASICs descended from HP. This was definitely not available on UK keyboards though, but given it was Bell I doubt this was the reason.
Jun 16, 2021 at 18:41 comment added Walter Mitty The negation symbol ¬ was fairly widely used in published papers in 1969. But it wasn't in 7 bit ASCII. And that's probably the target character set for B, C , and Unix v0.0
Jun 16, 2021 at 14:18 comment added LAK @BrianTompsett-汤莱恩 The 'xBase' languages use # as the not-equal operator; I guess the thought is that 2 slashes through the equals are better than one.
Jun 16, 2021 at 12:03 comment added dave @dai - Thanks. BS 4822 was published 1994, replacing a 1980 version. But I think no 'not' sign when C was being invented. The 1980 spec mentions the 7-bit ISO code, which AFAIK had no 'not'. Still, this is all might-have-been.
Jun 16, 2021 at 10:42 comment added Dai @another-dave The key in the top-left corner: en.wikipedia.org/wiki/File:KB_United_Kingdom_Ext.png - The official standard is BS 4822, however it was withdrawn in 2014 apparently - with no replacement. I guess that means the BSI has stopped setting a spec for UK keyboard layouts then - which is odd. UPDATE: Oh, now it's BS/ISO/IEC 9995-9 updated in 2016: shop.bsigroup.com/ProductDetail?pid=000000000030378348
Jun 16, 2021 at 8:09 answer added Kaz timeline score: 119
Jun 15, 2021 at 23:09 comment added dave @Dai - UK keyboards having ¬; not in my experience they didn't. My experience in the mid-70s was Flexowriters and Teletypes, and then imported DEC gear. In fact, I ran into no character set with ¬ in it, except for IBM gear. Maybe you had an ICL keyboard after the 2900 adopted EBCDIC? Can you elucidate?
Jun 15, 2021 at 22:02 answer added Owen Reynolds timeline score: 8
Jun 15, 2021 at 17:36 answer added sevensevens timeline score: 32
Jun 15, 2021 at 15:34 comment added Chris H @dan04 I nearly submitted the comment calling one "pipe" and one "vertical bar", then noticed the glyphs were identical on the screen. So I tested: in a terminal they look identical and both work for bash pipelines. Visually they match | U+007C vertical line and not ¦ U+00A6 broken bar. But this may be a glitch in Ubuntu's keyboard layout. I ought to remap one to something more useful (and ¬ for that matter)
Jun 15, 2021 at 15:29 comment added dan04 @ChrisH: Is it actually a duplicate, or different keys for | and ¦?
Jun 15, 2021 at 11:30 comment added Chris H @Dai that's probably the most pointless symbol on the UK keyboard, along with the duplicate pipe on the same key
Jun 15, 2021 at 4:49 comment added Dai The shame here is that UK keyboards have a key dedicated to the formal symbol for Logical Negation ¬ (and the broken-pipe symbol) - but the US keyboard doesn't - so methinks if K&R had a British keyboard for some reason then we'd be using better symbology all around, especially in C-derived languages today :)
Jun 15, 2021 at 2:44 comment added texdr.aft @dan04 But weren't the early augmented assignment operators like =+, =/?
Jun 15, 2021 at 2:09 history became hot network question
Jun 14, 2021 at 21:56 comment added dan04 @BrianTompsett-汤莱恩: /= or |= would also work as approximations of , but C uses those operators for other things.
Jun 14, 2021 at 20:46 comment added Brian Tompsett - 汤莱恩 Probably because != is as close to ≠ as you can render in a limited character set, but it is only an opinion, not an answer.
Jun 14, 2021 at 20:16 comment added Tommy @dan04 it seems to have arrived between BCPL and B then, per A Tutorial Introduction to the Language B by Kernighan.
Jun 14, 2021 at 20:13 answer added Clinton Pierce timeline score: 58
Jun 14, 2021 at 19:01 comment added ErikF Doesn't look like it's from APL, my "goto" language when it comes to wacky characters :! is the factorial function.
Jun 14, 2021 at 18:18 history edited blues CC BY-SA 4.0
added 1 character in body
Jun 14, 2021 at 18:16 comment added dan04 Well, this usage was not inherited from BCPL, which used ! as the array indexing operator. (The Development of the C Language)
Jun 14, 2021 at 18:10 review First posts
Jun 14, 2021 at 18:27
Jun 14, 2021 at 18:07 history asked blues CC BY-SA 4.0