PHP4 to PHP5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff

    PHP4 to PHP5

    I'm working on a server that is running PHP4.

    I'd like to upgrade this so I can use the PHP5 code I have already.

    What kind, if any, problems will I have with the existing PHP code base?

    I see:

    Local Master

    magic_quotes_gp c On On
    magic_quotes_ru ntime Off Off

    I'm not sure what that means. I think that means that anything coming in
    on $_REQUEST is backslashed and I'm thinking that probably won't play
    well with PDO. If I turn that off what kind of failure could I see in
    the existing code? Is that only a problem in that single quotes will be
    backslashed in the data? Or can I have runtime crashes?

    Jeff
  • Twayne

    #2
    Re: PHP4 to PHP5

    I'm working on a server that is running PHP4.
    >
    I'd like to upgrade this so I can use the PHP5 code I have already.
    >
    What kind, if any, problems will I have with the existing PHP code
    base?
    I see:
    >
    Local Master
    >
    magic_quotes_gp c On On
    magic_quotes_ru ntime Off Off
    >
    I'm not sure what that means. I think that means that anything coming
    in on $_REQUEST is backslashed and I'm thinking that probably won't
    play well with PDO. If I turn that off what kind of failure could I
    see in the existing code? Is that only a problem in that single
    quotes will be backslashed in the data? Or can I have runtime crashes?
    >
    Jeff
    We probably don't have similar code, but I made the switch and had zero
    problems of any kind. The only problem I ran into was I discovered
    filter_var in 5.2.5 and then discovered my ISP is only at 5.2.2, which
    doesn't support it. So at least from my viewpoint, I'd say just make
    sure you're at the same level your server provides. I just made the
    switch on the server and ran a phpinfo() to get the full rev, then ran
    one on my own system and compared the two. Past 5.2.2 there were some
    pretty useful additions but I don't know them all by heart.

    HTH

    Twayne


    Comment

    • Jerry Stuckle

      #3
      Re: PHP4 to PHP5

      Jeff wrote:
      I'm working on a server that is running PHP4.
      >
      I'd like to upgrade this so I can use the PHP5 code I have already.
      >
      What kind, if any, problems will I have with the existing PHP code base?
      >
      I see:
      >
      Local Master
      >
      magic_quotes_gp c On On
      magic_quotes_ru ntime Off Off
      >
      I'm not sure what that means. I think that means that anything coming in
      on $_REQUEST is backslashed and I'm thinking that probably won't play
      well with PDO. If I turn that off what kind of failure could I see in
      the existing code? Is that only a problem in that single quotes will be
      backslashed in the data? Or can I have runtime crashes?
      >
      Jeff
      >
      The change from php4 to php5 probably won't be too painful. Virtually
      everything I've written for php4 runs fine on php5.

      The magic_quotes_gp c may be another problem, however. You should have
      it off (it will be removed in php6 because it never really worked). If
      you've been depending on it being on, you'll have some code to change.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Chuck Anderson

        #4
        Re: PHP4 to PHP5

        Jeff wrote:
        I'm working on a server that is running PHP4.
        >
        I'd like to upgrade this so I can use the PHP5 code I have already.
        >
        What kind, if any, problems will I have with the existing PHP code base?
        >
        I see:
        >
        Local Master
        >
        magic_quotes_gp c On On
        magic_quotes_ru ntime Off Off
        >
        I'm not sure what that means. I think that means that anything coming in
        on $_REQUEST is backslashed and I'm thinking that probably won't play
        well with PDO. If I turn that off what kind of failure could I see in
        the existing code? Is that only a problem in that single quotes will be
        backslashed in the data? Or can I have runtime crashes?
        >
        Jeff
        >
        >

        Just yesterday I ran into a problem with an old script I hadn't used in
        a very long while. It accessed uploaded files via $HTTP_POST_FILE S,
        which was still around in Php 4, but is gone in Php 5 (use $_FILES).

        --
        *************** **************
        Chuck Anderson • Boulder, CO

        Nothing he's got he really needs
        Twenty first century schizoid man.
        *************** *************** *****

        Comment

        • Jerry Stuckle

          #5
          Re: PHP4 to PHP5

          Chuck Anderson wrote:
          Jeff wrote:
          >
          > I'm working on a server that is running PHP4.
          >>
          > I'd like to upgrade this so I can use the PHP5 code I have already.
          >>
          > What kind, if any, problems will I have with the existing PHP code
          >base?
          >>
          > I see:
          >>
          > Local Master
          >>
          >magic_quotes_g pc On On
          >magic_quotes_r untime Off Off
          >>
          >I'm not sure what that means. I think that means that anything coming
          >in on $_REQUEST is backslashed and I'm thinking that probably won't
          >play well with PDO. If I turn that off what kind of failure could I
          >see in the existing code? Is that only a problem in that single quotes
          >will be backslashed in the data? Or can I have runtime crashes?
          >>
          > Jeff
          >>
          >>
          >
          >
          Just yesterday I ran into a problem with an old script I hadn't used in
          a very long while. It accessed uploaded files via $HTTP_POST_FILE S,
          which was still around in Php 4, but is gone in Php 5 (use $_FILES).
          >
          Yes, that could be. But even $HTTP_POST_FILE S is still available (but
          deprecated). You enable it with register_long_a rrays=on in the php.ini
          file.

          BTW - $_FILES and the rest have been around since php 4.1. Any code
          written since then should be using the new arrays. But I also suspect
          your code was written before then :-)

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          • Curtis

            #6
            Re: PHP4 to PHP5

            Jerry Stuckle wrote:
            Jeff wrote:
            > I'm working on a server that is running PHP4.
            >>
            > I'd like to upgrade this so I can use the PHP5 code I have already.
            >>
            > What kind, if any, problems will I have with the existing PHP code
            >base?
            >>
            > I see:
            >>
            > Local Master
            >>
            >magic_quotes_g pc On On
            >magic_quotes_r untime Off Off
            >>
            >I'm not sure what that means. I think that means that anything coming
            >in on $_REQUEST is backslashed and I'm thinking that probably won't
            >play well with PDO. If I turn that off what kind of failure could I
            >see in the existing code? Is that only a problem in that single quotes
            >will be backslashed in the data? Or can I have runtime crashes?
            >>
            > Jeff
            >>
            >
            The change from php4 to php5 probably won't be too painful. Virtually
            everything I've written for php4 runs fine on php5.
            >
            The magic_quotes_gp c may be another problem, however. You should have
            it off (it will be removed in php6 because it never really worked). If
            you've been depending on it being on, you'll have some code to change.
            >
            This is the code I wrote, if I need to deal with the possibility of
            magic_quotes_gp c being enabled. I don't know if this is the best, most
            efficient approach, though:

            <?php
            if ( get_magic_quote s_gpc() ) {
            $lambda = create_function ('&$str,$key',' $str=stripslash es($str);');
            array_walk_recu rsive($_GET, $lambda);
            array_walk_recu rsive($_POST, $lambda);
            array_walk_recu rsive($_COOKIE, $lambda);
            }
            ?>

            --
            Curtis (http://dyersweb.com)

            Comment

            • Jeff

              #7
              Re: PHP4 to PHP5

              Curtis wrote:
              Jerry Stuckle wrote:
              >Jeff wrote:
              >> I'm working on a server that is running PHP4.
              >>>
              >> I'd like to upgrade this so I can use the PHP5 code I have already.
              >>>
              >> What kind, if any, problems will I have with the existing PHP code
              >>base?
              >>>
              >> I see:
              >>>
              >> Local Master
              >>>
              >>magic_quotes_ gpc On On
              >>magic_quotes_ runtime Off Off
              >>>
              >>I'm not sure what that means. I think that means that anything coming
              >>in on $_REQUEST is backslashed and I'm thinking that probably won't
              >>play well with PDO. If I turn that off what kind of failure could I
              >>see in the existing code? Is that only a problem in that single
              >>quotes will be backslashed in the data? Or can I have runtime crashes?
              >>>
              >> Jeff
              >>>
              >>
              >The change from php4 to php5 probably won't be too painful. Virtually
              >everything I've written for php4 runs fine on php5.
              >>
              >The magic_quotes_gp c may be another problem, however. You should have
              >it off (it will be removed in php6 because it never really worked).
              >If you've been depending on it being on, you'll have some code to change.
              >>
              >
              This is the code I wrote, if I need to deal with the possibility of
              magic_quotes_gp c being enabled. I don't know if this is the best, most
              efficient approach, though:
              >
              <?php
              if ( get_magic_quote s_gpc() ) {
              $lambda = create_function ('&$str,$key',' $str=stripslash es($str);');
              array_walk_recu rsive($_GET, $lambda);
              array_walk_recu rsive($_POST, $lambda);
              array_walk_recu rsive($_COOKIE, $lambda);
              }
              ?>
              Thanks, I've added that to my php code snippets library.

              I think it's more likely that I may need to turn on magic_quotes_gp c in
              some existing code. No telling what may be there until someone
              complains! I'm not particularly wanting to spider 60 domains and check
              the code, there's enough I don't get paid for now!

              I think PHP suffers from the same problem that ASP does. It's
              perfectly easy for any idiot to write the most horrible unmaintainable crap!

              Jeff
              >
              --
              Curtis (http://dyersweb.com)

              Comment

              • sheldonlg

                #8
                Re: PHP4 to PHP5

                Jeff wrote:
                Curtis wrote:
                >Jerry Stuckle wrote:
                >>Jeff wrote:
                >>> I'm working on a server that is running PHP4.
                >>>>
                >>> I'd like to upgrade this so I can use the PHP5 code I have already.
                >>>>
                >>> What kind, if any, problems will I have with the existing PHP code
                >>>base?
                >>>>
                >>> I see:
                >>>>
                >>> Local Master
                >>>>
                >>>magic_quotes _gpc On On
                >>>magic_quotes _runtime Off Off
                >>>>
                >>>I'm not sure what that means. I think that means that anything
                >>>coming in on $_REQUEST is backslashed and I'm thinking that probably
                >>>won't play well with PDO. If I turn that off what kind of failure
                >>>could I see in the existing code? Is that only a problem in that
                >>>single quotes will be backslashed in the data? Or can I have runtime
                >>>crashes?
                >>>>
                >>> Jeff
                >>>>
                >>>
                >>The change from php4 to php5 probably won't be too painful.
                >>Virtually everything I've written for php4 runs fine on php5.
                >>>
                >>The magic_quotes_gp c may be another problem, however. You should
                >>have it off (it will be removed in php6 because it never really
                >>worked). If you've been depending on it being on, you'll have some
                >>code to change.
                >>>
                >>
                >This is the code I wrote, if I need to deal with the possibility of
                >magic_quotes_g pc being enabled. I don't know if this is the best, most
                >efficient approach, though:
                >>
                ><?php
                >if ( get_magic_quote s_gpc() ) {
                > $lambda = create_function ('&$str,$key',' $str=stripslash es($str);');
                > array_walk_recu rsive($_GET, $lambda);
                > array_walk_recu rsive($_POST, $lambda);
                > array_walk_recu rsive($_COOKIE, $lambda);
                >}
                >?>
                >
                Thanks, I've added that to my php code snippets library.
                >
                I think it's more likely that I may need to turn on magic_quotes_gp c in
                some existing code. No telling what may be there until someone
                complains! I'm not particularly wanting to spider 60 domains and check
                the code, there's enough I don't get paid for now!
                >
                I think PHP suffers from the same problem that ASP does. It's
                perfectly easy for any idiot to write the most horrible unmaintainable
                crap!
                I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol, PHP,
                VB, DCL, sh, csh, etc. and there isn't a language that I have seen that
                can prevent "any idiot to write the most horrible unmaintainable crap".

                Comment

                • Jeff

                  #9
                  Re: PHP4 to PHP5

                  sheldonlg wrote:
                  Jeff wrote:
                  >Curtis wrote:
                  >>Jerry Stuckle wrote:
                  >>>Jeff wrote:
                  >>>> I'm working on a server that is running PHP4.
                  >>>>>
                  >>>> I'd like to upgrade this so I can use the PHP5 code I have already.
                  >>>>>
                  >>>> What kind, if any, problems will I have with the existing PHP
                  >>>>code base?
                  >>>>>
                  >>>> I see:
                  >>>>>
                  >>>> Local Master
                  >>>>>
                  >>>>magic_quote s_gpc On On
                  >>>>magic_quote s_runtime Off Off
                  >>>>>
                  >>>>I'm not sure what that means. I think that means that anything
                  >>>>coming in on $_REQUEST is backslashed and I'm thinking that
                  >>>>probably won't play well with PDO. If I turn that off what kind of
                  >>>>failure could I see in the existing code? Is that only a problem in
                  >>>>that single quotes will be backslashed in the data? Or can I have
                  >>>>runtime crashes?
                  >>>>>
                  >>>> Jeff
                  >>>>>
                  >>>>
                  >>>The change from php4 to php5 probably won't be too painful.
                  >>>Virtually everything I've written for php4 runs fine on php5.
                  >>>>
                  >>>The magic_quotes_gp c may be another problem, however. You should
                  >>>have it off (it will be removed in php6 because it never really
                  >>>worked). If you've been depending on it being on, you'll have some
                  >>>code to change.
                  >>>>
                  >>>
                  >>This is the code I wrote, if I need to deal with the possibility of
                  >>magic_quotes_ gpc being enabled. I don't know if this is the best,
                  >>most efficient approach, though:
                  >>>
                  >><?php
                  >>if ( get_magic_quote s_gpc() ) {
                  >> $lambda = create_function ('&$str,$key',' $str=stripslash es($str);');
                  >> array_walk_recu rsive($_GET, $lambda);
                  >> array_walk_recu rsive($_POST, $lambda);
                  >> array_walk_recu rsive($_COOKIE, $lambda);
                  >>}
                  >>?>
                  >>
                  >Thanks, I've added that to my php code snippets library.
                  >>
                  >I think it's more likely that I may need to turn on magic_quotes_gp c
                  >in some existing code. No telling what may be there until someone
                  >complains! I'm not particularly wanting to spider 60 domains and check
                  >the code, there's enough I don't get paid for now!
                  >>
                  > I think PHP suffers from the same problem that ASP does. It's
                  >perfectly easy for any idiot to write the most horrible unmaintainable
                  >crap!
                  >
                  I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol, PHP,
                  VB, DCL, sh, csh, etc. and there isn't a language that I have seen that
                  can prevent "any idiot to write the most horrible unmaintainable crap".
                  But *most* idiots wouldn't attempt to write C or Java or C++. Every
                  idiot thinks they can write ASP or PHP. They even have Complete Idiots
                  books for them. At least in PHP you can write well, I'm unconvinced that
                  is even possible in classic ASP.

                  Simple only encourages them. This is not a fault per se in the language.

                  Jeff

                  Comment

                  • Jerry Stuckle

                    #10
                    Re: PHP4 to PHP5

                    Jeff wrote:
                    sheldonlg wrote:
                    >Jeff wrote:
                    >>Curtis wrote:
                    >>>Jerry Stuckle wrote:
                    >>>>Jeff wrote:
                    >>>>> I'm working on a server that is running PHP4.
                    >>>>>>
                    >>>>> I'd like to upgrade this so I can use the PHP5 code I have already.
                    >>>>>>
                    >>>>> What kind, if any, problems will I have with the existing PHP
                    >>>>>code base?
                    >>>>>>
                    >>>>> I see:
                    >>>>>>
                    >>>>> Local Master
                    >>>>>>
                    >>>>>magic_quot es_gpc On On
                    >>>>>magic_quot es_runtime Off Off
                    >>>>>>
                    >>>>>I'm not sure what that means. I think that means that anything
                    >>>>>coming in on $_REQUEST is backslashed and I'm thinking that
                    >>>>>probably won't play well with PDO. If I turn that off what kind
                    >>>>>of failure could I see in the existing code? Is that only a
                    >>>>>problem in that single quotes will be backslashed in the data? Or
                    >>>>>can I have runtime crashes?
                    >>>>>>
                    >>>>> Jeff
                    >>>>>>
                    >>>>>
                    >>>>The change from php4 to php5 probably won't be too painful.
                    >>>>Virtually everything I've written for php4 runs fine on php5.
                    >>>>>
                    >>>>The magic_quotes_gp c may be another problem, however. You should
                    >>>>have it off (it will be removed in php6 because it never really
                    >>>>worked). If you've been depending on it being on, you'll have some
                    >>>>code to change.
                    >>>>>
                    >>>>
                    >>>This is the code I wrote, if I need to deal with the possibility of
                    >>>magic_quotes _gpc being enabled. I don't know if this is the best,
                    >>>most efficient approach, though:
                    >>>>
                    >>><?php
                    >>>if ( get_magic_quote s_gpc() ) {
                    >>> $lambda = create_function ('&$str,$key',' $str=stripslash es($str);');
                    >>> array_walk_recu rsive($_GET, $lambda);
                    >>> array_walk_recu rsive($_POST, $lambda);
                    >>> array_walk_recu rsive($_COOKIE, $lambda);
                    >>>}
                    >>>?>
                    >>>
                    >>Thanks, I've added that to my php code snippets library.
                    >>>
                    >>I think it's more likely that I may need to turn on magic_quotes_gp c
                    >>in some existing code. No telling what may be there until someone
                    >>complains! I'm not particularly wanting to spider 60 domains and
                    >>check the code, there's enough I don't get paid for now!
                    >>>
                    >> I think PHP suffers from the same problem that ASP does. It's
                    >>perfectly easy for any idiot to write the most horrible
                    >>unmaintainabl e crap!
                    >>
                    >I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol,
                    >PHP, VB, DCL, sh, csh, etc. and there isn't a language that I have
                    >seen that can prevent "any idiot to write the most horrible
                    >unmaintainab le crap".
                    >
                    But *most* idiots wouldn't attempt to write C or Java or C++. Every
                    idiot thinks they can write ASP or PHP. They even have Complete Idiots
                    books for them. At least in PHP you can write well, I'm unconvinced that
                    is even possible in classic ASP.
                    >
                    Simple only encourages them. This is not a fault per se in the language.
                    >
                    Jeff
                    >
                    Jeff,

                    I agree. I've programmed in more languages than most - and some you've
                    probably never even heard of. In the years I've been programming and
                    teaching, I've seen some people try to write lousy code in other
                    languages.

                    For instance, they might try in C - but it isn't long before they have
                    real problems (i.e. bad pointers, insufficiently large arrays, etc.) and
                    give up. Even Java, with it's better handling of things, seems to deter
                    poor programmers.

                    But PHP and VBScript really do seem to attract poor programmers, and
                    even encourage them.

                    --
                    =============== ===
                    Remove the "x" from my email address
                    Jerry Stuckle
                    JDS Computer Training Corp.
                    jstucklex@attgl obal.net
                    =============== ===

                    Comment

                    • Peter H. Coffin

                      #11
                      Re: PHP4 to PHP5

                      On Sun, 20 Jul 2008 10:02:25 -0400, sheldonlg wrote:
                      I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol,
                      PHP, VB, DCL, sh, csh, etc. and there isn't a language that I
                      have seen that can prevent "any idiot to write the most horrible
                      unmaintainable crap".
                      Idiots are very ingenious like that.

                      --
                      It is impossible to sharpen a pencil with a blunt axe. It is equally vain
                      to try to do it with ten blunt axes instead -- E.W Dijkstra, 1930-2002

                      Comment

                      • Dale

                        #12
                        Re: PHP4 to PHP5


                        "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                        news:g5vrgd$pf5 $1@registered.m otzarella.org.. .
                        Jeff wrote:
                        >sheldonlg wrote:
                        >>Jeff wrote:
                        >>>Curtis wrote:
                        >>>>Jerry Stuckle wrote:
                        >>>>>Jeff wrote:
                        >>>>>> I'm working on a server that is running PHP4.
                        >>>>>>>
                        >>>>>> I'd like to upgrade this so I can use the PHP5 code I have
                        >>>>>>already .
                        >>>>>>>
                        >>>>>> What kind, if any, problems will I have with the existing PHP code
                        >>>>>>base?
                        >>>>>>>
                        >>>>>> I see:
                        >>>>>>>
                        >>>>>> Local Master
                        >>>>>>>
                        >>>>>>magic_quo tes_gpc On On
                        >>>>>>magic_quo tes_runtime Off Off
                        >>>>>>>
                        >>>>>>I'm not sure what that means. I think that means that anything
                        >>>>>>coming in on $_REQUEST is backslashed and I'm thinking that probably
                        >>>>>>won't play well with PDO. If I turn that off what kind of failure
                        >>>>>>could I see in the existing code? Is that only a problem in that
                        >>>>>>single quotes will be backslashed in the data? Or can I have runtime
                        >>>>>>crashes ?
                        >>>>>>>
                        >>>>>> Jeff
                        >>>>>>>
                        >>>>>>
                        >>>>>The change from php4 to php5 probably won't be too painful.
                        >>>>>Virtuall y everything I've written for php4 runs fine on php5.
                        >>>>>>
                        >>>>>The magic_quotes_gp c may be another problem, however. You should
                        >>>>>have it off (it will be removed in php6 because it never really
                        >>>>>worked). If you've been depending on it being on, you'll have some
                        >>>>>code to change.
                        >>>>>>
                        >>>>>
                        >>>>This is the code I wrote, if I need to deal with the possibility of
                        >>>>magic_quote s_gpc being enabled. I don't know if this is the best, most
                        >>>>efficient approach, though:
                        >>>>>
                        >>>><?php
                        >>>>if ( get_magic_quote s_gpc() ) {
                        >>>> $lambda = create_function ('&$str,$key',' $str=stripslash es($str);');
                        >>>> array_walk_recu rsive($_GET, $lambda);
                        >>>> array_walk_recu rsive($_POST, $lambda);
                        >>>> array_walk_recu rsive($_COOKIE, $lambda);
                        >>>>}
                        >>>>?>
                        >>>>
                        >>>Thanks, I've added that to my php code snippets library.
                        >>>>
                        >>>I think it's more likely that I may need to turn on magic_quotes_gp c in
                        >>>some existing code. No telling what may be there until someone
                        >>>complains! I'm not particularly wanting to spider 60 domains and check
                        >>>the code, there's enough I don't get paid for now!
                        >>>>
                        >>> I think PHP suffers from the same problem that ASP does. It's
                        >>>perfectly easy for any idiot to write the most horrible unmaintainable
                        >>>crap!
                        >>>
                        >>I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol, PHP,
                        >>VB, DCL, sh, csh, etc. and there isn't a language that I have seen that
                        >>can prevent "any idiot to write the most horrible unmaintainable crap".
                        >>
                        >But *most* idiots wouldn't attempt to write C or Java or C++. Every idiot
                        >thinks they can write ASP or PHP. They even have Complete Idiots books
                        >for them. At least in PHP you can write well, I'm unconvinced that is
                        >even possible in classic ASP.
                        >>
                        > Simple only encourages them. This is not a fault per se in the language.
                        >>
                        > Jeff
                        >>
                        >
                        Jeff,
                        >
                        I agree. I've programmed in more languages than most - and some you've
                        probably never even heard of. In the years I've been programming and
                        teaching, I've seen some people try to write lousy code in other
                        languages.
                        lil self-righteous there, eh jer.

                        mmmm, perhaps the 'more than most' you speak of are simply the number of
                        noobs who ask questions here compared to the dozen of so who answer them.
                        given the amount of time you spend here, perhaps you've got a skewed, ever
                        so slightly, POV. 'most' people with whom i work on a professional level not
                        only have at least 7 programming languages under their belt, they also have
                        at least two spoken languages as well.

                        and, of all the programmers that i've met who DID write lousy code, i've yet
                        to meet ONE who had that intention at the time they sat down to produce a
                        result linguistically. the fact of the matter is, they are learning just as
                        we all are.

                        there's that, and there's the fact that 'most' advanced developers think
                        they know it all, have seen it all, and done it all. those are the ones i
                        pity most. those i respect the least are just these kinds of people who put
                        down the ones on the left-hand side of the learning curve! that should be
                        plain enough for a normal person, JERRY, to feel some kind of conviction
                        about the words they haphazardly choose.


                        Comment

                        • Dale

                          #13
                          Re: PHP4 to PHP5


                          "Peter H. Coffin" <hellsop@ninehe lls.comwrote in message
                          news:slrng8801f .uuk.hellsop@ab yss.ninehells.c om...
                          On Sun, 20 Jul 2008 10:02:25 -0400, sheldonlg wrote:
                          >
                          >I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol,
                          >PHP, VB, DCL, sh, csh, etc. and there isn't a language that I
                          >have seen that can prevent "any idiot to write the most horrible
                          >unmaintainab le crap".
                          >
                          Idiots are very ingenious like that.
                          you know, these 'idiots' i don't have a problem with. i can't stand the
                          end-users. they can find a bug in software the minute you sit them in front
                          of the interface. it so negates the hours of time spent by the author and
                          the testing team to ensure they can't screw anything up!

                          while there is no stopping such ingenious idiots, i find i can deal with the
                          fact that the real problem is not them. i have to pause and rethink why i'm
                          calling someone an idiot; someone who is only doing what they know to do.
                          that's whether it's using an interface or writing the best code they know
                          how. both problems can be fixed...and that won't be blamed on how easily
                          code can be written in one language or another. grab one of the offenders
                          and show them a better way to write the code!

                          just a thought.

                          cheers.


                          Comment

                          • sheldonlg

                            #14
                            Re: PHP4 to PHP5

                            Dale wrote:
                            "Peter H. Coffin" <hellsop@ninehe lls.comwrote in message
                            news:slrng8801f .uuk.hellsop@ab yss.ninehells.c om...
                            >On Sun, 20 Jul 2008 10:02:25 -0400, sheldonlg wrote:
                            >>
                            >>I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol,
                            >>PHP, VB, DCL, sh, csh, etc. and there isn't a language that I
                            >>have seen that can prevent "any idiot to write the most horrible
                            >>unmaintainabl e crap".
                            >Idiots are very ingenious like that.
                            >
                            you know, these 'idiots' i don't have a problem with. i can't stand the
                            end-users. they can find a bug in software the minute you sit them in front
                            of the interface. it so negates the hours of time spent by the author and
                            the testing team to ensure they can't screw anything up!
                            >
                            while there is no stopping such ingenious idiots, i find i can deal with the
                            fact that the real problem is not them. i have to pause and rethink why i'm
                            calling someone an idiot; someone who is only doing what they know to do.
                            that's whether it's using an interface or writing the best code they know
                            how. both problems can be fixed...and that won't be blamed on how easily
                            code can be written in one language or another. grab one of the offenders
                            and show them a better way to write the code!
                            >
                            just a thought.
                            >
                            cheers.
                            >
                            >
                            True. What comes to mind is my own experience. I taught myself Fortran
                            eons ago. It was spaghetti code (GOTOs) because that was all there was
                            at the time. The first time I had to function as a programmer (a few
                            decades ago), and not as an mechanical engineer, I had the task of
                            modifying someone else's code. I saw the if-then-else construct and I
                            said to myself "Wow, this is the way I think!". Since that time I have
                            written, perhaps, five GOTOs -- if that many. I made it my own. Then I
                            saw indentation. I said to myself "Wow, this is much easier to see".
                            Since then, I have always indented consistently. Later, someone said
                            that lower case was easier to read than upper case. Guess what I did?
                            I went to lower case. Then came Java with its unofficial "rules" for
                            upper/lower case. "Wow, this adds immediate recognition for the various
                            types. OK, I'll use it -- and I do now even in php (when I can)".

                            It is that kind of learning process, and self-improvement process, that
                            leads to better and better code -- and it is what Dale is talking about.

                            In summary, I agree.

                            Comment

                            • Jerry Stuckle

                              #15
                              Re: PHP4 to PHP5

                              sheldonlg wrote:
                              Dale wrote:
                              >"Peter H. Coffin" <hellsop@ninehe lls.comwrote in message
                              >news:slrng8801 f.uuk.hellsop@a byss.ninehells. com...
                              >>On Sun, 20 Jul 2008 10:02:25 -0400, sheldonlg wrote:
                              >>>
                              >>>I have programmed in Fortran, PL/1, C, Java, Basic, Pascal, Cobol,
                              >>>PHP, VB, DCL, sh, csh, etc. and there isn't a language that I
                              >>>have seen that can prevent "any idiot to write the most horrible
                              >>>unmaintainab le crap".
                              >>Idiots are very ingenious like that.
                              >>
                              >you know, these 'idiots' i don't have a problem with. i can't stand
                              >the end-users. they can find a bug in software the minute you sit them
                              >in front of the interface. it so negates the hours of time spent by
                              >the author and the testing team to ensure they can't screw anything up!
                              >>
                              >while there is no stopping such ingenious idiots, i find i can deal
                              >with the fact that the real problem is not them. i have to pause and
                              >rethink why i'm calling someone an idiot; someone who is only doing
                              >what they know to do. that's whether it's using an interface or
                              >writing the best code they know how. both problems can be fixed...and
                              >that won't be blamed on how easily code can be written in one language
                              >or another. grab one of the offenders and show them a better way to
                              >write the code!
                              >>
                              >just a thought.
                              >>
                              >cheers.
                              >>
                              >
                              True. What comes to mind is my own experience. I taught myself Fortran
                              eons ago. It was spaghetti code (GOTOs) because that was all there was
                              at the time. The first time I had to function as a programmer (a few
                              decades ago), and not as an mechanical engineer, I had the task of
                              modifying someone else's code. I saw the if-then-else construct and I
                              said to myself "Wow, this is the way I think!". Since that time I have
                              written, perhaps, five GOTOs -- if that many. I made it my own. Then I
                              saw indentation. I said to myself "Wow, this is much easier to see".
                              Since then, I have always indented consistently. Later, someone said
                              that lower case was easier to read than upper case. Guess what I did? I
                              went to lower case. Then came Java with its unofficial "rules" for
                              upper/lower case. "Wow, this adds immediate recognition for the various
                              types. OK, I'll use it -- and I do now even in php (when I can)".
                              >
                              It is that kind of learning process, and self-improvement process, that
                              leads to better and better code -- and it is what Dale is talking about.
                              >
                              In summary, I agree.
                              Ah, fond memories. My first language was Fortran II. Coding forms,
                              punched cards... Those were the days :-)

                              I also had lots of GOTO's. :-)

                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              Working...