Re: Class Naming in Core
| From: | Tony Marston | Date: | Thu, 01 Jun 2017 09:16:16 +0000 |
| Subject: | Re: Class Naming in Core | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99307@lists.php.net to get a copy of this message | ||
"Rowan Collins" wrote in message news:CEF783BB-8E1F-4A20-9CC6-1364A122BECC@gmail.com...
On 31 May 2017 10:26:06 BST, Tony Marston <TonyMarston@hotmail.com> wrote:My first job in computing was with a UNIVAC 1108 mainframe in the 1970s. This used a 6-bit character instead of an 8-bit byte, which meant that it could support upper case characters, but not lower case. Where a name was comprised of several words an underscore separator was used, as in "end_of_file".wrote in message news:86dba466-a764-522b-6990-39fd7668a79c@fleshgrinder.com... I should point out that snake_case was the universal standard decades before some people switched to CamelCase.[citation needed]
Lisp, for instance, uses hyphens to separate words, and has don't since the 1950s.Try reading https://en.wikipedia.org/wiki/Naming_convention_(programming)#Length_of_identifiersThat was only because some software could not handle long names, but could handle both upper and lower case, so an upper case character was used instead of an underscore.[citation needed]
I'm sorry, but this smells of folklore and guesswork to me. Both underscores and mixed case are workarounds for the inability to include spaces in identifiers, and have their pros and cons, most of which these days come down to opinions on aesthetics.Some studies have shown that that most people find it easier to read compound names which use the underscore separator. Look at the following: https://en.wikipedia.org/wiki/Camel_case#Readability_studies https://en.wikipedia.org/wiki/Snake_case (first paragraph) This is not guesswork on my part, it is a documented fact. -- Tony Marston