What PHP represents

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

    What PHP represents

    What PHP Represents

    There is no shortage of complaints one could make about php as a
    language, and although the list does shrink with each release, some of
    them are inherent to the origins and development process of this, the
    most popular of the web-based, server-side, glue-languages.

    That said, most descriptions of what is good about php, fail to do it
    justice. Although they are generally enthusiastic and sometimes
    fanatical, no amount of religious zeal about its coolness or easiness
    can make up for missing the main point. Out of the theoretical realm of
    language design and into the economic reality, php is the most powerful
    (programming) language so far created.

    This would not be true if it didn't sit on top of powerful tools
    written in other languages, it wouldn't be true if it wasn't so easy to
    integrate it with things like html, apache and mysql, but it does and
    it is; and this combination provides the most efficient way to achieve
    the main economic purpose that our society has for computers. It's the
    same purpose that the ancient sumerians had for clay tablets:
    recording, storing and accessing business information. The knock-on
    benefits of this for all other kinds of information storage and
    communication are obvious, but it's a computer's role as a super
    filing-cabinet that puts bread on the table.

    Stock, customers, suppliers, workers, money, tools. Keep track of these
    and you can keep track of your business, keep track of your business
    and just maybe you can make some money.

    Even running on a local server, a web application might be slower than
    a properly designed thick-client program. It's almost certainly going
    to be less pretty, but since when is that the point? If you want your
    information to be accessible and your interface to be customisable and
    your programming tools to be free, then you can't beat php; or more
    broadly, you can't beat the LAMP platform of which php is God.

    This "superglue" language is more popular on the www than any other,
    but it's even more useful in a local environment, serving web
    applications. It's not the best for every purpose, of course, but it
    represents for economic activity what television represents for
    propaganda. Nothing else really comes close.

    Anyway, that's how I see it (now I must get back to my stock-control
    system)

  • Larry Qualig

    #2
    Re: What PHP represents


    "darwinist" <darwinist@gmai l.com> wrote in message
    news:1119407989 .997265.63910@g 49g2000cwa.goog legroups.com...[color=blue]
    > What PHP Represents
    > <snip>
    > Nothing else really comes close.[/color]


    I definitely took some liberty with my <snip> of your post so it may be
    somewhat out of context. I looked at PHP several years ago and didn't care
    for it much. It most likely evolved since then but I preferred Java/jsp then
    and still prefer Java now for web-pages. But given the popularity of PHP
    there must be something to it or everyone wouldn't be using it. ( Errr... I
    think I just made the Windows argument.)





    Comment

    • Erik Funkenbusch

      #3
      Re: What PHP represents

      On Tue, 21 Jun 2005 22:46:25 -0400, Larry Qualig wrote:
      [color=blue]
      > "darwinist" <darwinist@gmai l.com> wrote in message
      > news:1119407989 .997265.63910@g 49g2000cwa.goog legroups.com...[color=green]
      >> What PHP Represents
      >> <snip>
      >> Nothing else really comes close.[/color]
      >
      >
      > I definitely took some liberty with my <snip> of your post so it may be
      > somewhat out of context. I looked at PHP several years ago and didn't care
      > for it much. It most likely evolved since then but I preferred Java/jsp then
      > and still prefer Java now for web-pages. But given the popularity of PHP
      > there must be something to it or everyone wouldn't be using it. ( Errr... I
      > think I just made the Windows argument.)[/color]

      PHP, while popwerful, does suffer from some serious and often cripling
      flaws. It really takes some of the worst features of almost very lanugage
      it steals ideas from.

      For example, it's loose typing and declaration system as well as its almost
      complete lack of scoping contexts make it much more difficult to write
      bug-free code than other scripting languages that provide these features.
      Hell, even old style VB had Option Explicit to require the declaration of
      variables prior to their use.

      While it does improve every version, it seems to take a significant amount
      of time for the majority of distro's to upgrade, much less the users. The
      latest version of SuSE still ships 4.x, for instance (and no way to easily
      upgrade short of a tarball or seeking out a third party RPM, and given how
      tightly SuSE has integrated apache and php etal into YaST that means some
      significant surgery to decouple it).

      There's no doubt that PHP is a powerful language, and the issues with it
      are not insurmountable. It's much like the Star Wars universe though. Not
      a single hand rail in sight, anywhere.

      Comment

      • Larry Qualig

        #4
        Re: What PHP represents


        "Erik Funkenbusch" <erik@despam-funkenbusch.com > wrote in message
        news:sasu1a0fbr av.dlg@funkenbu sch.com...[color=blue]
        > On Tue, 21 Jun 2005 22:46:25 -0400, Larry Qualig wrote:
        >
        > It's much like the Star Wars universe though.
        > Not a single hand rail in sight, anywhere.[/color]


        Comment

        • Larry Qualig

          #5
          Re: What PHP represents


          "Erik Funkenbusch" <erik@despam-funkenbusch.com > wrote in message
          news:sasu1a0fbr av.dlg@funkenbu sch.com...[color=blue]
          > On Tue, 21 Jun 2005 22:46:25 -0400, Larry Qualig wrote:
          >
          > It's much like the Star Wars universe though.
          > Not a single hand rail in sight, anywhere.[/color]


          I understand exactly what you mean. It's obvious that in the future OSHA
          will cease to exist.




          Comment

          • Chris Hope

            #6
            Re: What PHP represents

            Erik Funkenbusch wrote:

            [snip]
            [color=blue]
            > PHP, while popwerful, does suffer from some serious and often cripling
            > flaws. It really takes some of the worst features of almost very
            > lanugage it steals ideas from.[/color]

            I won't disagree there are some/many flaws in PHP. In particular is the
            lack of consistancy of function naming and order of parameters to a
            function, and the lack of namespacing which they seem determined to not
            implement ever.
            [color=blue]
            > For example, it's loose typing and declaration system as well as its
            > almost complete lack of scoping contexts make it much more difficult
            > to write bug-free code than other scripting languages that provide
            > these features. Hell, even old style VB had Option Explicit to require
            > the declaration of variables prior to their use.[/color]

            VB and PHP and similar in this respect. By default neither will report
            errors when trying to use an undeclared variable. You can use the
            error_reporting () function in PHP in the same way as Option Explicit to
            at least show error messages when attempting to use an undefined
            variabled.
            [color=blue]
            > While it does improve every version, it seems to take a significant
            > amount
            > of time for the majority of distro's to upgrade, much less the users.
            > The latest version of SuSE still ships 4.x, for instance (and no way
            > to easily upgrade short of a tarball or seeking out a third party RPM,
            > and given how tightly SuSE has integrated apache and php etal into
            > YaST that means some significant surgery to decouple it).[/color]

            Many people still consider it to be too soon to start using the 5.x
            branch hence it still not being the default version in new releases of
            SUSE and other Linux distros.

            [snip]

            --
            Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com

            Comment

            • Erik Funkenbusch

              #7
              Re: What PHP represents

              On Tue, 21 Jun 2005 23:31:04 -0400, Larry Qualig wrote:
              [color=blue]
              > "Erik Funkenbusch" <erik@despam-funkenbusch.com > wrote in message
              > news:sasu1a0fbr av.dlg@funkenbu sch.com...[color=green]
              >> On Tue, 21 Jun 2005 22:46:25 -0400, Larry Qualig wrote:
              >>
              >> It's much like the Star Wars universe though.
              >> Not a single hand rail in sight, anywhere.[/color]
              >
              >
              > I understand exactly what you mean. It's obvious that in the future OSHA
              > will cease to exist.[/color]

              Lol, except it was in the past, before OSHA existed.

              Comment

              • Chung Leong

                #8
                Re: What PHP represents

                > There is no shortage of complaints one could make about php as a[color=blue]
                > language, and although the list does shrink with each release, some of
                > them are inherent to the origins and development process of this, the
                > most popular of the web-based, server-side, glue-languages.[/color]

                Seriously, what the hell is the point of your post?

                Instead of posting your own supposition, take a look at the posts in
                this newsgroup. How many of them are complaints about PHP as a
                language? One in a hundred? Five hundred?

                Comment

                • darwinist

                  #9
                  Re: What PHP represents

                  Larry Qualig wrote:[color=blue]
                  > "darwinist" <darwinist@gmai l.com> wrote in message
                  > news:1119407989 .997265.63910@g 49g2000cwa.goog legroups.com...[color=green]
                  > > What PHP Represents
                  > > <snip>
                  > > Nothing else really comes close.[/color]
                  >
                  >
                  > I definitely took some liberty with my <snip> of your post so it may be
                  > somewhat out of context. I looked at PHP several years ago and didn't care
                  > for it much. It most likely evolved since then but I preferred Java/jsp then
                  > and still prefer Java now for web-pages. But given the popularity of PHP
                  > there must be something to it or everyone wouldn't be using it. ( Errr... I
                  > think I just made the Windows argument.)[/color]

                  To fill in the context:
                  Databases for tracking business resources are just glorified
                  clay-tablets, but in terms of information technology, that's what
                  economies need above all else.
                  PHP is the most powerful language for making such things.

                  To get into a language war for the fun of it:

                  Java, from a consistency and design point of view, is a far superior
                  language, but it's too clean for a glue language (in my opinion).

                  Although I must admit more ignorance of java than you do of php; does
                  java let me do this:
                  <a href="<?php print $TargetURL; ?>">Click Here</a>

                  or this:
                  print "hello $Name you should order some {$ClientArray['Popular
                  Product']}'s because they are awesome. Click $ButtonCode if you want to
                  be awesome.";

                  Anyway, as I argue in the OP, the strength of php is in its freedom
                  (freedom in that the language imposes no architecture on you, freedom
                  in obtaining the development tools, and freedom in modifying them if
                  you want), what it can do with just the standard library, and how
                  efficiently - in terms of amount of code needed - it can do it.

                  It's certainly not that it's a particularly well-designed language. In
                  fact it could be argued that php is not even a poorly designed
                  language, it simply was not designed. It started, and has developed,
                  based on what various people (Rasmus Lerdorf being the first) wanted to
                  do with their web sites. The connection between php and web-based
                  productivity is just that direct.

                  (That said I would probably switch to python tomorrow if it was equally
                  at home in a web environment and if you could do all the cool embedding
                  stuff with it.)

                  Trying to make php a "proper" scripting language was always an
                  afterthought. Although it's this afterthought - for example the zend
                  engine, and more recently proper object support - that has made it such
                  a viable option for commercial development.

                  Now it's got the snowball effect of everyone (ie your average web
                  developer) uses it so everyone (ie your average web hosting company)
                  supports it, so therefore, everyone uses it because everyone supports
                  it. This same popularity factor means the standard library is fat, help
                  is easy to find, and the amount of freely available libraries that you
                  can find on various third-party websites and start using with one
                  require_once() statement, is really quite impressive.

                  It's messy but it's rich and powerful. You could say its strengths are
                  analogous to the those of the highly promiscuous language we are using
                  to communicate at the moment (english).

                  Comment

                  • Marcin Dobrucki

                    #10
                    Re: What PHP represents

                    darwinist wrote:
                    [color=blue]
                    > To fill in the context:
                    > Databases for tracking business resources are just glorified
                    > clay-tablets, but in terms of information technology, that's what
                    > economies need above all else.
                    > PHP is the most powerful language for making such things.[/color]

                    There is a purpose of all things, but discussion of benefits/flows
                    always brings to mind this good old Dilbert's "Look, actual code"
                    cartoon (thanks google>
                    http://aces.tabulas.com/ubill/big/di...ctual_code.jpg)

                    So, hence php.

                    /m

                    Comment

                    • Erik Funkenbusch

                      #11
                      Re: What PHP represents

                      On 21 Jun 2005 22:34:50 -0700, darwinist wrote:
                      [color=blue]
                      > Although I must admit more ignorance of java than you do of php; does
                      > java let me do this:
                      > <a href="<?php print $TargetURL; ?>">Click Here</a>[/color]

                      Yes, of course. That's pretty basic stuff for any server side language.
                      [color=blue]
                      > or this:
                      > print "hello $Name you should order some {$ClientArray['Popular
                      > Product']}'s because they are awesome. Click $ButtonCode if you want to
                      > be awesome.";[/color]

                      PHP does make string substitution much nicer and easier to read.
                      [color=blue]
                      > Anyway, as I argue in the OP, the strength of php is in its freedom
                      > (freedom in that the language imposes no architecture on you, freedom
                      > in obtaining the development tools, and freedom in modifying them if
                      > you want), what it can do with just the standard library, and how
                      > efficiently - in terms of amount of code needed - it can do it.[/color]

                      While it's true that PHP imposes no real architecture on you, also doesn't
                      provide one or encourage one. This often leads to architecture-less code
                      (or the inverse, over-architected code).

                      For example, consider the relatively common case of a "wizard" like
                      interface where you move from page to page sequentially but only after each
                      page has been validated. There are so many different ways to do this, and
                      most of them will give you enough rope to shoot yourself in the foot
                      (especially when you consider issues like double transactions from refresh
                      or back-button use, and the like).

                      Now, you can argue that products like Zend are there to fill this
                      "architectu re" gap, but for those not willing to invest in something like
                      Zend, you end up looking through a LOT of bad sample code and experimenting
                      with trial and error, which is frankly a piss poor way to design an
                      application.
                      [color=blue]
                      > It's certainly not that it's a particularly well-designed language.[/color]

                      You're good at understatements , i see.
                      [color=blue]
                      > (That said I would probably switch to python tomorrow if it was equally
                      > at home in a web environment and if you could do all the cool embedding
                      > stuff with it.)[/color]

                      You might be more interested in using Mono with ASP.NET

                      [color=blue]
                      > Trying to make php a "proper" scripting language was always an
                      > afterthought. Although it's this afterthought - for example the zend
                      > engine, and more recently proper object support - that has made it such
                      > a viable option for commercial development.[/color]

                      Actually, it makes it a pretty poor choice for commercial development, or
                      at least large sclae commercial development. They tend to break a lot of
                      things from version to version. This makes it much harder to make your app
                      run on all versions, or even keep up with the latest version.
                      [color=blue]
                      > Now it's got the snowball effect of everyone (ie your average web
                      > developer) uses it so everyone (ie your average web hosting company)
                      > supports it, so therefore, everyone uses it because everyone supports
                      > it. This same popularity factor means the standard library is fat, help
                      > is easy to find, and the amount of freely available libraries that you
                      > can find on various third-party websites and start using with one
                      > require_once() statement, is really quite impressive.[/color]

                      I would be a lot happier with PHP if they offered more instruction to new
                      developers, defined best practices, and didn't have 30 ways to do the same
                      thing.
                      [color=blue]
                      > It's messy but it's rich and powerful. You could say its strengths are
                      > analogous to the those of the highly promiscuous language we are using
                      > to communicate at the moment (english).[/color]

                      Perhaps, but then the human inference engine works a lot better than the
                      PHP one.

                      Comment

                      • Erwin Moller

                        #12
                        Re: What PHP represents

                        Marcin Dobrucki wrote:
                        [color=blue]
                        > There is a purpose of all things, but discussion of benefits/flows
                        > always brings to mind this good old Dilbert's "Look, actual code"
                        > cartoon (thanks google>
                        > http://aces.tabulas.com/ubill/big/di...ctual_code.jpg)
                        >
                        > So, hence php.
                        >
                        > /m[/color]

                        LOL, That Dilbert rocks!
                        :-)
                        :-)
                        :-)

                        Regards,
                        Erwin Moller

                        Comment

                        • darwinist

                          #13
                          Re: What PHP represents

                          Erik Funkenbusch wrote:[color=blue]
                          > On 21 Jun 2005 22:34:50 -0700, darwinist wrote:[/color]
                          [...][color=blue]
                          > While it's true that PHP imposes no real architecture on you, also doesn't
                          > provide one or encourage one. This often leads to architecture-less code
                          > (or the inverse, over-architected code).[/color]

                          Yes, one could say it fails to provide structure and allows things to
                          be done that should never be done (I know I've falled into both traps
                          you mention). One might also say there is no substitute for good
                          programming practices, and php doesn't try to provide one. No prizes
                          for guessing which philosophy I'm leaning to at this point in time.
                          [color=blue]
                          > For example, consider the relatively common case of a "wizard" like
                          > interface where you move from page to page sequentially but only after each
                          > page has been validated. There are so many different ways to do this, and
                          > most of them will give you enough rope to shoot yourself in the foot
                          > (especially when you consider issues like double transactions from refresh
                          > or back-button use, and the like).[/color]

                          Mixed metaphors aside, I agree that php gives you "too much" freedom.
                          On the other hand, the more I learn to deal with this freedom, the more
                          I resent the imposed structure of other platforms and languages that
                          I've used.
                          [color=blue]
                          > Now, you can argue that products like Zend are there to fill this
                          > "architectu re" gap, but for those not willing to invest in something like
                          > Zend, you end up looking through a LOT of bad sample code and experimenting
                          > with trial and error, which is frankly a piss poor way to design an
                          > application.[/color]

                          Actually I've been surprised, when forced to create a new architecture
                          from scratch (for the reasons you mention), how quickly and easily it
                          can be achieved if you tailor it to the specific application and
                          clarify exactly what you will need instead of trying to include all the
                          things you might desire in the future.

                          As long as you don't try to think of the framework as fixed or
                          complete, and let it evolve (sensibly) with the application, it seems
                          to be a lot quicker than trying to fit everything within a design
                          you've created previously, or within a design that someone else has
                          created.

                          But that's just my experience to date, I've still got a lot to learn.
                          [color=blue][color=green]
                          > > It's certainly not that it's a particularly well-designed language.[/color]
                          >
                          > You're good at understatements , i see.
                          >[color=green]
                          > > (That said I would probably switch to python tomorrow if it was equally
                          > > at home in a web environment and if you could do all the cool embedding
                          > > stuff with it.)[/color]
                          >
                          > You might be more interested in using Mono with ASP.NET
                          > http://www.mono-project.com/ASP.NET[/color]

                          Thanks for the tip.
                          [color=blue][color=green]
                          > > Trying to make php a "proper" scripting language was always an
                          > > afterthought. Although it's this afterthought - for example the zend
                          > > engine, and more recently proper object support - that has made it such
                          > > a viable option for commercial development.[/color]
                          >
                          > Actually, it makes it a pretty poor choice for commercial development, or
                          > at least large sclae commercial development. They tend to break a lot of
                          > things from version to version. This makes it much harder to make your app
                          > run on all versions, or even keep up with the latest version.[/color]

                          The fact that it (trying to make it a proper scripting language) is an
                          afterthought, is not what makes it a viable option. Quite the opposite,
                          as you describe. But the fact that it's thought of at all is one of the
                          reasons it has moved from a hobby language to the most popular on the
                          web, in huge organisations as well as tiny ones.

                          Given the cost of the product, I don't think they add new things that
                          break old things just so you'll buy the latest version, it's more a
                          matter of ironing out the bumps which, to put on my rose coloured
                          glasses for a second, should happen less as the language matures.

                          A lot of times old things are kept for backwards comptability if they
                          can be, and one might argue it's better to break something which should
                          be broken and get it over with, rather than wait till even more people
                          are using and relying on it. In any case I agree it's a problem.
                          [color=blue][color=green]
                          > > Now it's got the snowball effect of everyone (ie your average web
                          > > developer) uses it so everyone (ie your average web hosting company)
                          > > supports it, so therefore, everyone uses it because everyone supports
                          > > it. This same popularity factor means the standard library is fat, help
                          > > is easy to find, and the amount of freely available libraries that you
                          > > can find on various third-party websites and start using with one
                          > > require_once() statement, is really quite impressive.[/color]
                          >
                          > I would be a lot happier with PHP if they offered more instruction to new
                          > developers, defined best practices, and didn't have 30 ways to do the same
                          > thing.[/color]

                          I have this problem as well, and so I maintain a list of my own
                          best-practices which I refine or add to from time to time. Once it had
                          grown to about a dozen basic principles, I realised that although I was
                          forced to think about these things because of php, I would have been
                          far more productive if I had followed these rules for all languages
                          I've used in the past. The one thing I never expected PHP to teach me
                          as a programmer is discipline.
                          [color=blue][color=green]
                          > > It's messy but it's rich and powerful. You could say its strengths are
                          > > analogous to the those of the highly promiscuous language we are using
                          > > to communicate at the moment (english).[/color]
                          >
                          > Perhaps, but then the human inference engine works a lot better than the
                          > PHP one.[/color]

                          Comment

                          • Colin McKinnon

                            #14
                            Re: What PHP represents

                            Chris Hope wrote:
                            [color=blue]
                            > Erik Funkenbusch wrote:
                            >
                            > [snip]
                            >[color=green]
                            >> PHP, while popwerful, does suffer from some serious and often cripling
                            >> flaws. It really takes some of the worst features of almost very
                            >> lanugage it steals ideas from.[/color]
                            >
                            > I won't disagree there are some/many flaws in PHP. In particular is the
                            > lack of consistancy of function naming and order of parameters to a
                            > function, and the lack of namespacing which they seem determined to not
                            > implement ever.
                            >[/color]

                            I'm not trying to propogate a flame war - I think this kind of debate is
                            good and educational.

                            I must disagree though about the aspersions being flung about here. There
                            was some very well-argued debate regarding typing on the list recently.
                            Some poeple like strong typing, some like dynamic typing, some liked other
                            flavours. Most agreed that the approach taken by PHP wasn't instrinsically
                            flawed in any way - but some felt more at home with other approaches to the
                            issue.

                            I think PHP would benefit from changes to the things Chris explicitly
                            mentions - i.e. case sensitivity in function names and some way of better
                            managing the namespace. And the change to object references, and the
                            try...catch construct in PHP 5 is very welcome. But beyond that, I can't
                            think of anything within PHP which I think is poorly designed - I don't
                            feel like I'm making a compromise by developing in PHP rather than Perl or
                            Java or C.

                            If you think differently tell us why.
                            [color=blue]
                            > They tend to break a lot of
                            > things from version to version. This makes it much harder to make your
                            > app run on all versions, or even keep up with the latest version.[/color]

                            I've already mentioned there are some fundamental things which changed from
                            4 to 5. But IMHO PHP is a lot more 'stable' in this regard than a lot of
                            other tools. Admittedly Perl, Java and C have seen little change in recent
                            times but can the same be said of *anything* out of Redmond? Have you
                            started migrating to Apache 2 yet? What about Linux - its had 3 different
                            firewall tools in the last 4 major revisions - and the process and I/O
                            schedulers keep changing too.

                            What I keep coming back to is this: PHP doesn't define architecture, it
                            doesn't define the rules by which you build applications - should it? Even
                            using a different set of tools, you need to integrate development with
                            testing. Both unit testing and integration testing (preferably continious
                            integration). PHP allows these structures to evolve - because I don't think
                            they are mature yet for any platform.

                            Consider this example - suppose we have a function like strtok() - i.e.
                            splits up a string 'subject' using a string 'div'. It doesn't matter if the
                            typing of the language is strict and static, if it is compiled or
                            interpreted, the language can't spot the difference between:
                            my_split(subjec t, div)
                            and
                            my_split(div. subject)


                            [color=blue]
                            > I would be a lot happier with PHP if they offered more instruction to new
                            > developers, defined best practices, and didn't have 30 ways to do the same
                            > thing.[/color]

                            I wouldn't. There are a lot of things that need to be learnt about how to
                            use PHP but for the PHP developers to take responisibility for this may
                            lead to the language being restructured to fit in with the 'rules' when the
                            'rules' themselves may be flawed. I also think PHP has got the balance
                            right between simplicity and functionality.

                            I try to stick to the PEAR style guidelines - but mostly I don't use PEAR
                            classes in my programs. I use PHPDoc and phpunit. But I know why those
                            tools are important. To say to a new developer - you must write your code
                            this way, using these tools and practices just creates boundaries to
                            participation.

                            C.

                            Comment

                            • Larry Qualig

                              #15
                              Re: What PHP represents


                              "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
                              news:1119416549 .887653.96870@o 13g2000cwo.goog legroups.com...[color=blue]
                              >
                              > Seriously, what the hell is the point of your post?
                              >[/color]

                              Relax. PHP does run on Linux/Apache so there is a connection. Which is more
                              that can be said for a lot of other threads.

                              [color=blue]
                              > Instead of posting your own supposition, take a look at the posts in
                              > this newsgroup. How many of them are complaints about PHP as a
                              > language? One in a hundred? Five hundred?
                              >[/color]

                              I suggest you re-read the post. The post was praising PHP, not complaining
                              about it.



                              Comment

                              Working...