A Conversation for The H2G2 Programmers' Corner

Why should I learn PHP

Post 1

Rat, who can't remember his way round this bloody thing.

Lots of people keep telling me I should learn PHP but none of them can give me a good reason why.

A typical conversation goes along the lines of:

"Why should I learn PHP?"

"It's better than Perl"

"Why?"

"It just is, and its easier"

"But I already know perl, so perl is, by definition, easier for me"

"It's more powerful"

"In what way?"

"In every way!"

You get the idea. The question is, should I learn PHP and if so, why?

I'd only need it for my own sites which are hosted on a rather nice dual xeon server, so resources arent an issue...is there any good reason why I should change from Perl to PHP?


Why should I learn PHP

Post 2

Wiro

"is there any good reason why I should change from Perl to PHP?"

No, I don't think you should change.

A more sensible thing to do would be to learn php and use both php and perl as you see fit.


A good reason to learn php is that alot of people use it now, so if you want to take a look at how somebody has done something, you know what you are looking at.


So basically, you should learn it for the geekiness factor of knowing an extra language. Personally, I just know php, I havn't used perl as yet, I think it would be a cool idea, yet I havn't had the impetus to actully go do it.


Why should I learn PHP

Post 3

Peet (the Pedantic Punctuation Policeman, Muse of Lateral Programming Ideas, Eggcups-Spurtle-and-Spoonswinner, BBC Cheese Namer & Zaphodista)

And after you've learnt PHP you should go back in time a little and learn Python. (I haven't yet, but I'm just about to! smiley - geek)

The thing is, you never know when one specific language will come in handy. Up until six months ago I just thought of Python as an obsolete scripting language replaced by PHP and Perl, but then I got into "Blender" for 3D graphics. Well, whaddya know? It's got a Python interpreter built-in! You can script your own surface renderers, write complex "camera moves" etc., etc.smiley - artist

So, I'm going to spend this winter learning Python. smiley - smiley

Another good reason for learning a number of different languages is that it helps you to look at a given problem more clearly; you can more easily seperate the aspects of solving the problem from the aspects of implementing it. I learned "Forth" about twenty years ago, and while I loved it I haven't actually written anything in it in, well, nearly twenty years. smiley - blush But, I was trying to solve a tricky problem in a PHP script, and I was able to eliminate several loops and SQL queries by implementing a simple stack; it turned out that pushing and popping thread addresses on this stack (I'm working on a message board project) was by far the simplest way to achieve the thread ordering I needed, yet had I not been exposed to Forth the idea would never have crossed my mind.


Key: Complain about this post

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more