Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old May 13th, 2006, 05:15 PM
howachen@gmail.com
Guest
 
Posts: n/a
Default array() VS Array()

which one is recommend?

seems they perform the same thing...


regards,
howa

  #2  
Old May 13th, 2006, 10:45 PM
Janwillem Borleffs
Guest
 
Posts: n/a
Default Re: array() VS Array()

howachen@gmail.com wrote:[color=blue]
> which one is recommend?
>
> seems they perform the same thing...
>[/color]

The lowercase notation, because the case-insensitive handling of function-
and language construct names might be removed from future PHP versions and
'array' is the preferred notation.


JW


  #3  
Old May 14th, 2006, 04:45 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:4466530b$0$12836$dbd4d001@news.euronet.nl...[color=blue]
> howachen@gmail.com wrote:[color=green]
>> which one is recommend?
>>
>> seems they perform the same thing...
>>[/color]
>
> The lowercase notation, because the case-insensitive handling of function-
> and language construct names might be removed from future PHP versions and
> 'array' is the preferred notation.[/color]

The removal of case-insensitive functions names would be a totally WRONG
move IMHO as it would serve no useful purpose. The argument "to be
consistent with other languages" just does not hold water as it would be
doing nothing but perpetuating a bad idea. If having case-insensitive names
does not cause a problem then it does not need a solution.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org


  #4  
Old May 15th, 2006, 09:15 AM
Kimmo Laine
Guest
 
Posts: n/a
Default Re: array() VS Array()

"Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
news:e47iti$3u2$1$8300dec7@news.demon.co.uk...[color=blue]
>
> "Janwillem Borleffs" <jw@jwscripts.com> wrote in message
> news:4466530b$0$12836$dbd4d001@news.euronet.nl...[color=green]
>> howachen@gmail.com wrote:[color=darkred]
>>> which one is recommend?
>>>
>>> seems they perform the same thing...
>>>[/color]
>>
>> The lowercase notation, because the case-insensitive handling of
>> function- and language construct names might be removed from future PHP
>> versions and 'array' is the preferred notation.[/color]
>
> The removal of case-insensitive functions names would be a totally WRONG
> move IMHO as it would serve no useful purpose. The argument "to be
> consistent with other languages" just does not hold water as it would be
> doing nothing but perpetuating a bad idea. If having case-insensitive
> names does not cause a problem then it does not need a solution.[/color]


Surely we've all heard your opinion and in fact it was discussed a lot some
time ago. Now let it rest. You can write aRRaY() for all I care, but if
someone asks if there is a preference, I see no harm done if one is
recommended. But noooo... You just _had_ to tell once again how much you
hate the case-sensitivity, didn't you? As if it were the end of the world.

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)


  #5  
Old May 15th, 2006, 10:55 AM
Andy Jeffries
Guest
 
Posts: n/a
Default Re: array() VS Array()

On Sun, 14 May 2006 16:38:26 +0100, Tony Marston wrote:[color=blue]
> The removal of case-insensitive functions names would be a totally WRONG
> move IMHO as it would serve no useful purpose. The argument "to be
> consistent with other languages"[/color]

I'd say a better argument would be so it's consistent with itself.
Variable names and member variables are case-sensitive so it's counter
intuitive to a beginner to have the language partially case-sensitive.

Just MHO....

Cheers,


Andy


--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

  #6  
Old May 15th, 2006, 12:05 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
news:pan.2006.05.15.09.54.44.663938@andyjeffries.c o.uk...[color=blue]
> On Sun, 14 May 2006 16:38:26 +0100, Tony Marston wrote:[color=green]
>> The removal of case-insensitive functions names would be a totally WRONG
>> move IMHO as it would serve no useful purpose. The argument "to be
>> consistent with other languages"[/color]
>
> I'd say a better argument would be so it's consistent with itself.
> Variable names and member variables are case-sensitive so it's counter
> intuitive to a beginner to have the language partially case-sensitive.
>
> Just MHO....[/color]

But if a language allows the same name to mean different things if specified
in a different case this could lead to code which is confusing and therefore
difficult to maintain. It *should* be the primary objective of every
language to avoid such features instead of deliberately implementing them.
This is why the GOT verb is frowned upon and excluded from many languages,
and why the ALTER verb in COBOL is considered an absolute no-no.

In the English language a word has only one meaning regardless of case (such
as 'dog', 'Dog' and 'DOG') so why should computer languages be any
different?

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org



  #7  
Old May 15th, 2006, 12:45 PM
Kimmo Laine
Guest
 
Posts: n/a
Default Re: array() VS Array()

"Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
news:e49mta$pvm$1$8300dec7@news.demon.co.uk...[color=blue]
>
> "Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
> news:pan.2006.05.15.09.54.44.663938@andyjeffries.c o.uk...[color=green]
>> On Sun, 14 May 2006 16:38:26 +0100, Tony Marston wrote:[color=darkred]
>>> The removal of case-insensitive functions names would be a totally WRONG
>>> move IMHO as it would serve no useful purpose. The argument "to be
>>> consistent with other languages"[/color]
>>
>> I'd say a better argument would be so it's consistent with itself.
>> Variable names and member variables are case-sensitive so it's counter
>> intuitive to a beginner to have the language partially case-sensitive.
>>
>> Just MHO....[/color]
>
> But if a language allows the same name to mean different things if
> specified in a different case this could lead to code which is confusing
> and therefore difficult to maintain. It *should* be the primary objective
> of every language to avoid such features instead of deliberately
> implementing them. This is why the GOT verb is frowned upon and excluded
> from many languages, and why the ALTER verb in COBOL is considered an
> absolute no-no.
>
> In the English language a word has only one meaning regardless of case
> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be any
> different?
>[/color]


WeLL IF that IS iNdEED the CAse That CapS Don'T MATTER at all in ENgliSH
then why DO You SupPose We HaVE them IN thE FIRST PlacE? If IT dOEsN'T MAKE
AnY DIFfeRence TheN WHY is Writing likE This annoying? I say that they DO
have more than one meaning. Why do we write spoken languagues like English
starting each sentence or name with a capital letter and the rest in small
letters? It's just a set of rules, and when spoken the caps doen't mean
anything.

Why do we have these rules then? To distinct certain differences, to improve
readability of the writing. For instance 'Jack' and 'jack' mean different
things. With a capital J Jack is someone's name, but with a lower case j it
could mean a microphone plug or a jack hammer. Equally in PHP it's common
practise that defined constants are written with CAPITALS and mostly
everything else in lowercase. Likewise it's traditional to write SQL
KEYWORDS in capital and fieldnames in lowercase in an SQL query. There _is_
a difference between small and capitals, you just fail to see it because
you're clinging to the fact that PHP is a spoken language (which it is not).

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)


  #8  
Old May 15th, 2006, 05:15 PM
Guest
 
Posts: n/a
Default Re: array() VS Array()

I must say I agree with parent. A good example would be the subtle
difference between "God" and "god". These do *not* mean the same thing.


"Kimmo Laine" <spam@outolempi.net> wrote in message
news:yMZ9g.4933$aB4.3177@reader1.news.jippii.net.. .[color=blue]
> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
> news:e49mta$pvm$1$8300dec7@news.demon.co.uk...[color=green]
>>
>> "Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
>> news:pan.2006.05.15.09.54.44.663938@andyjeffries.c o.uk...[color=darkred]
>>> On Sun, 14 May 2006 16:38:26 +0100, Tony Marston wrote:
>>>> The removal of case-insensitive functions names would be a totally
>>>> WRONG
>>>> move IMHO as it would serve no useful purpose. The argument "to be
>>>> consistent with other languages"
>>>
>>> I'd say a better argument would be so it's consistent with itself.
>>> Variable names and member variables are case-sensitive so it's counter
>>> intuitive to a beginner to have the language partially case-sensitive.
>>>
>>> Just MHO....[/color]
>>
>> But if a language allows the same name to mean different things if
>> specified in a different case this could lead to code which is confusing
>> and therefore difficult to maintain. It *should* be the primary objective
>> of every language to avoid such features instead of deliberately
>> implementing them. This is why the GOT verb is frowned upon and excluded
>> from many languages, and why the ALTER verb in COBOL is considered an
>> absolute no-no.
>>
>> In the English language a word has only one meaning regardless of case
>> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be any
>> different?
>>[/color]
>
>
> WeLL IF that IS iNdEED the CAse That CapS Don'T MATTER at all in ENgliSH
> then why DO You SupPose We HaVE them IN thE FIRST PlacE? If IT dOEsN'T
> MAKE AnY DIFfeRence TheN WHY is Writing likE This annoying? I say that
> they DO have more than one meaning. Why do we write spoken languagues like
> English starting each sentence or name with a capital letter and the rest
> in small letters? It's just a set of rules, and when spoken the caps
> doen't mean anything.
>
> Why do we have these rules then? To distinct certain differences, to
> improve readability of the writing. For instance 'Jack' and 'jack' mean
> different things. With a capital J Jack is someone's name, but with a
> lower case j it could mean a microphone plug or a jack hammer. Equally in
> PHP it's common practise that defined constants are written with CAPITALS
> and mostly everything else in lowercase. Likewise it's traditional to
> write SQL KEYWORDS in capital and fieldnames in lowercase in an SQL query.
> There _is_ a difference between small and capitals, you just fail to see
> it because you're clinging to the fact that PHP is a spoken language
> (which it is not).
>
> --
> "ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
> spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
>[/color]


  #9  
Old May 15th, 2006, 07:05 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"<user>" <addy@user.euro1net.com> wrote in message
news:e4a9d5$apt$1@news.e7even.com...[color=blue]
>I must say I agree with parent. A good example would be the subtle
>difference between "God" and "god". These do *not* mean the same thing.[/color]

In computer languages you only have variables (nouns) and functions (verbs),
so there is no such differentiation between a word being a noun and a word
being a person's (or deity's) name.

So why should the variables $dog, $Dog and $DOG mean different things?
Why should the functions dosomething(), DoSomething() and DOSOMETHING() mean
different things.

