A Decade of PHP
digidave writes "It was slow to catch and a lot of people didn't get it. A lot of people still don't get it, but you can't argue with its success. June 8th, 2005 marks the tenth anniversary of PHP. Here's to ten more wonderful and exciting years."
Congrats to the PHP development team! PHP has long followed the KISS principle while still maintaining the Unix APIs that we've all learned to know and love. While it's not the best web scripting platform for all purposes, it is a free and flexible alternative for many, many dynamic webpage projects. It's only because of PHP that so many OSS web applications have been allowed to exist.
:-)
It was slow to catch and a lot of people didn't get it.
Ok, I'm with the slow-to-catch-on part, but what's this about people not getting it? The concept had to be one of the simplest ever designed. (Thus the reason why it's so common across web scripting languages.) Here is your HTML, here's a bit of Unix scripting langauge. Simple, see?
On a slightly different topic, one wishlist item that I would like to see in PHP is Abstract Database Access. It's not really a good thing to hard code your application to a specific database, especially if it's a redistributable application. (e.g. PHPBB) The ODBC calls sort of solve this, but they do require that ODBC is installed, properly configured, and compiled into your copy of PHP. (Does anyone know if any distros now have ODBC as a "standard" library?) This assumption can't be made for most OSS applications, so they tend to tell you to just use MySQL.
Javascript + Nintendo DSi = DSiCade
Seriously, honest question. What's not to get about a language? It's just another language with different options, styles, formats, and uses...
-Jesse
Nothing says "unprofessional job" like wrinkles in your duct tape.
What is so exciting about it? I can't find a single situation where it is better to use PHP than other programming languages. Why would anyone love PHP?
I've made my living for the past 3 years as an independent PHP developer. I don't care what anybody thinks of PHP, it makes me money to live.
Meh.
Yes, that simple thing which is overused for learning and coding pratices. In the times when you are have to look for good perl manual, PHP manual from the very begining was perfect. That's it. And second best thing came when they added those comments for user experience.
:)
So, in any way, PHP is such thing which just works.
Congrats!
user@ubuntubox:~$ stfu This server is going down for shutdown NOW!
PHP/FI 1.0 wasn't really a scripting language, it was more like a big perl (or was it C?) script that would put some variables in a html page. Not really that useful but a nice idea. :)
I discovered and started using PHP by the time the first beta of PHP 2.0 had been released. What a pleasure this was to convert my old clunky C CGI scripts to PHP. No more compiling, no more mallocs. Weee
7 years (I think, maybe it's 6) later I'm still using PHP for everything at work, and I certainly don't plan to use anything else (not that I could if I wanted, rewriting everything would take a few years...).
Congrats to the PHP Team, and thanks !
but procedural is a valid way to structure your apps... especially for web-based ones where that have, by nature, a page-based model and a very linear flow. you can write serious software using php4 without oop!
2 1337 4 u!
The key point you're missing is that PHP doesn't have a rigid OO structure, which is why it's popular, especially for web scripting. People don't want rigid structures if they just want to throw a page together. It also is integrated well with Apache and uses similar control functions to C/C++, so programmers can switch between the languages easily.
You have two hands and one brain, so always code twice as much as you think!
I think it is obvious why PHP has become so popular:
1. It is very easy to learn
2. It is easy to use (unlike ASP.NET) and relatively simple
3. The syntax is derived from C and perl
4. It is free
Let's hope that in the future the PHP developers can come up with some ways to make the code produced by PHP developers more secure.
One of the huge problems with PHP is the massive number of XSS and SQL injection vulns present in code. Partially because PHP is used by beginners, but mainly because PHP does not help the developer write secure code. It's fast and easy to write, but allows you to shoot yourself in the foot. Just like C. See this paper on precise tainting for an example solution to the problems. It would break compatibility with most software written in PHP, but that's not neccessarily a bad thing when most of it is insecure trash.
Much easier than the crusty old languages of the past like Perl or God forbid Python.
It's really easy for anyone to get up and running with PHP.
The only potential issue is that virtually zero hosts actually enable any of the safe mode stuff (Note I'm not bothered by register_globals; way overhyped problem).
Aha, I was looking for a worse language than PHP and I think we've found it. ColdFusion! How could I forget about that nugget of programming fools' gold ;-)
I would agree that PHP makes a decent web scripting language for basic tasks (polls, counter, guest book, a bit of remote inclusion), but I am horrified to see people actually using it for serious stuff like enterprise level systems. That sort of stuff makes the blood freeze. I feel really sorry for the corporations who get sucked into it.
I support the idea of database independence.
But it should be done by using standard SQL.
Unfortunately, that is not a losing battle, it is a lost battle.
The database vendors doesn't care about standard SQL.
The Internet is full. Go Away!!!
But on the toher hand, PHP isn't really ciplled in any way, is it? Sure the function names are varying, but that can be fixed eventually. It's just easy to do things right there on the spot, instead of doing it really elegantly, but if you force yourself to do things the right way, wouldn't PHP be as good as any other option?
True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
I agree with the simple inconsistencies. What annoyts -- no, frustrates -- me most is that the functions that have a string and an array for an argument is that sometimes the array comes first, and sometimes the other argument comes first. I hate it.
Computers are useless. They can only give you answers.
-- Pablo Picasso
The lack of rigid structure and thowing a page together are the very things make PHP a potentially dangerous language. When in the right hands PHP is a good tool. However, it does allow for sloppy work.
UNIX/Linux Consulting
PHP is an abomination.
It was very clever and very handy when it was first developed, but there are many much better systems for building web pages available today.
Its object-oriented features are kludgy, its syntax is a throwback to C, and it in a realm where string handling is ubiquitous, it provides you with such great functions as strtok() and strncmp(). I mean come on, haven't we evolved just a bit past using the C standard library for string handling in our freaking web applications?
Personal Home Pages is fine for whipping up a quick data-driven website, but if you want to build a large application it's crap.
isn't language bigotry a pretty old joke by now
You're one of those people who don't get it. This is not a language issue. In the not-so-distant future, developers will think it crazy not to use an MVC web framework for their web applications.
Ruby on Rails just happens to be first with an elegant, easy-to-use, true-separation-of-concerns, MVC web application platform.
The Java, Python, and Perl (Catalyst) folks have seen the light and are busy working on Rails-style frameworks. Seems like the PHP community hasn't seen the need yet.
bp
Lucky for you there is a centralized, annotated, comprehensive, searchable, accessable by web services manual and a centralized repository of standard classes.
People underestimate the power of those two things. CPAN is the number one reason why PERL is still so popular.
evil is as evil does
quoth Frymaster, "procedural is a valid way to structure your apps... especially for web-based ones where that have, by nature, a page-based model"
This is my basic gripe with PHP. It leads the unfortunate user down a path that suggests that each page is its own island, and any attempt to modularize or componentize that is, by PHP's nature, a secondary affair.
Take, as a counterpoint, something like TTK. Here, you are presented with a programming langauge in which you write your code, and a templating system in which you write pages for display and a set of tools for connecting the two.
It's not that a good programmer can't produce a workable system in PHP alone or PHP + other langauges (PHP backed by Perl or Java or C# is quite powerful, in fact), it's just that it seems that the majority of people writing PHP are hobbled by this unfortunate presentation of the language as a "page generator", and thus most of the code written in PHP is rewrite-fodder from day one.
As a templating system, PHP is quite nice, and I'd use it where appropriate.
The fact you are using a Computer Science degree to back up your argument is telling. A Software Engineering would be useful, maybe, but a CS degree does not demonstrate you learned to develop enterprise level applications as this is not a focus of CS, as has been discussed many times in the "Shall I get a CS degree?" Ask Slashdot threads.
I'm sure you are developing fine enterprise level PHP apps, but I can also crack open a Mac Mini with a fish slice. It doesn't demonstrate it's one of the best tools for the job, even if it does work. (This is why most low-level systems software is written in C, despite there being plenty of arguments that there's "nothing wrong" in using others.)
And, yes, you're right, it's elitism. I'm elitist to the point where I feel that using any sub-par tool that's not suited to the task is not a wise long-term strategy. But, well, thanks for expressing that in some situations it seems to work.
I consider this a good thing. The RoR community is of a decent size where development is moving on at a steady pace and documentation is, mostly, plentiful.. but not big enough that you're flooded with thousands of third-world developers coding at 10 cents a line. Not that the third-world developers are a particular problem.. people who think they can code in the West are also a major problem as they tend to quote peanuts and end up costing their customers big time.
Database abstraction is a frustration of mine.
Say, for example a "real" DBA writes a shopping cart schema / application, using a "genuine" (ACID-compliant) DB, the scalability will be phenomenal; The speed will be incredible because much of the code will be handed TO the database -- not parsed and parsed and parsed away at the PHP/Java/whatever-script level.
Now, let's say a "wannabe" DBA writes a shopping cart schema / application using MySQL. Then to "help" the Postgres folks out, the DBA adds an abstration layer. Woo hoo!!! Useless... Essentially, I'm offered a way to drive a Ferari (Postgres) down the sidewalk, negotiating with pedestrians all day, as if I were traveling by skateboard (MySQL).
Unfortunately, the number of examples of the later are a dime a dozen. The number of examples of the former are near zero. Think about why you'd even WANT abstraction. In most real-world cases it's rather useless and undesireable.
I, too, have PHP to thank for a wonderful career. While I know that PHP is not the best language for the massive applications I've done, PHP developers are relatively easy to find and train. That is a major marketing factor for companies. Rails is great but how many (available!) workers are there? Very few. Same with Python. PHP can be very powerful when done right. The last major system I wrote with it included a call center (using the wonderful company Voxeo for hosting) that dropped right into the CRM and loan processing software. The current system includes a self-running tiered hosting system (Bind 9, Apache 2, PHP 5.1-dev, PGSQL 8); the daemons (written in PHP) detect server load and move sites accordingly to other slaves.
umm. no-one said RoR is the first MVC framework. Its just the first one that's made for humans.
I've been developing website backends in PHP for 3 years, and large enterprise-scale apps for the past 1 year. It's a common misconception that PHP isn't appropriate for large applications.
It's all in how you use it. Do you hack together a bunch of pages with isolated scripts talking to html forms and databases in an ad-hoc manner? Or did you start with a solid application design model from the start and follow through with time-tested methodologies?
PHP gets a bad rep because of the large number of inexperienced developers using it with poor results. I've developed full CRM and ERP apps with it including invoicing and ticketing systems that scale beautifully and are a dream to maintain. PHP is fast, free, and easy to use.
It's the responsibility of the developers to use more mature practices when developing large apps- and to recognize the fact that small site admin areas often evolve into larger apps. Plan and design!
You know, I heard the same thing about Java back in 1996 or so.
Don't get me wrong, Rails looks decent enough, but neither is it a panacea. You can put together a really fast RSS reader, or a DB-backed recipe application, but these are trivial applications. Solving trivial problems elegantly isn't worthless, but thus far I haven't seen any Rails projects that compare in scope to something like Zope, or Drupal or even PHPBB.
Going through the various How-Tos for Rails, I keep saying to myself, "...or, I could just download foo, which is written in Perl/PHP/Python/AWK, but already works and is proven and does the same thing." PHP hasn't seen the need for copying Rails because they have a robust and featureful set of applications already. Dropping everything and chasing the next sexy thing might be entertaining, but it doesn't do much to help me, the working Webmaster.
I guess I'm just suspicious of using MVC (or OOP, or some other trendy buzzword) as a talisman. It smacks of cheerleading, and accusing people of "not getting it" doesn't prove the point.
Potato chips are a by-yourself food.
Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks.
Hope that helps.
For a start, PHP functions seem to have no consistency at all. Sometimes you get verb/object, sometimes object/verb. Sometimes you get underscores, sometimes you don't. Consider.. is_object but isset. str_rot13 but strpos. php_uname but phpversion. There are hundreds of these. It's the reason I could never learn PHP, it's like learning Chinese, but I found Perl (and now Ruby) easy due to their relative consistency. Sometimes PHP uses "to", sometimes it uses "2".. huh what's that about?
Most of the functions in the PHP distribution are named after a function that does the same thing in the C library that PHP uses to implement the feature. PHP is designed so that if you're familiar with the C library that it is using, you can very easily get the hang of the PHP version.
This doesn't excuse some of the weirdnesses in the core library, though -- str_rot13 (and the other string functions with underscores in them) is clearly wrong, as the earliest string functions followed the standard C library naming conventions.
To address your other examples: isset() is an operator that looks syntactically like a function, and would have been named in this fashion to mirror the other such operators (sizeof(), unset()). is_object() et al are functions that were implemented independently of this, and at the time there was no conflict. I see no excuse for the php_uname/phpversion difference.
PHP has thousands of core functions.. nuts! And why does PHP have such a bizarre lack of abstraction? PHP often has about 10 functions compared to other languages' single function.. with each of the 10 doing a slightly different thing. When it comes to being overly wordy and inconsistent, I doubt anything can beat PHP, but, well, I'd like to see someone bring up a language that is!
I don't like to nitpick, but... those aren't all core functions. They're just functions that are distributed with the core, kind of like the applications that come with a Linux distribution. You can build a stripped down PHP without them, if you want.
"you can use Perl's regular expressions in PHP."
Nope. You can't. Well, you can. Well, sortof. Sometimes. With some syntactical exceptions, and lots of thinking about escape sequences, and passing parameters a different way. And that's the gotcha. You start thinking it's going to be the same -- and it's not.
Tweet, tweet.