You are not logged in.

#1 2008-07-01 13:03:53

Arkane
Member
From: Switzerland
Registered: 2008-02-18
Posts: 263

Why only PHP?

I've never actually tried to understand web scripting (or even learn HTML for that matter) until recently, and always thought PHP was somehow integrated into the whole HTTP server business, and a necessary part of it.

Then I learned about CGI and how you can actually use any language for server-side scripting, and now I don't understand the almost total hegemony of PHP over that area. Are there really any compelling reasons to learn and use PHP for web scripting when you already know another language that offers suitable libraries (e.g. Python)? If it's simply because you can embed it in HTML then that's a matter of writing a 20-line parser, right?

Last edited by Arkane (2008-07-01 13:09:10)


What does not kill you will hurt a lot.

Offline

#2 2008-07-01 13:14:32

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Why only PHP?

I got into PHP because everyone else uses PHP. It's like the "Windows File Format Cycle"; Everyone uses Windows file formats because everyone else uses them.

Offline

#3 2008-07-01 13:29:54

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Why only PHP?

I've never thought PHP was the only web scripting language available. In fact I kind of consider it to be outdated technology compared to Ruby on Rails and the various django frameworks.

Some common web backend/scripting languages include:
PERL (the original)
PHP
ASP
Java, in the form of JSP/Servlets
Python (using web.py, django, turbogears, Pylons, ad naseum)
Ruby (on rails)

Like you say, it can be done in any language... I actually have seen CGI scripts written in C!

I code exclusively in django and have nothing bad to say about it for medium or large projects. For small scripts I'd recommend web.py. If you know python already those will be comfortable to you, but it won't take you long to learn PHP either, its pretty easy.

Dusty

Offline

#4 2008-07-01 13:38:45

chimeric
Member
From: Munich, Germany
Registered: 2007-10-07
Posts: 254
Website

Re: Why only PHP?

Arkane wrote:

Are there really any compelling reasons to learn and use PHP for web scripting when you already know another language that offers suitable libraries (e.g. Python)?

IMHO the answer to that question is no. If you already know Python then use it. Same goes probably for Ruby or Perl, which has a long history in web development.

However, PHP is a popular choice for web development. And if used the right way it doesn't necessarily have to turn out to be a bad one. Also, setting up a LAMP stack where P stands for PHP IMHO tends to be an easier task. I think the hegemony of PHP in this area is due to the fact that you get somewhere in PHP quite fast and is has a not so steep learning curve like other languages (Python or Perl), though that of course differs from person to person. This of course also led to the vast amount of buggy/bad coded PHP software out there.

The other reason you find PHP everywhere is that it's been around for a while already (longer than Pyhon or Ruby). I think that's also important for businesses. You're probably find more seasoned experienced PHP coders out there than Python or Ruby evangelists. And if not, then just employ a C guy, he'll grasp the syntax probably in less than a week and has enough nerves to work with that language wink. Also, the fact that it's around for so long and widely supported by many hosters etc. can make it a better choice compared to the relatively young alternatives. For example, there's been a quite nasty bug discovered in Ruby on Rails [1] which basically affected all Ruby on Rails applications. This could be interpreted by a project manager as a reason to not use Ruby for a project. I know PHP is/was full of bugs, but if done right it's as "secure" as any other language, namely as secure as you make it.

But as I said, if you already know Python, then there's no point not to use it (aside from that there are not that many hosters maybe?).

And on the PHP sucks matter (this will pop up in this thread sooner or later). Yeah, it sucks, but it doesn't matter [2].

[1] http://www.matasano.com/log/1070/update … abilities/
[2] http://www.codinghorror.com/blog/archives/001119.html

Edit: Oh those typo daemons ... *sigh*

Last edited by chimeric (2008-07-01 13:40:33)

Offline

#5 2008-07-01 13:56:40

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Why only PHP?

Arkane wrote:

The other reason you find PHP everywhere is that it's been around for a while already (longer than Pyhon or Ruby).[/i]