When the keyboard is replaced by a microphone (or, heaven forbid, a thought
reader) how easy (or difficult) will it be to specify the case of each
individual letter?

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
[color=blue]
> "Kimmo Laine" <spam@outolempi.net> wrote in message
> news:yMZ9g.4933$aB4.3177@reader1.news.jippii.net.. .[color=green]
>> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
>> news:e49mta$pvm$1$8300dec7@news.demon.co.uk...[color=darkred]
>>>
>>> "Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
>>> news:pan.2006.05.15.09.54.44.663938@andyjeffries.c o.uk...
>>>> On Sun, 14 May 2006 16:38:26 +0100, Tony Marston wrote:
>>>>> The removal of case-insensitive functions names would be a totally
>>>>> WRONG
>>>>> move IMHO as it would serve no useful purpose. The argument "to be
>>>>> consistent with other languages"
>>>>
>>>> I'd say a better argument would be so it's consistent with itself.
>>>> Variable names and member variables are case-sensitive so it's counter
>>>> intuitive to a beginner to have the language partially case-sensitive.
>>>>
>>>> Just MHO....
>>>
>>> But if a language allows the same name to mean different things if
>>> specified in a different case this could lead to code which is confusing
>>> and therefore difficult to maintain. It *should* be the primary
>>> objective of every language to avoid such features instead of
>>> deliberately implementing them. This is why the GOT verb is frowned upon
>>> and excluded from many languages, and why the ALTER verb in COBOL is
>>> considered an absolute no-no.
>>>
>>> In the English language a word has only one meaning regardless of case
>>> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be any
>>> different?
>>>[/color]
>>
>>
>> WeLL IF that IS iNdEED the CAse That CapS Don'T MATTER at all in ENgliSH
>> then why DO You SupPose We HaVE them IN thE FIRST PlacE? If IT dOEsN'T
>> MAKE AnY DIFfeRence TheN WHY is Writing likE This annoying? I say that
>> they DO have more than one meaning. Why do we write spoken languagues
>> like English starting each sentence or name with a capital letter and the
>> rest in small letters? It's just a set of rules, and when spoken the caps
>> doen't mean anything.
>>
>> Why do we have these rules then? To distinct certain differences, to
>> improve readability of the writing. For instance 'Jack' and 'jack' mean
>> different things. With a capital J Jack is someone's name, but with a
>> lower case j it could mean a microphone plug or a jack hammer. Equally in
>> PHP it's common practise that defined constants are written with CAPITALS
>> and mostly everything else in lowercase. Likewise it's traditional to
>> write SQL KEYWORDS in capital and fieldnames in lowercase in an SQL
>> query. There _is_ a difference between small and capitals, you just fail
>> to see it because you're clinging to the fact that PHP is a spoken
>> language (which it is not).
>>
>> --
>> "ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
>> spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
>>[/color]
>
>[/color]


  #10  
Old May 15th, 2006, 07:35 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Kimmo Laine" <spam@outolempi.net> wrote in message
news:yMZ9g.4933$aB4.3177@reader1.news.jippii.net.. .[color=blue]
> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
> news:e49mta$pvm$1$8300dec7@news.demon.co.uk...[color=green]
>>
>> "Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
>> news:pan.2006.05.15.09.54.44.663938@andyjeffries.c o.uk...[color=darkred]
>>> On Sun, 14 May 2006 16:38:26 +0100, Tony Marston wrote:
>>>> The removal of case-insensitive functions names would be a totally
>>>> WRONG
>>>> move IMHO as it would serve no useful purpose. The argument "to be
>>>> consistent with other languages"
>>>
>>> I'd say a better argument would be so it's consistent with itself.
>>> Variable names and member variables are case-sensitive so it's counter
>>> intuitive to a beginner to have the language partially case-sensitive.
>>>
>>> Just MHO....[/color]
>>
>> But if a language allows the same name to mean different things if
>> specified in a different case this could lead to code which is confusing
>> and therefore difficult to maintain. It *should* be the primary objective
>> of every language to avoid such features instead of deliberately
>> implementing them. This is why the GOT verb is frowned upon and excluded
>> from many languages, and why the ALTER verb in COBOL is considered an
>> absolute no-no.
>>
>> In the English language a word has only one meaning regardless of case
>> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be any
>> different?
>>[/color]
>
>
> WeLL IF that IS iNdEED the CAse That CapS Don'T MATTER at all in ENgliSH
> then why DO You SupPose We HaVE them IN thE FIRST PlacE? If IT dOEsN'T
> MAKE AnY DIFfeRence TheN WHY is Writing likE This annoying?[/color]

While I agree that deliberately mixing case like is very annoying to a human
reader, I still stand by my assertion that for nouns and verbs (which can be
equated to variables and functions within a computer langage) that a change
in case does NOT change the meaning of a word..
[color=blue]
> I say that they DO have more than one meaning. Why do we write spoken
> languagues like English starting each sentence or name with a capital
> letter and the rest in small letters? It's just a set of rules, and when
> spoken the caps doen't mean anything.[/color]

Human conventions in the construction of sentences are irrelevant to this
topic. Do you start each line of code with a capital letter?
[color=blue]
> Why do we have these rules then? To distinct certain differences, to
> improve readability of the writing. For instance 'Jack' and 'jack' mean
> different things. With a capital J Jack is someone's name, but with a
> lower case j it could mean a microphone plug or a jack hammer[/color]

