|
Posted by Tim Hunt on 12/01/42 11:54
Tony Marston wrote:
> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
> news:6HGzg.6581$gF6.1110@newsread2.news.pas.earthlink.net...
> >
> > "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
> > news:ean53g$rlk$3$8300dec7@news.demon.co.uk...
> >>
> >> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
> >> news:Gslzg.2333$0e5.990@newsread4.news.pas.earthlink.net...
> >>> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
> >>> news:eakmf1$4g8$1$8302bc10@news.demon.co.uk...
> >>>>
> >>>> All you are doing, yet again, is identifying that the use of different
> >>>> case was only introduced as a programmer convention in those languages
> >>>> which make it difficult to differentiate between variables, constants,
> >>>> functions and methods. Decent languages do not have such a problem, yet
> >>>> you insist on making a programmer convention in one particular language
> >>>> a requirement in all other languages for no good reason.
> >>>
> >>> Frankly, I find it a pain in the ass to have to prepend a blankety-blank
> >>> "$" in fron of my variables. Why couldn't this language (PHP) be smart
> >>> enough to know that what is on the left hand side is a variable?
> >>> However, I accepted is a being part of the language and moved on --
> >>> rather than rant about it. If I want a constant, I can write it all in
> >>> caps. (so much for languages that can "differentiate between a
> >>> variable, etc.").
> >>
> >> I prefer the PHP way. I have no problem with using foo, $foo, foo() and
> >
> > You said it all right here - **YOU** prefer it that way, ergo that it the
> > right way! Talk about trying to impose your preferences on the entire
> > community!
> >
> > Frankly, there is no reason why the computer could not know which is which
> > simply by either having a declaration or by its first usage. There is no
> > real need for the dollar sign. My guess is that it was put in for
> > readability and identification. Gee, that is the same reason as case
> > sensitivity.
>
> I disagree. I *MUCH* prefer to see foo, $foo, foo() and $object->foo() to
> differentiate between constants, variables, functions and methods than a
> slight alteration in case. So do the authors of PHP, ad its millions of
> users.
I disagree, the authors of php use many upper and lower case naming
conventions.
http://cvs.php.net/viewvc.cgi/php-src/CODING_STANDARDS?revision=1.32.4.3&view=markup
Here's part of the section titled Naming Conventions. ( They also use
the C convention of naming macros in all uppercase and functions in all
lowercase seperated with'_' )
5] Variable names should be in lowercase. Use underscores to separate
between words.
[6] Method names follow the 'studlyCaps' (also referred to as 'bumpy
case'
or 'camel caps') naming convention, with care taken to minimize the
letter count. The initial letter of the name is lowercase, and each
letter that starts a new 'word' is capitalized.
Good:
'connect()'
'getData()'
'buildSomeWidget()'
Bad:
'get_Data()'
'buildsomewidget'
'getI()'
[7] Classes should be given descriptive names. Avoid using
abbreviations where
possible. Each word in the class name should start with a capital
letter,
without underscore delimiters (CampelCaps starting with a capital
letter).
The class name should be prefixed with the name of the 'parent set'
(e.g.
the name of the extension).
Good:
'Curl'
'FooBar'
Bad:
'foobar'
'foo_bar'
Tim Hunt
Navigation:
[Reply to this message]
|