Page 1 of 2
Why Use PHP
Posted: Wed Jun 25, 2008 12:16 am
by prasanthi
How would you compare working in PHP with working in ColdFusion?
Re: Why Use PHP
Posted: Wed Jun 25, 2008 2:46 am
by onion2k
About a million times better.
Re: Why Use PHP
Posted: Wed Jun 25, 2008 12:06 pm
by alex.barylski
I think the race has come down to PHP and ASP -- ColdFusion has fallen off the face of the earth in terms of web development. Perl has also gone the way of the dinosuar for web development, probably keeping some popularity with shell scripting though.
PHP has a massive community, not just here, but sitepoint, phpfreaks and just about any other forum which disscusses web development. An almost unlimited number of open source projects covering every problem area you can think of.
PHP just makes sense.
Re: Why Use PHP
Posted: Wed Jun 25, 2008 2:35 pm
by JAB Creations
prasanthi wrote:How would you compare working in PHP with working in ColdFusion?
To me you might as well ask me why use toilet paper?
*edit* I didn't really read the part about Cold Fusion...but Myspace comes to mind so I don't feel so bad for some reason now.

Re: Why Use PHP
Posted: Wed Jun 25, 2008 3:12 pm
by Eran
Why use PHP:
It's open source (re: free!) and has a
great community.
It's a constantly improving language with pretty good OO implementation.
It's relatively unobtrusive (re: opposite of ASP)
It's a proven scalable solution
It's C syntax style (if you like that sort of thing)
It was built for the web and has many web specific features
And simply cause I like it!

Re: Why Use PHP
Posted: Wed Jun 25, 2008 4:43 pm
by Ollie Saunders
I think the race has come down to PHP and ASP
PHP, Java (such as JSP) and ASP.NET are all in wide use. Rails for Ruby and Django for Python are increasing in popularity and superior to the previous three in my opinion.
If you're a deviant you might want to try Seaside for Smalltalk or YAWS for Erlang.
Re: Why Use PHP
Posted: Wed Jun 25, 2008 4:50 pm
by alex.barylski
I choose PHP because of it's openess and it's syntax being similar to Perl and C/C++ -- those were major benefits for me as I had long since developed the habit of adding that semi-colon to represent end of statement.

Re: Why Use PHP
Posted: Wed Jun 25, 2008 6:10 pm
by Ollie Saunders
I don't buy the "I love C syntax" thing.
C syntax was good for C.
One of the greatest things about Ruby is it's syntax.
I think you're underselling yourself if you think you can't get used to a new syntax. And having or not having to write a semi-colon at the end of every line is not any kind of indication of the quality of a language.
Re: Why Use PHP
Posted: Wed Jun 25, 2008 6:15 pm
by Eran
What's wrong with liking a particular syntax? you obviously like Ruby, so why can't it be PHP (C) syntax for others?
Re: Why Use PHP
Posted: Thu Jun 26, 2008 2:11 am
by taramichael
Hi Prasanthi,
Why are you comparing?
Re: Why Use PHP
Posted: Thu Jun 26, 2008 1:21 pm
by Ollie Saunders
pytrin wrote:What's wrong with liking a particular syntax? you obviously like Ruby, so why can't it be PHP (C) syntax for others?
A lot of programmers, even good ones, get caught in a mind trap where they can only see one way of doing things. It's concerning when people dismiss things they haven't given a proper chance. What can I call that but closed-mindedness?
Re: Why Use PHP
Posted: Thu Jun 26, 2008 1:33 pm
by Kieran Huggins
Ruby is sexy. But so is JavaScript... But so is....
The bottom line: the language doesn't matter as much as you think it does. The more you know about other languages the better you'll be at all of them.
Re: Why Use PHP
Posted: Thu Jun 26, 2008 9:51 pm
by jack_indigo
Step 1. Write stuff in PHP.
Step 2. Optimize DB.
Step 3. If DB won't speed up, web farm front-end for performance boost.
Step 4. If that won't help, switch MySQL to PostgreSQL because it scales better.
Step 5. Rewite the slow parts of the app even better.
Step 6. Rewite the slow parts of the app in C and load them into PHP.
That path is not too hard to do.
Why use PHP?
- Widespread adoption -- community is more vast than other communities.
- Nicer people? :drunk:
- Easier to get developers than, say, Ruby or Python.
- It just works.
- You can focus on the app logic, not fight with the language.
- Dynamic Typing (Duck Typing) over Static Typing.
- Huuuuuge set of add-ins either written in C (PECL) or PHP (Pear, sitescripts.com, etc.)
- Can still integrate components from your favorite language if you absolutely want that.
- Have libraries or there are scripts on the net that basically cover every angle for it.
- It's not owned/run by Sun or Microsoft or IBM and the community is more democratic.
Re: Why Use PHP
Posted: Fri Jun 27, 2008 12:50 am
by toasty2
My Points:
- The manual - PHP has the best one I've ever seen
- Popularity
Re: Why Use PHP
Posted: Fri Jun 27, 2008 1:16 am
by Ollie Saunders
- Widespread adoption -- community is more vast than other communities.
- Easier to get developers than, say, Ruby or Python.
If you are considering which language to *learn* (and I guess that's where the OP is coming from) you have to predict a bit. PHP has superb community right now but in a year's time you have to consider how that might change especially in relation to others.
- Nicer people?

Nicer than what?
- It just works.
Yep, it's true. PHP is certainly a lot simplier than ASP or Java and if you've played with C a bit before it'll definitely have the lowest barrier to entry - you'll already know some of the functions. This is helped further by how widely deployed PHP is on servers. That's how I got into it.
- You can focus on the app logic, not fight with the language.
Better than Java absolutely but there's definite fighting going on when you start to do stuff at a bigger scale such as the lack of mixins, writing endless setters and getters and very limited runtime extension of objects. Also I find the syntax pretty inefficient. Consider:
and in ruby:
I'm starting to bang on about that now.
- Dynamic Typing (Duck Typing) over Static Typing.
Which is an interesting point because the presences of type hinting, interfaces and in future typed return values would imply that PHP is very class oriented. Although there's definitely more freedom than Java, which is like a straight-jacket, I still think this could be improved.
- Huuuuuge set of add-ins either written in C (PECL) or PHP (Pear, sitescripts.com, etc.)
I can't stand the PEAR system and most of the contributed code in it and the closed nature of it. I think those things have really held PHP back as a language. Also the lack of namespacing, decent dependency management and issues with file inclusion (potenially PHAR solves that, is anyone using that?) make libraries difficult to use and write.
- Can still integrate components from your favorite language if you absolutely want that.
What do you mean by this?
- Have libraries or there are scripts on the net that basically cover every angle for it.
Yep, and they are usually badly written. There are numerous published books on PHP choc full of security vulnerabilities.
- It's not owned/run by Sun or Microsoft or IBM and the community is more democratic.
Yeah this is undoubtedly a good thing but this is by no means unique to PHP.
- The manual - PHP has the best one I've ever seen
Oh yes! This is probably one of the single greatest things about PHP.