That is irrelevant as computer languages do not differentiate between words
which are nouns and words which are names. There are simply nouns
(variables) and verbs (functions).
[color=blue]
>.Equally in PHP it's common practise that defined constants are written
>with CAPITALS and mostly everything else in lowercase.[/color]

Unfortunately different groups of people using different languages may
invent totally different "standards" as to what should be upper case and
what should be lower case. But why on earth should one persons preferences
be enforced on everyone else. All computer languages were originally
insensitive to case, so what arrogant moron decided to make the switch? What
was his justiification?
[color=blue]
> Likewise it's traditional to write SQL KEYWORDS in capital and fieldnames
> in lowercase in an SQL query.[/color]

You would have loved the people at my previous contract. Their stanards were
totally the opposite - all keywords in lower case and all database, table,
field and user-defined function names in upper case. Why? Just because,
that's why. What a stupid argument, especially when the underlying language
didn't care.
[color=blue]
> There _is_ a difference between small and capitals, you just fail to see
> it because you're clinging to the fact that PHP is a spoken language
> (which it is not).[/color]

No. My point is that I have worked for over 20 years using computer
languages which were totally insensitive to case (assembler, COBOL, quiz,
quick, qtp, SPL, Rapid, Transact, Insight, Uniface, SQL) and I cannot see
any problem which is solved by making any language sensitive to case. Just
the opposite, in fact, I can only see the introducion of new problems.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


  #11  
Old May 15th, 2006, 07:45 PM
Ryan Lange
Guest
 
Posts: n/a
Default Re: array() VS Array()

Tony Marston wrote:[color=blue]
> In the English language a word has only one meaning regardless of case (such
> as 'dog', 'Dog' and 'DOG') so why should computer languages be any
> different?[/color]

That's pretty wrong, actually. The word "dog" is a noun that refers
to canines. The word "Dog" would be a proper noun; the name of a person
or place. The word "DOG" would be an acronym.

Personally, when I see "htmlEntities()" my brain tells me that's
different from "htmlentities()", and it wouldn't be wrong, strictly
speaking.

In the end it's really just personal opinion. Yours is just one of
many, and I happen to disagree with it.


Ryan
  #12  
Old May 15th, 2006, 07:55 PM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: array() VS Array()

Tony Marston wrote:[color=blue]
>
> No. My point is that I have worked for over 20 years using computer
> languages which were totally insensitive to case (assembler, COBOL, quiz,
> quick, qtp, SPL, Rapid, Transact, Insight, Uniface, SQL) and I cannot see
> any problem which is solved by making any language sensitive to case. Just
> the opposite, in fact, I can only see the introducion of new problems.
>[/color]

Not this argument again. Give it up, Tony. You aren't going to change the world.

For the record - I have almost twice as many years of programming as you do,
starting with Fortran in the mid-60's. My first case sensitive language was C
in the mid 1980's - probably about the time you started programming. Over the
years I've written code in over a dozen different languages, including PL/I,
Assembler (both mainframe and PC), REXX, PASCAL, BASIC, C++ and Java.

I've seen definite advantages to case sensitivity, and have grown to like it.
For instance, I can declare a class Customer. I can then have variable names
like customer, customer1, customer2, etc. - or even an array customer[].

I find it not at all confusing. Class names start with caps. Variable names do
not. Simple and easy. And a programmer can quickly relate the variable to the
class using it.

And, as others have pointed out, use all caps anything defined as a CONSTANT.
That way you know it's a constant.

And that's the way PHP is, whether you like it or not. And if you hate it so
much, go back to COBOL or another case-insensitive language.

But don't keep bringing this topic up. It only shows how stubborn you are.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  #13  
Old May 15th, 2006, 08:15 PM
John Dunlop
Guest
 
Posts: n/a
Default Re: array() VS Array()

Tony Marston:
[color=blue]
> When the keyboard is replaced by a microphone (or, heaven forbid, a thought
> reader) how easy (or difficult) will it be to specify the case of each
> individual letter?[/color]

Apparently NASA have developed a system which intercepts nerve
signals sent from the brain to your "speech organs" when you read to
yourself. They call it 'subvocal speech'.

'Cool'? You took the words right outta my mouth!

http://www.nasa.gov/home/hqnews/2004...al_speech.html

--
Jock

  #14  
Old May 15th, 2006, 10:05 PM
Andy Jeffries
Guest
 
Posts: n/a
Default Re: array() VS Array()

On Mon, 15 May 2006 11:58:50 +0100, Tony Marston wrote:[color=blue]
> But if a language allows the same name to mean different things if
> specified in a different case this could lead to code which is confusing
> and therefore difficult to maintain. It *should* be the primary objective
> of every language to avoid such features instead of deliberately
> implementing them. This is why the GOT verb is frowned upon and excluded
> from many languages, and why the ALTER verb in COBOL is considered an
> absolute no-no.
>
> In the English language a word has only one meaning regardless of case
> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be any
> different?[/color]

