“Screw it, I'll make my own” – The story of a new programming language
1–10 of 74 posts
Re: “Screw it, I'll make my own” – The story of a new programming language
#2Re: “Screw it, I'll make my own” – The story of a new programming language
#3[deleted]
No need to use the shift key. At the levels of efficiency that a good language can reach, this matters.
Also, dashes match established lexicographical conventions better than underscores because dashes look like hyphens.
Re: “Screw it, I'll make my own” – The story of a new programming language
#4Re: “Screw it, I'll make my own” – The story of a new programming language
#5[deleted]
The underscore was invented to allow people using typewriters to underline text.
I think that the hyphen is more pleasing, aesthetically, but overall I think that it's a poor tradeoff.
Re: “Screw it, I'll make my own” – The story of a new programming language
#6Still, just the journey is quite interesting. It makes you understand other programming languages and their tradeoffs better, and I'm now much less afraid of parsers and lexers and so on. :)
Re: “Screw it, I'll make my own” – The story of a new programming language
#7[deleted]
> I don't understand why people would use a dash "-" inside a symbol No need to use the shift key. At the levels of efficiency that a good language can reach, this matters. Also, dashes match established lexicographical conventions better than underscores because dashes look like hyphens.
Re: “Screw it, I'll make my own” – The story of a new programming language
#8[deleted]
Well camel-case does reduce the length of the identifier without sacrificing clarity. This can help reduce line length, which, in turn, allows more files to be viewed on a single screen in splits, without wrapping or scrolling. I think this solidifies camel-case as the most practical style, if you ignore aesthetics. The underscore was invented to allow people using typewriters to underline text. I think that the hyph…
Re: “Screw it, I'll make my own” – The story of a new programming language
#9[deleted]
Re: “Screw it, I'll make my own” – The story of a new programming language
#10[deleted]
Well camel-case does reduce the length of the identifier without sacrificing clarity. This can help reduce line length, which, in turn, allows more files to be viewed on a single screen in splits, without wrapping or scrolling. I think this solidifies camel-case as the most practical style, if you ignore aesthetics. The underscore was invented to allow people using typewriters to underline text. I think that the hyph…
> IBM's report on NPL (the early name of what is now called PL/I) leaves the character set undefined, but specifically mentions the break character, and gives RATE_OF_PAY as an example identifier
It links to the 1964 report at http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/npl/320... which defines the "_" as the "break" character, on page 22, and on p23 says "[A]n identifier is a string of alphabetic characters, igis, and break characters with the initial character always alphabetic. Any number of break characters are allowed within an identifier; however, consecutive break characters are not permitted. Also, a break character cannot be the final character of an identifier."
(To verify the timing, "_" was not in X3.4 1963 (see http://worldpowersystems.com/archives/codes/X3.4-1963/page6.... ) and that ASCII code point was instead "left arrow".)
You argument regarding "more files to be viewed on a single screen" is valid, but incomplete. It's more a question of total program comprehension rather than a single metric.
This is hard to measure. We can look to related metrics of speed-of-identification and accuracy to see how messy the subject is. The report at http://www.cs.kent.edu/~jmaletic/papers/ICPC2010-CamelCaseUn... says that programmers who are trained in underscore style can recognize underscore style more quickly than camel case, while https://www.researchgate.net/publication/221219628_To_camelc... says that camel case is all around better.
At the very least it suggests that "most practical style" is hard to determine.