array() VS Array()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • howachen@gmail.com

    array() VS Array()

    which one is recommend?

    seems they perform the same thing...


    regards,
    howa

  • Janwillem Borleffs

    #2
    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


    Comment

    • Tony Marston

      #3
      Re: array() VS Array()


      "Janwillem Borleffs" <jw@jwscripts.c om> wrote in message
      news:4466530b$0 $12836$dbd4d001 @news.euronet.n l...[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

      This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

      Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.



      Comment

      • Kimmo Laine

        #4
        Re: array() VS Array()

        "Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message
        news:e47iti$3u2 $1$8300dec7@new s.demon.co.uk.. .[color=blue]
        >
        > "Janwillem Borleffs" <jw@jwscripts.c om> wrote in message
        > news:4466530b$0 $12836$dbd4d001 @news.euronet.n l...[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@bhg byrzcv.arg)


        Comment

        • Andy Jeffries

          #5
          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

          Comment

          • Tony Marston

            #6
            Re: array() VS Array()


            "Andy Jeffries" <news@andyjeffr ies.co.uk> wrote in message
            news:pan.2006.0 5.15.09.54.44.6 63938@andyjeffr ies.co.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

            This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

            Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.




            Comment

            • Kimmo Laine

              #7
              Re: array() VS Array()

              "Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message
              news:e49mta$pvm $1$8300dec7@new s.demon.co.uk.. .[color=blue]
              >
              > "Andy Jeffries" <news@andyjeffr ies.co.uk> wrote in message
              > news:pan.2006.0 5.15.09.54.44.6 63938@andyjeffr ies.co.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@bhg byrzcv.arg)


              Comment

              • Guest's Avatar

                #8
                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@reade r1.news.jippii. net...[color=blue]
                > "Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message
                > news:e49mta$pvm $1$8300dec7@new s.demon.co.uk.. .[color=green]
                >>
                >> "Andy Jeffries" <news@andyjeffr ies.co.uk> wrote in message
                >> news:pan.2006.0 5.15.09.54.44.6 63938@andyjeffr ies.co.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@bhg byrzcv.arg)
                >[/color]


                Comment

                • Tony Marston

                  #9
                  Re: array() VS Array()


                  "<user>" <addy@user.euro 1net.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
                  This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

                  Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.

                  [color=blue]
                  > "Kimmo Laine" <spam@outolempi .net> wrote in message
                  > news:yMZ9g.4933 $aB4.3177@reade r1.news.jippii. net...[color=green]
                  >> "Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message
                  >> news:e49mta$pvm $1$8300dec7@new s.demon.co.uk.. .[color=darkred]
                  >>>
                  >>> "Andy Jeffries" <news@andyjeffr ies.co.uk> wrote in message
                  >>> news:pan.2006.0 5.15.09.54.44.6 63938@andyjeffr ies.co.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@bhg byrzcv.arg)
                  >>[/color]
                  >
                  >[/color]


                  Comment

                  • Tony Marston

                    #10
                    Re: array() VS Array()


                    "Kimmo Laine" <spam@outolempi .net> wrote in message
                    news:yMZ9g.4933 $aB4.3177@reade r1.news.jippii. net...[color=blue]
                    > "Tony Marston" <tony@NOSPAM.de mon.co.uk> wrote in message
                    > news:e49mta$pvm $1$8300dec7@new s.demon.co.uk.. .[color=green]
                    >>
                    >> "Andy Jeffries" <news@andyjeffr ies.co.uk> wrote in message
                    >> news:pan.2006.0 5.15.09.54.44.6 63938@andyjeffr ies.co.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
                    This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

                    Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.



                    Comment

                    • Ryan Lange

                      #11
                      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

                      Comment

                      • Jerry Stuckle

                        #12
                        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@attgl obal.net
                        =============== ===

                        Comment

                        • John Dunlop

                          #13
                          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!



                          --
                          Jock

                          Comment

                          • Andy Jeffries

                            #14
                            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

                            Comment

                            • Tony Marston

                              #15
                              Re: array() VS Array()


                              "Jerry Stuckle" <jstucklex@attg lobal.net> wrote in message
                              news:AaCdncQOhc GeUPXZRVn-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 "politicall y
                              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

                              This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

                              Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.




                              Comment

                              Working...