Ryan's perfectly valid point aside (different capitalisation of Dog
meaning different things), I actually don't disagree with you entirely.
At least not enough to argue about.

However, I do feel any language ought to be consistent, if the variables
are case-sensitive the functions should be too. It makes the language a
lot more predictable in how it will behave.

Cheers,


Andy

--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

  #15  
Old May 15th, 2006, 11:15 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:AaCdncQOhcGeUPXZRVn-iw@comcast.com...[color=blue]
> Tony Marston wrote:[color=green]
>>
>> No. My point is that I have worked for over 20 years using computer
>> languages which were totally insensitive to case (assembler, COBOL, quiz,
>> quick, qtp, SPL, Rapid, Transact, Insight, Uniface, SQL) and I cannot see
>> any problem which is solved by making any language sensitive to case.
>> Just the opposite, in fact, I can only see the introducion of new
>> problems.
>>[/color]
>
> Not this argument again. Give it up, Tony. You aren't going to change
> the world.[/color]

I'm not arguing to change all languages back to case-insensitivty, but I am
arguiing that it should not be introduced just because someone thinks it is
"the standard".
[color=blue]
> For the record - I have almost twice as many years of programming as you
> do, starting with Fortran in the mid-60's. My first case sensitive
> language was C in the mid 1980's - probably about the time you started
> programming.[/color]

No, I started in the 70's.
[color=blue]
> Over the years I've written code in over a dozen different languages,
> including PL/I, Assembler (both mainframe and PC), REXX, PASCAL, BASIC,
> C++ and Java.
>
> I've seen definite advantages to case sensitivity, and have grown to like
> it.[/color]

I've seen no advantages, only problems, so I hate it.
[color=blue]
> For instance, I can declare a class Customer. I can then have variable
> names like customer, customer1, customer2, etc. - or even an array
> customer[].
>
> I find it not at all confusing. Class names start with caps. Variable
> names do not. Simple and easy. And a programmer can quickly relate the
> variable to the class using it.[/color]

That is just a convention among programmers, not a requirement of the
language. It is irrelevant in PHP as all variables start with a '$' and all
functions end in '()' which makes it easy to spot the difference between
$customer (variable) and customer() (function). What I object to is a
language that delierately allows you to create variables such as $customer,
$Customer and $CUSTOMER which have the same name but mean different things.
The name is important and the case should be irrelevant.
[color=blue]
> And, as others have pointed out, use all caps anything defined as a
> CONSTANT. That way you know it's a constant.[/color]

In PHP it is not a requirement that a constant be defined in upper case. It
is easy to tell the difference between a constant and a variable as one has
a leading '$' while the other does not. Which of these two is the constant -
FOO or $FOO?
[color=blue]
> And that's the way PHP is, whether you like it or not. And if you hate it
> so much, go back to COBOL or another case-insensitive language.
>
> But don't keep bringing this topic up. It only shows how stubborn you
> are.[/color]

All the while people like you keep harping on about how "politically
correct" it is to introduce even more unnecessary case-sensitivity into
computer languages I will keep responding with an alternative view. Case
sensitivity does not solve any problems, therefore it is an unwanted
solution.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org



  #16  
Old May 15th, 2006, 11:25 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
news:pan.2006.05.15.21.05.13.959574@andyjeffries.c o.uk...[color=blue]
> On Mon, 15 May 2006 11:58:50 +0100, Tony Marston wrote:[color=green]
>> But if a language allows the same name to mean different things if
>> specified in a different case this could lead to code which is confusing
>> and therefore difficult to maintain. It *should* be the primary objective
>> of every language to avoid such features instead of deliberately
>> implementing them. This is why the GOT verb is frowned upon and excluded
>> from many languages, and why the ALTER verb in COBOL is considered an
>> absolute no-no.
>>
>> In the English language a word has only one meaning regardless of case
>> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be any
>> different?[/color]
>
> Ryan's perfectly valid point aside (different capitalisation of Dog
> meaning different things), I actually don't disagree with you entirely.
> At least not enough to argue about.[/color]

Rubbish. The letters 'd', 'o' and 'g' spell 'dog' and mean the same thing
regardless of case. take the following three sentences:-
1) beware of the dog
2) Beware Of The Dog
3) BEWARE OF THE DOG.

Do these sentences mean the same thing or not? Does the meaning change just
because the case changes?
[color=blue]
> However, I do feel any language ought to be consistent, if the variables
> are case-sensitive the functions should be too. It makes the language a
> lot more predictable in how it will behave.[/color]

I'm afraid that the argument that all computer languages should enforce
case-sensitivity "just to be consistent" is really pathetic. A feature
should not be introduced unless it has genuine benefits, and as the
introduction of case-sensitivity does not solve a problem it is an unwanted
solution.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org



  #17  
Old May 16th, 2006, 02:05 AM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: array() VS Array()

Tony Marston wrote:[color=blue]
> All the while people like you keep harping on about how "politically
> correct" it is to introduce even more unnecessary case-sensitivity into
> computer languages I will keep responding with an alternative view. Case
> sensitivity does not solve any problems, therefore it is an unwanted
> solution.
>[/color]

