The Artima Developer Community
Sponsored Link

Weblogs Forum
What's Cool About PHP

17 replies on 2 pages. Most recent reply: Sep 5, 2008 11:14 AM by Perl Junkie

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 17 replies on 2 pages [ 1 2 | » ]
Bruce Eckel

Posts: 875
Nickname: beckel
Registered: Jun, 2003

What's Cool About PHP (View in Weblogs)
Posted: May 26, 2008 12:14 PM
Reply to this message Reply
Summary
You can just use it a little bit.
Advertisement

This is actually very impressive, that you don't need to know much about the language in order to make valuable use of it. How many languages do you know where that's possible? At the other extreme end of the spectrum is Java, which requires a bunch of knowledge for hello world, and a boatload to get a web app up and going. In PHP it's trivial.

That said, PHP is only somewhat better than Perl when it comes to inviting bad behavior. I remember back in the rising days of the Web, hearing people say they were going to build big applications in Perl, and just knowing (with no hope of convincing them) that they were going to fail.

PHP, on the other hand, has definitely created some larger apps. Drupal, for example. My friend Nancy Nicolaisen (a blogger here) said she wanted to put up a travel web site and I suggested she look at Drupal. She did, ended up choosing it -- primarily, she said, because the user community was so nice and helpful -- and got her site up and running with a minimum of fuss.

And PHP allows novices to cut to the chase and do things they are directly interested in without messing about with a lot of programming theory and practice. You just do it and it shows up on your web page.

But that's also the problem with the language. You can find tons of completely wrong examples of how to do something in PHP, written by people who are copying each other because no one knows what questions to ask. One of my first forays into the language I wanted to see examples of file locking in PHP, and found lots of them, every single one wrong. Arguably, PHP is primarily intended to be used with a database which then handles all the consistency issues for you so most people just go for that and don't have to think about the lower-level issues. But the language treats high-level interaction with a database the same way it treats low-level interaction with the file system, so there are no "here be dragons" signs that language beginners need, and my perception is that there are so many "just get something done" folks in the community and very few who really understand fundamentals, so the tendency is to do it wrong when you innocently venture into rocky territory.

And then there's PHP 5, which is basically a kitchen sink of features grabbed from both C++ and Java, and while it's impressive that they were able to get it working with that conglomeration, my spidey-sense starts tingling when someone seems to just grab all the features from everywhere rather than carefully considering each one and its overall impact on the language -- in contrast, I've watched the Python language make careful choices over the last 10+ years. Time will tell, and maybe the PHP community will figure out what to do with all those features, but I'm deeply suspicious.

In the meantime, I use PHP on my new, slowly-evolving site implementation. The key: I use it only in very small bits. For example, PHP allows you to solve the idiotic HTML problem where you can't easily include files. PHP just does it, and allows me to easily distribute my design throughout the site. And sometimes you just want to do something small and embed it in your page, and PHP is the right answer for that.

But as soon as something starts getting the slightest bit complex, I find that it's better to switch to Python for that bit. So PHP is great in small pieces, but I don't try to push it very far.

You can find a good collection of links to discussions, rants and arguments here.


Michael Foord

Posts: 13
Nickname: fuzzyman
Registered: Jan, 2006

Re: What's Cool About PHP Posted: May 26, 2008 12:24 PM
Reply to this message Reply
"For example, PHP allows you to solve the idiotic HTML problem where you can't easily include files."

Server side includes?

But why even do processing on the server at all when what you really need is just a good templating language that will generate static pages...

John Cook

Posts: 1
Nickname: johndcook
Registered: May, 2008

Re: What's Cool About PHP Posted: May 26, 2008 1:43 PM
Reply to this message Reply
I had a question about your line "just grab all the features from everywhere rather than carefully considering each one and its overall impact on the language -- which is something I've watched happen with the Python language over the last 10+ years."

Are you saying Python has carefully considered features or are you saying it has grabbed features from everywhere?

Daniel Serodio

Posts: 13
Nickname: dserodio
Registered: Apr, 2006

Re: What's Cool About PHP Posted: May 26, 2008 2:17 PM
Reply to this message Reply
> "For example, PHP allows you to solve the idiotic HTML
> problem where you can't easily include files."
>
> Server side includes?
>
> But why even do processing on the server at all when what
> you really need is just a good templating language that
> will generate static pages...

Because using PHP as he says is easier!

Bruce Eckel

Posts: 875
Nickname: beckel
Registered: Jun, 2003

Re: What's Cool About PHP Posted: May 26, 2008 5:08 PM
Reply to this message Reply
> Are you saying Python has carefully considered features or
> are you saying it has grabbed features from everywhere?