Actually, Python was released four years earlier than PHP (1991 vs 1995). But Python wasn't originally used much in web development until three or four years ago. (I'm pretty sure both turbogears and django started in 2005). PHP was designed for web development from the start and it's only recently that people have started using it for other purposes (mind you the gtk bindings have been around for something like five years).

Dusty

Offline

#6 2008-07-01 14:06:22

chimeric
Member
From: Munich, Germany
Registered: 2007-10-07
Posts: 254
Website

Re: Why only PHP?

Dusty wrote:
Arkane wrote:

The other reason you find PHP everywhere is that it's been around for a while already (longer than Pyhon or Ruby).[/i]

Actually, Python was released four years earlier than PHP (1991 vs 1995). But Python wasn't originally used much in web development until three or four years ago. (I'm pretty sure both turbogears and django started in 2005). PHP was designed for web development from the start and it's only recently that people have started using it for other purposes (mind you the gtk bindings have been around for something like five years).

You're right of course. What I wanted to express is that PHP was longer around on the web than Python or Ruby. Of course Pyhon does have a longer history than PHP, but as you said, it's increased usage for the web happened only recently (read recently as the last 3-4 years).

Offline

#7 2008-07-07 15:32:46

angvp
Forum Fellow
From: Buenos Aires, Argentina
Registered: 2008-05-15
Posts: 32
Website

Re: Why only PHP?

Imho many webhosting companies (those all cpanel resellers) surely have php support but many of them, haven't yet python or perl support, maybe perl but not all, in fact, many of them doesn't have fully php support (i mean they still use PHP4 and old libraries).

Plus exists hundreds of app's (in windows) that install you Apache, MySQL, PHP in an easy way, unfortunately not all languages or frameworks have this support, and off course, many Adobe / Macromedia Lovers have PHP in Dream Weaver with ugliest assistants to do crap-but-working code for those all bunch of people (who sometimes they calls himselfs programmers), also Dream Weaver is WYSIWYG (what you see is what you get) and unfortunately many people on the website's world cannot live without this kind of editors.

PHP isn't a bad language, the problem is that is very easy to do things with it, then many of crappy-developers do things in a wrong way hmm.

what do you guys think about zope? or plone? (python off course).

Offline

#8 2008-07-07 15:43:09

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: Why only PHP?

PHP is like ASP, it's focused on web development from the birth. Also, it's very easy to deploy, mod_php has been around since the beggining too.

I personally hate PHP. Everyone who worked significant amount of time with it, and knows other languagens, will spot many design flaws and non-sense that are just annoying. But, sadly, I still use PHP a lot - there's simple no other thing as easy to deploy in any server than PHP.

Offline

#9 2008-07-07 16:01:08

angvp
Forum Fellow
From: Buenos Aires, Argentina
Registered: 2008-05-15
Posts: 32
Website

Re: Why only PHP?

Well i don't hate any language in particular (just Java and ASP, .NET because they sux (slower ugliest sintax and crappy)), but you can find many kind of *frameworks* in PHP (Symphony, CodeIgniter, Pronto, cakephp). PHP isn't a bad language at all, you even can do shell scripts with it! (and i think that these are ugliest) . Compared with the three languages that i mentioned before, and i know many people really believes that those 3 are powerful, what is the point of use some "powerful" if looks like ...unuseful? (java app's).

Anyway what about catalyst (perl)?

i'd like to read different opinions, and usually this kind of threads finish in a holy war, PHP vs PERL vs Python, yikes i hope this won't be the case :-).

Offline

#10 2008-07-11 15:59:27

Shadow.Geek
Member
Registered: 2008-07-11
Posts: 2

Re: Why only PHP?

Are there really any compelling reasons to learn and use PHP for web scripting

Well,PHP was intended to be a web scripting language but can also be used as a programming language for developing GUI apps,with GTK for example,and it was one of the first web scripting language,and as the development of PHP went along,it's resources grew,and it became a widely used language,and there is a lot of books about PHP and MySQL ,so people tend to use it more..but I do agree that using another language that you know ,with CGI is not a bad thing at all..And comparing languages for web development like PHP-ASP-JSP-ROR,i prefer LSP,Lua Server Pages,maybe not very popular but i find it to be very good and faster than PHP.