I never said anything about "politically correct". I pointed out some real
advantages to having case sensitivity - advantages used by millions of
programmers world-wide.

And here's tony, still a stubborn mule and clinging to th dark ages, refusing to
see advantages because he doesn't want to.

You really are an ass.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
  #18  
Old May 16th, 2006, 08:25 AM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Gary L. Burnore" <gburnore@databasix.com> wrote in message
news:e4avo2$qj2$1@blackhelicopter.databasix.com...[color=blue]
> On Mon, 15 May 2006 23:20:58 +0100, "Tony Marston"
> <tony@NOSPAM.demon.co.uk> wrote:
>[color=green]
>>
>>"Andy Jeffries" <news@andyjeffries.co.uk> wrote in message
>>news:pan.2006.05.15.21.05.13.959574@andyjeffries .co.uk...[color=darkred]
>>> On Mon, 15 May 2006 11:58:50 +0100, Tony Marston wrote:
>>>> But if a language allows the same name to mean different things if
>>>> specified in a different case this could lead to code which is
>>>> confusing
>>>> and therefore difficult to maintain. It *should* be the primary
>>>> objective
>>>> of every language to avoid such features instead of deliberately
>>>> implementing them. This is why the GOT verb is frowned upon and
>>>> excluded
>>>> from many languages, and why the ALTER verb in COBOL is considered an
>>>> absolute no-no.
>>>>
>>>> In the English language a word has only one meaning regardless of case
>>>> (such as 'dog', 'Dog' and 'DOG') so why should computer languages be
>>>> any
>>>> different?
>>>
>>> Ryan's perfectly valid point aside (different capitalisation of Dog
>>> meaning different things), I actually don't disagree with you entirely.
>>> At least not enough to argue about.[/color]
>>
>>Rubbish. The letters 'd', 'o' and 'g' spell 'dog' and mean the same thing
>>regardless of case. take the following three sentences:-
>>1) beware of the dog
>>2) Beware Of The Dog
>>3) BEWARE OF THE DOG.[/color]
>
> The word god and God have different meanings to some. Does that help?[/color]

The fact that some people choose to apply different meanings is irrelevant.
I am talking about variable and function names in computer languages. Nobody
in their right minds would deliberately create three different variables
such as $foo, $Foo and $FOO as it could create confusion and lead to a
maintenance nightmare. If that isthe case then why should the language allow
that sitatio to be created in the first place?
[color=blue][color=green]
>>Do these sentences mean the same thing or not? Does the meaning change
>>just
>>because the case changes?
>>[color=darkred]
>>> However, I do feel any language ought to be consistent, if the variables
>>> are case-sensitive the functions should be too. It makes the language a
>>> lot more predictable in how it will behave.[/color]
>>
>>I'm afraid that the argument that all computer languages should enforce
>>case-sensitivity "just to be consistent" is really pathetic.[/color]
>
> Of course it is.[/color]

You agree with me? Well, I'll go to the foot of our stairs!

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


  #19  
Old May 16th, 2006, 08:55 AM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:Zeydne3Lr_1NvvTZ4p2dnA@comcast.com...[color=blue]
> Tony Marston wrote:[color=green]
>> All the while people like you keep harping on about how "politically
>> correct" it is to introduce even more unnecessary case-sensitivity into
>> computer languages I will keep responding with an alternative view. Case
>> sensitivity does not solve any problems, therefore it is an unwanted
>> solution.
>>[/color]
>
> I never said anything about "politically correct". I pointed out some
> real advantages to having case sensitivity - advantages used by millions
> of programmers world-wide.[/color]

What you are saying is that just because YOU use case-sensitivity in a
particular way in want the rest of the world to do exactly the same, and not
only that you want the language changed in such a way that other choices are
impossible.
[color=blue]
> And here's tony, still a stubborn mule and clinging to th dark ages,
> refusing to see advantages because he doesn't want to.
>
> You really are an ass.[/color]

That's just your opinion. My opinion is that being able to create variables
such as $foo, $Foo and $FOO which actually mean DIFFERENT things is a bad
idea as it be confusing and lead to a maintenance nightmare. If that is the
case then the language should not allow it. It is the prospect of
maintenance nightmares, of allowing programmers to "shoot themselves in the
foot", which caused the GOTO verb never to be implemented in PHP and its
proposed introduction by those who think it is "clever" to be resisted.

Case-sensitivity never solved any problem, so why is it a solution?

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org



  #20  
Old May 16th, 2006, 09:05 AM
Andy Jeffries
Guest
 
Posts: n/a
Default Re: array() VS Array()

On Mon, 15 May 2006 23:20:58 +0100, Tony Marston wrote:[color=blue][color=green]
>> However, I do feel any language ought to be consistent, if the variables
>> are case-sensitive the functions should be too. It makes the language a
>> lot more predictable in how it will behave.[/color]
>
> I'm afraid that the argument that all computer languages should enforce
> case-sensitivity "just to be consistent" is really pathetic. A feature
> should not be introduced unless it has genuine benefits, and as the
> introduction of case-sensitivity does not solve a problem it is an
> unwanted solution.[/color]

