5 ms·
The history of curly braces
- jckt 13y agoGoogle's cache here (as it seems down for some people): http://goo.gl/PWIme http://goo.gl/PWIme
- pygy_ 13y agoHe mentions thqt the backslash was added to the character set to allow the representation of boolean operators when paired with its forward cousin: A /\ B \/ C I wonder why that notation was abandoned in programming languages.
- chinpokomon 13y ago& and ^ are just one character? Actually I think you could use both to disambiguate between logical and bitwise. I'm not sure if it is a good idea yet, but it would force the developer to see them as different operations; something that easily confuses beginners.
- vanderZwan 13y agoAs much as they are hated by some, there's empirical data indirectly suggesting that using curly braces for scoping might lead to less mistakes when reading code: > Similarly, the twospaces version of counting demonstrated that vertical space is more important then indentation to programmers when judging whether or not statements belong to the same loop body. Programmers often group blocks of related statements together using vertical white space, but our results indicate that this seemingly superficial space can cause even experienced programmers to internalize the wrong program. http://arxiv.org/abs/1304.5257 http://arxiv.org/abs/1304.5257 Of course, whether or not curly braces significantly help in this situation would require another experiment. Anecdotally though, I do feel like it requires less mental effort to structure code that I'm reading.
- Aardwolf 13y agoMy opinion about ASCII: Why is there a back tick ` but no mirrored version of it (the ' is not)? Why is there no degree symbol in it? Why did they make most the first 32 symbols useless codes instead of also symbols? Why did they have to start the whole "newline vs carriage return" thing, why not just a single newline character from the beginning? Why is there no pilcrow, paragraph symbol, dagger and double dagger in it? Why no symbols for not equals, subset, intersection, union, (no) element of, AND, OR in it? Why is it 7-bit and not 8-bit? Who uses 7 bits, honestly. Programming languages would have had some nicer symbols available if some of the above were done...
- jbri 13y agoThe first 32 ASCII code points are literally control codes, which are used to interface with computer hardware that makes use of ASCII - for example teletype machines. To that extent, it's very much worthwhile to have a control code for a carriage return - setting the cursor to the start of the line without advancing to a new one. This lets you, for example, tell an electronic typewriter to double-strike a line for a boldface effect, or strikethrough a line of text. And once you have that, you might as well have the control character that advances the output to the next line not move the cursor at all, since the operator can just send a carriage return if they do want to start at the beginning of the next line instead of where they left off on the previous one. With regards to bitness, computers weren't always strictly power-of-2 based (quick example: the PDP-8 was a 12-bit machine). While today, memory is cheap enough that "rounding up" 30 bits to 32, or 7 bits to 8, is definitely worth it in terms of how it simplifies your other logic, back when ASCII was developed that wasn't really the case.
- VMG 13y ago> Why is there no pilcrow, paragraph symbol, dagger and double dagger in it? > Why no symbols for not equals, subset, intersection, union, (no) element of, AND, OR in it? Which characters would you like to replace? http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters http://en.wikipedia.org/wiki/ASCII#ASCII_printable_character...
- Aardwolf 13y agoWhich to replace? Well, for example NUL, "start of heading", "start of text", "end of text", "end of transmission", and all the other now meaningless ones :) And then there's number 127 too of course. With instead some characters useful for programming languages and basic text (and the problem is Unicode is a bit too big, confusing and redundant for programming languages...)
- nknighthb 13y agoOff the top of my head, you'll be breaking every use of NUL as a delimiter, ctrl-c (end of text), ctrl-d (end of transmission), and backspace. Please don't.
- deleted 13y ago[deleted]
- thristian 13y agoThe article mentions that at one point the ASCII standard moved the alphabetic characters one space to the left, because the author happened to have examined a phone directory while visiting Copenhagen and noted that Denmark sorts its three accented characters at the end of their alphabet. An interesting trivium: the IRC protocol lets users choose their own nicknames, and demands that nicknames be compared in a case-insensitive manner. For the purposes of IRC, you must treat {|} as the 'lower-case' versions of [\], because IRC was invented in Scandinavia and it did indeed use those character-codes for accented characters.
- e12e 13y agoAnd here I suspected you were trolling... (in that case, if you've successfully trolled the RFC - more power to you :) http://tools.ietf.org/html/rfc2812#section-2.2 http://tools.ietf.org/html/rfc2812#section-2.2 " 2.2 Character codes No specific character set is specified. The protocol is based on a set of codes which are composed of eight (8) bits, making up an octet. Each message may be composed of any number of these octets; however, some octet values are used for control codes, which act as message delimiters. Regardless of being an 8-bit protocol, the delimiters and keywords are such that protocol is mostly usable from US-ASCII terminal and a telnet connection. Because of IRC's Scandinavian origin, the characters {}|^ are considered to be the lower case equivalents of the characters []\~, respectively. This is a critical issue when determining the equivalence of two nicknames or channel names."