Offline

#11 2008-07-11 23:41:15

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Why only PHP?

Offline

#12 2008-07-11 23:53:32

brynjolf
Member
From: Sweden
Registered: 2008-05-25
Posts: 63

Re: Why only PHP?

All of these Rails clones, are they any good or should I just try to learn Rails?


Cerebral: "Welcome to the distro.  You'll never leave.  Mwahaha"

Offline

#13 2008-07-12 11:14:24

Shadow.Geek
Member
Registered: 2008-07-11
Posts: 2

Re: Why only PHP?

All of these Rails clones, are they any good or should I just try to learn Rails?

Ruby on Rails is a good choice,but I also like Groovy on Rails(maybe not very popular)but very good,so it's up to you after all.

Offline

#14 2008-07-12 12:52:49

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Offline

#15 2008-07-17 01:49:02

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Why only PHP?

Dusty wrote:

Check the copyright line on this baby: http://www.prontoproject.com/

I doubt many here even know who Judd is. We are a fading generation brotha..
By the way, how did you manage to muster together another 2.5K f'ing posts since I last saw you?
Oh... thats right... posts just like these.

HIJACK!
 
  \\//_

Offline

#16 2008-07-17 08:06:39

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: Why only PHP?

T-Dawg wrote:

I doubt many here even know who Judd is. We are a fading generation brotha..

How can someone not know who Judd is? He shows up when booting

archangel $ grep Judd /etc/rc.sysinit
printhl "Copyright 2002-2007 Judd Vinet"

Offline

#17 2008-07-21 02:20:25

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: Why only PHP?

I said it myself once, learned that it was quoted somewhere, and will say it again: PHP is the BASIC of the Web era.

* It's easy to learn, deploy and configure,
* It's fast - very fast, and
* It has excellent networking and string processing capabilities.

You can do almost anything in PHP, from
* The basics: creating basic websites with a decent level of interaction, to
* The mildly involved: I've written quite a few IRC-related things using PHP, my biggest being a 2k line IRC library (which I badly need to do some reworking on, removing 500 of those lines or so), to
* The insane - I managed to make PHP emulate a web browser to the extent that Google Apps believed PHP was a proper browser so it let PHP login to my Google Apps account without me ever having to enter a password. I incidentally never did manage to get "real" GMail working however sad

I also plan to do a few quite interesting thing with PHP, all summing up to a rather large CMS that will be of entirely custom design, integrating IRC, data services and AJAX with a few features/ideas I've come up with over the months to create a rich, responsive Web experience. I've been figuring out how to design it for... eons tongue But PHP, as I can see it, will fit/foot the bill very nicely.

-dav7

Last edited by dav7 (2008-07-21 02:22:47)


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#18 2008-07-23 13:45:02

Bison
Member
From: Jacksonville, FL
Registered: 2006-04-12
Posts: 158
Website

Re: Why only PHP?

Ruby on Rails is by far the best and most complete web framework I have tried so far.

For web programming, just use whatever you like the most.  If there aren't application servers for them, then just write them yourself - its really easy

Offline

#19 2008-07-23 15:17:17

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: Why only PHP?

Dusty wrote:

Check the copyright line on this baby: http://www.prontoproject.com/

Looks very interesting. The author helps giving credibility too big_smile

I'll look this, currently I'm using CakePHP framework for PHP stuff (also Joomla, but it's CMS).

Offline

#20 2008-07-23 16:01:06

kensai
Member
From: Puerto Rico
Registered: 2005-06-03
Posts: 2,484
Website

Re: Why only PHP?

Dusty wrote:

Check the copyright line on this baby: http://www.prontoproject.com/

Hm, thanks for reminding me, that is indeed an interesting project by Judd.


Follow me in: Identi.ca, Twitter, Google+

Offline

Board footer

Powered by FluxBB