I didn't say *all* computer languages, don't put words in my mouth.
Either that or your misread my intention.

If a language is case-sensitive for variable names and class members it
should also be consistent in that it's case-sensitive for functions and
class methods.

I'm not saying all languages should be case-sensitive, just that if one is
partially case-sensitive it should be consistently case-sensitive within
itself.

To be honest, I couldn't give a crap if Cobol, Haskell or C#/.Net is
case-sensitive, I'm a PHP programmer (at the moment) and would like my
number 1 language to be consistent.

Cheers,


Andy


--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

  #21  
Old May 16th, 2006, 09:15 AM
Andy Jeffries
Guest
 
Posts: n/a
Default Re: array() VS Array()

On Mon, 15 May 2006 23:14:22 +0100, Tony Marston wrote:[color=blue][color=green]
>> And, as others have pointed out, use all caps anything defined as a
>> CONSTANT. That way you know it's a constant.[/color]
>
> In PHP it is not a requirement that a constant be defined in upper case.
> It is easy to tell the difference between a constant and a variable as one
> has a leading '$' while the other does not. Which of these two is the
> constant - FOO or $FOO?[/color]

FOO could be either a constant or a reference to a function. This is
where consistent capitalisation helps clarify:

<?php
function FOO()
{
print "bar";
}

$foo = FOO;

$foo();

?>

Cheers,



Andy


--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos

  #22  
Old May 16th, 2006, 09:25 AM
Richard Levasseur
Guest
 
Posts: n/a
Default Re: array() VS Array()

RE: Variable case
Traditionally,
FOO is read as a global literal constant, you cannot change this and is
available everywhere and is intended to be used both inside and outside
the project.
$FOO, $foo, $Foo can be read in wildly different ways. By and large i
see:

$FOO as a global variable for a specific application. Usually because
you can't pre-initialize it in the class or without doing something
before hand, and typically you don't change these, they're a
honor-system read only.
$foo is a local variable, something that only exists within the current
scope and goes away later.
$Foo i rarely see, though usually it means its important for some
reason, such as some sort of glue between a function and something
outside the function, or a reference to something within another
something-something. The point is it doesn't quite adhere to the
locality of $foo but isn't as off limits and viewable as $FOO; I like
to think of it as akin to 'protected' in OOP terminology. Occasionally
I see important public methods starting with a capital and using camel
notation, such as functions that should be called during shutdown or
startup prior to any other calls.

(Aside, this is one reason i like how perl differentiates uses with $,
#, and @, it gives me a better understanding of what context it should
be used and read in)

So, yes, traditionally, case does have an impact on the implied meaning
of what a variable does, where it is used, and so forth. You can have
case insensitivity when there are language constructs that strictly
limit how a variable is used. 'local refererence constant $foo;
global copy variable $FOO; bridging constant local $Foo' etc etc

Re: Function case
1) It would be nice to have consistancy throughout the language.
Previously, classes were stored in all lowercase, and later this was
changed to match the declared case. (Thank god!)
2) You know what to expect when you are looking for a function or
declared identifier. I declare it as 'myFunc', and its stored as
'myfunc,' but i naturally expect it to match the way I wrote it. Now I
have to write case insensitivity into determining if its the function i
want, and to verify that whatever information i'm storing is, indeed
correct? Rubbish i say.
If i call it myfunc, MYFUNC, or MyFuCn, i expect to be able to refer to
it only as how i defined it. Making it 'fuzzy' sounds sloppy and
doesn't, in my opinion, promote good coding habits. I'd much rather
have an error handler catch a programming mistake than the computer
assume it knew what i meant.
3) If i call it MYFUNC, i'm capitalizing it for a reason. Calling it
as myfunc() is not what i am expecting to look for in code if i go
reading it over and downplays the importants that this function must
server. hack_together_sql() has a different authority to it than
Hack_Together_SQL(). The former tends to imply that its a hack and
shouldn't be relied on, the latter that it is some complicated
necessity to be used with caution, and the importance of both of those
meanings should always be present in the writing of them.

Re: maintainance nightmare
You've not seen some of the 'professional' PHP code out there you can
buy? Half of them don't even spell variable names right, let alone
adhere to any sort of standard or continuity. I'd much rather pick up
any code and understand the intent of it instead of being able to skip
pressing the shift key.

Of course, thats just how I see things.

  #23  
Old May 18th, 2006, 09:05 AM
Tony Marston
Guest
 
Posts: n/a
Default Re: array() VS Array()


"Richard Levasseur" <richardlev@gmail.com> wrote in message
news:1147767617.862820.105770@j33g2000cwa.googlegr oups.com...[color=blue]
> RE: Variable case
> Traditionally,
> FOO is read as a global literal constant, you cannot change this and is
> available everywhere and is intended to be used both inside and outside
> the project.
> $FOO, $foo, $Foo can be read in wildly different ways. By and large i
> see:
>
> $FOO as a global variable for a specific application.[/color]