I believe the features in Python are carefully considered.

Elizabeth Wiethoff

Posts: 89
Nickname: ewiethoff
Registered: Mar, 2005

Re: What's Cool About PHP Posted: May 26, 2008 6:50 PM
Reply to this message Reply
Ditto much of the article about Javascript.

Laurynas Riliskis

Posts: 2
Nickname: carramba
Registered: May, 2008

Re: What's Cool About PHP Posted: May 27, 2008 12:21 AM
Reply to this message Reply
I thought that PHP was cool and good, before I discovered Python and Django framework. Since day one that I have started working with is one thing was clear: there is no way I will EVER use PHP without REALLY god reason. And for now I can't find one. PHP is in C age and even if they try to OO it unfortunately they haven't succeeded.

It's surprising that you even consider PHP cool after working with Turbo Gears and if I'm not mistaken Django as well, and mainly being Python friend :-)

Mauricio Castro

Posts: 1
Nickname: iserv
Registered: May, 2008

Re: What's Cool About PHP Posted: May 27, 2008 4:46 AM
Reply to this message Reply
I am not a PHP programmer, indeed, I don't know enough from the language to be able to comment it. But every time someone asks me why do I prefer Java I say: if you want something easy to use at the presentation layer, try freemarker. It is almost like PHP but protects you from having tempations to write spaghetti code...

Michael Foord

Posts: 13
Nickname: fuzzyman
Registered: Jan, 2006

Re: What's Cool About PHP Posted: May 27, 2008 7:05 AM
Reply to this message Reply
> > "For example, PHP allows you to solve the idiotic HTML
> > problem where you can't easily include files."
> >
> > Server side includes?
> >
> > But why even do processing on the server at all when
> what
> > you really need is just a good templating language that
> > will generate static pages...
>
> Because using PHP as he says is easier!

I disagree. :-)

I use rest2web (but there are plenty of alternatives) and it generates static pages, very simply and with great flexibility.

David Linsin

Posts: 9
Nickname: dlinsin
Registered: Aug, 2007

Re: What's Cool About PHP Posted: May 27, 2008 11:04 PM
Reply to this message Reply
> You can find tons of completely wrong examples of how to do
> something in PHP, written by people who are copying each
> other because no one knows what questions to ask.

So is this better e.g. with Java?

Laurynas Riliskis

Posts: 2
Nickname: carramba
Registered: May, 2008

Re: What's Cool About PHP Posted: May 28, 2008 1:07 AM
Reply to this message Reply
>So is this better e.g. with Java?

I'm not convinced that java is The language for web, but I'm sure that python frameworks are, like Turbo Gears or Django :)

sarose joe

Posts: 1
Nickname: sarosejoe
Registered: May, 2008

Re: What's Cool About PHP Posted: May 28, 2008 3:55 AM
Reply to this message Reply
Bruce

Do you think facebook, youtube, Yahoo!, SugarCRM, Flickr all are small pieces! They are all PHP powered.

I am not convinced with your naive conclusion quoting PHP as a great in small pieces. You re-think PHP and give a fresh review again..

Sarose

Antonio Cavallo

Posts: 10
Nickname: cavallo71
Registered: Mar, 2006

Re: What's Cool About PHP Posted: May 28, 2008 4:28 AM
Reply to this message Reply
The language model (reload the page and see the results) is the winning factor IMHO: easy to understand, fits perfectly in the web development model and very "interactive".

Kalle Andersson

Posts: 1
Nickname: kallex
Registered: May, 2008

Re: What's Cool About PHP Posted: May 28, 2008 5:02 AM
Reply to this message Reply
> Do you think facebook, youtube, Yahoo!, SugarCRM, Flickr all are small pieces! They are all PHP powered.

Youtube is written in Python, actually.

George Jempty

Posts: 1
Nickname: jb4mt
Registered: May, 2008

Re: What's Cool About PHP Posted: May 28, 2008 5:16 AM
Reply to this message Reply
> And then there's PHP 5, which is basically a kitchen sink of features grabbed from both C++ and Java

The above, while essentially correct, nevertheless indicates a lack of knowledge about PHP's roots. For instance, PHP4 was largely a "kitchen sink of features grabbed from Perl" (array_pop/push/shift/unshift), and PHP3 did much the same vis a vis ASP (short vs long style tags). So it should come as no surprise when PHP5 did much the same.

Flat View: This topic has 17 replies on 2 pages [ 1  2 | » ]
Topic: Metaclasses in Python 3.0 [1 of 2] Previous Topic   Next Topic Topic: Collective Stupidity

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use