Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the overall design philosophy of php? [closed]

I recently had my first encounter with PHP (5) through a Drupal application for a client. There was certainly nothing difficult about the experience (documentation is good for instance), but I never had a moment where I thought, "that's really clever!", or "wow this is fun to use!" Moreover, I couldn't accurately predict how functions were going to be named, or ascertain a guiding principle to follow.

This is in contrast to Ruby, for instance, where everything is an object, methods are predictable and pseudo-polymorphic, and blocks are a joy to use (to name a few examples). Other language highlights for contrast: Python's list comprehensions change the way you think about iteration, C brings you back to the hardware with it's pointers and bit operations, javascript is surprisingly wonderful with its nameless functions and advanced suppport for hashes, and even SQL in its crustiness forces you to appreciate your data and think about it relationally.

So with that in mind, what are the highlights of php? And what is the overall design philosophy of the language? I know php doesn't enjoy a great reputation overall, but I've always heard that that was a perception problem due to the large amount of non-professional developers banging out copy and paste code.

EDIT:

Alright, so the consensus is that PHP is the monkey-wrench of web programmers. I can accept that. I was just looking for a insight, but I guess I already had it. I certainly do appreciate mod_php/libphp for instance. And I was able to get my application out the door in two weeks with no prior php experience, so I guess that also speaks for itself.

Thanks for the posts.

like image 568
guns Avatar asked Mar 12 '09 20:03

guns


1 Answers

From the php web site:

PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.

In other words, there isn't really a design philosophy: It's a mix and mash of ideas to get a job done (obviously inherited from Perl, hehe).

like image 60
Jeremy L Avatar answered Oct 07 '22 16:10

Jeremy L