Not in any language I have used, it isn't. In PHP $FOO is a local variable.
$GLOBALS['FOO'] is a global variable. In my previous language a loal
variable was defined using $name$ while a global variable used $$name. Th
case was irrelevant, it was where the $ signswere placed that
wassignificant.
[color=blue]
> Usually because
> you can't pre-initialize it in the class or without doing something
> before hand, and typically you don't change these, they're a
> honor-system read only.
> $foo is a local variable, something that only exists within the current
> scope and goes away later.
> $Foo i rarely see, though usually it means its important for some
> reason, such as some sort of glue between a function and something
> outside the function, or a reference to something within another
> something-something.[/color]

There is no such meaing in any language that I have used. It is just a
variable.
[color=blue]
> The point is it doesn't quite adhere to the
> locality of $foo but isn't as off limits and viewable as $FOO; I like
> to think of it as akin to 'protected' in OOP terminology. Occasionally
> I see important public methods starting with a capital and using camel
> notation, such as functions that should be called during shutdown or
> startup prior to any other calls.[/color]

That is not a standard of the language, it is merely a convention adopted by
some programmers.
[color=blue]
> (Aside, this is one reason i like how perl differentiates uses with $,
> #, and @, it gives me a better understanding of what context it should
> be used and read in)
>
> So, yes, traditionally, case does have an impact on the implied meaning
> of what a variable does, where it is used, and so forth.[/color]

I dispute your use of the word "traditionally". The "original" programing
languages (i'm talking Assember, COBOL, Fortran) gave absolutely no
significance to case at all, and neither did any other language I have used
right up to the 21st century. So "traditionally" in computer languages case
has been totally insignificant, it is only in a few modern languages that it
has been introduced. That was a bad move, IMHO.
[color=blue]
> You can have
> case insensitivity when there are language constructs that strictly
> limit how a variable is used. 'local refererence constant $foo;
> global copy variable $FOO; bridging constant local $Foo' etc etc[/color]

That terminology does not exist in PHP, so your arguments do not apply.
[color=blue]
> Re: Function case
> 1) It would be nice to have consistancy throughout the language.[/color]

Perpetuating a bad idea just to be "consistent" does not sound very clever
to me.
[color=blue]
> Previously, classes were stored in all lowercase, and later this was
> changed to match the declared case. (Thank god!)
> 2) You know what to expect when you are looking for a function or
> declared identifier.[/color]

What would your reaction be if you looked through the manual for a function
only tofid that it existed several times, each with a different combination
of case, and each with a different meaning? Wold this be a good idea or not?
If not, then why sould the language allow it?
[color=blue]
> I declare it as 'myFunc', and its stored as
> 'myfunc,' but i naturally expect it to match the way I wrote it.[/color]

But if case is insignifiant it does not mean that you have to reference it
in exactly the same case as it was defined. Spelling is significant case
should not be.
[color=blue]
> Now I
> have to write case insensitivity into determining if its the function i
> want, and to verify that whatever information i'm storing is, indeed
> correct? Rubbish i say.
> If i call it myfunc, MYFUNC, or MyFuCn, i expect to be able to refer to
> it only as how i defined it.[/color]

Why? In all the languages I have used in the past I could use any case I
wanted to reference that function or variable. Case is insignificant, only
the spelling is important.
[color=blue]
> Making it 'fuzzy' sounds sloppy and
> doesn't, in my opinion, promote good coding habits.[/color]

Fuzzy spelling would be bad, but in my experience fuzzy case does not make a
blind bit of difference.
[color=blue]
> I'd much rather
> have an error handler catch a programming mistake than the computer
> assume it knew what i meant.
> 3) If i call it MYFUNC, i'm capitalizing it for a reason.[/color]

That is a personal preference, not a feature of the language. Other people
have their own personal preferences.
[color=blue]
> Calling it
> as myfunc() is not what i am expecting to look for in code if i go
> reading it over and downplays the importants that this function must
> server. hack_together_sql() has a different authority to it than
> Hack_Together_SQL().[/color]

Are you saying that you would deliberately create two different functions
called hack_together_sql() and Hack_Together_SQL()? If you did that on any f
my projects I would fire you on the spot.
[color=blue]
> The former tends to imply that its a hack and
> shouldn't be relied on, the latter that it is some complicated
> necessity to be used with caution, and the importance of both of those
> meanings should always be present in the writing of them.[/color]

That "imortance" only exists in your mind. It has no significance whatsoever
to the computer language.
[color=blue]
> Re: maintainance nightmare
> You've not seen some of the 'professional' PHP code out there you can
> buy?[/color]

I have been programming for over 20 years and I've seen a enormous amount of
crap code. I have also seen an enormous amount of crap standards which
forces programmers to write crap code.
[color=blue]
> Half of them don't even spell variable names right, let alone
> adhere to any sort of standard or continuity.[/color]

If a variable is mis-spelled then it will cause an error that should be
picked up in testing. The trouble with standards is that there is no
standard. Each group has its own standards, and they are all different.
[color=blue]
> I'd much rather pick up
> any code and understand the intent of it instead of being able to skip
> pressing the shift key.[/color]

In a case-insensitive language the shift key becomes irrelevant.
[color=blue]
> Of course, thats just how I see things.[/color]

Your view on this issue is not the same as my view, yet to want to change
the world to conform to your view. I am simply speaking against those
changes.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.