Cal's Blog
![]() |
Cal Evans Director of PCE |
| Cal Evans is the Director of the PHP Center for Expertise at Ibuildings. He has been involved in IT development and management for the past 26 years and for the past 9 has developed primarily in PHP and MySQL. Cal is the author of a book and many articles on PHP development and can regularly be seen speaking at PHP conferences around the world. Cal blogs regularly at http://blog.calevans.com |
Tuesday, May 5. 2009PHP is NOWComments
Display comments as
(Linear | Threaded)
Great article Cal. It would be cool if a good enterprise IT journal picked this up.
I don't get why you say that... Your website runs PHP software and talks about it. You're dealing with PHP each day of your life and you poo on it... Why don't consider switching to another server-side programming language, such as Ruby, Python or .NET?
Maybe my english is too poor and I didn't get the right sense of your comment...?
Well Cal, this is exactly what it is all about, PHP has too many things already done with it that the "others" would simply be dumb to ignore.
So many companies started to "support" PHP, not because of how such clean programming language it is, how modern, advanced, easy, readable, who has real programming language features ... Every other company should NOT use PHP as it is a plain dirty, unprofessional, repeat dirty (SLOW WHEN TRYING NOT TO BE DIRTY), antique programming environment. From that Mac-vs-PC ad, PHP is for sure the PC(i don't care about who Mac, as long as it is not PHP). PHP IS GOOD FOR: 1) REUSE EXISTING APPLICATIONS (but don't alter functionality) 2) HACK THE HELL OUT SMTH,ANYTH PHP IS NO GOOD: 1) cannot do clean programming 2) cannot do clean/logical OOP programming(things don't work as expected, unexpected things work) 3) native utf support 4) legacy syntax (no syntax changes whatsoever, any change can slow it by 40% ... grrrr) 5) SLOW (PHP is slow, for a serious application, not for a-la-twitters) 6) 10000 global functions with no parameter order logic. 7) ugly, dirty code feeling all the time 9) and the list goes on ... But these are just frustration of a PHP frustrated guy, your company should go the way it gets its results, you can use even BASIC or LOGO if that is what makes you happy and gives you food. (PS: i do not recommend any other language/platform) SO, TO CONCLUDE, PHP IS BEING THE CHOICE OF SO MANY MAJOR COMPANIES BECAUSE JUST OF ONE REASON: "The humongous number of already done applications." How could you ask people to use IIS if it wont support Drupal and your company's site is on Drupal ?
Thats right - all those humoungous no of apps got done with a no-good language. Its amazing to think of all those thousands of dumb developers out there who chose php for those apps...
Get a life son.
YES YES YES,
They are done with a no good language, there is the principle of inertia that can be applied in software also. The only things that drag PHP forward are software inertia and easiness of deployment(caused also by inertia of its server stack)
Nice rant.
Crap is everywhere, not just in PHP software. (At least so I was told by java colleagues.) Frameworks like Zend allow for solid application design. Of course everyone is free to compare legacy PHP software with modern Java or .NET (you know, 'true' OOP) software.
Hi Longion,
Thanks for taking the time to comment. You address so many points it's really hard to know where to start. Your first statement about support doesn’t really draw a conclusion, or end for that matter, so I can’t really comment on it. Let’s pick up where you call PHP dirty. I assume that you are a programmer of some experience because you take PHP to task. While it is true that PHP, unlike almost any other programming language, was not designed but rather grew organically, what you are deriding as a weakness, most of us consider strength. PHP is a living, breathing entity that changes over time. Do the core developers get it right every time; of course not. However, they do get it right over time. Because PHP has a committed group of developers working on it, we have a large and varied language. There are extensions for just about every technology you can care to mention. Because we do not have to wait for corporate approval, PHP is fast to respond when new technologies are released. Internally, the PHP code base is constantly being extended but also being groomed. Each release of PHP shows improvements and while some may gripe as features are removed from the core, others rejoice for the very same reason. You mention that PHP is slow but outside of any context. As I mentioned in the article, the old favorites, dig, facebook, yahoo, all use PHP as their glue language. I cite these examples to refute your claim that it is slow. If you wish to provide a bit more context, maybe we can discuss the exact issues you are seeing with speed and can either find a solution to your problem or start a discussion with the core developers on how this area can be improved. That is another strength of PHP. If you participate in the community for any length of time, you will get to know the core developers personally and realize that not only are most of them nice people but that they are actually interested in helping. I challenge you to find another language where you can hold an open and frank discussion with the gate keepers. Your list of things that PHP is good for and not good for is where your comment starts to degrade into name calling. As I said earlier, it is obvious you are an experienced developer, as am I. Having worked with different programming languages throughout my career, I feel I have a broad enough range of experience to refute most of your claims. It is entirely possible to write “clean” code in PHP, unless your definition of clean is, “it must look like Java”. It is actually very easy to write both procedure and OO code in PHP. If things don’t work the way you expect them too, I suggest you review the manual as they do work as described. If you mean they don’t work the way you expect them too because your background is not in PHP, well, of course. Any language has a learning curve and transitioning from one to another is sometimes more difficult because of pre-conceived notions of “how things should work”. Native UTF support is one area where you and I agree. Actually, you would be hard pressed to find a professional PHP programmer who doesn’t agree with us. In this case, it is a known issue that is actively being worked on by some very bright people. It is not an easy task I am told and no, it won’t be here tomorrow, but as a community, we recognize that it is a shortcoming and are working to correct it. I can only assume by legacy syntax that you mean that PHP allows developers to choose procedural over OO programming, unlike other OO only languages. I doubt seriously that PHP will ever be as OO as Java but honestly, that is one of the reasons that caused me to switch from Java. PHP does not pretend that it knows the best way for you to do what you need to do. I’ve written five line scripts that solve an immediate problem and get thrown away when complete. Yes, I could do that with a pure OO language but not in five lines and not in five minutes. On the other hand, when building serious applications, I can use the same tools to implement a clean OO and usually MVC based application that is not only easy to read but easy for the next developer coming behind me to extend. The power of this choice is one of the great strengths and great weaknesses of PHP. The power to write code your own way can abused. There is a lot of ugly code out there written in PHP. The easy answer is, don’t use it. I won’t get into to defending or abusing any single package written in PHP, I will only say that if you don’t like the code, don’t deploy it, or better yet, get involved in the project and instead of simply ranting about how bad it is, help fix it. Since again, you leave out the context of “serious” application in your “PHP is Slow” statement, I’ll again point you to digg, yahoo and facebook and say that these are all serious applications using PHP that are not slow. If however, by serious you mean “enterprise scale, transactional applications” then I would have to point you towards companies like Fiat, Ladbrokes and The BBC, all of which are using PHP in their back office operations. If you want PHP to be slow, yes, it can be slow. However, if you want PHP to be fast, there are things you can do – both external to your application and internal – that can improve its performance dramatically. I feel at this point in your comment, you are degrading into simple name calling and not interested in a serious discussion any more. I am more than happy to discuss real issues with people but lose interest quickly when the other side confuses school yard taunts with clever banter. I will instead, skip to the end and discuss your conclusion. It is true that a lot of companies that use PHP are not making a conscious decision to deploy PHP but have found a software package that meets their needs and are deploying that. I put it to you, how is this different than the majority of shops that use Java, or Oracle, or .NET? Software developer shops like Ibuildings choose our technologies. When we were starting out, our founders examined the universe of possibilities and selected PHP. We have the option at any time to re-tool and select a different language. However, companies that are not in the business of software development usually choose applications, not technologies. I have been on almost every rung of the corporate ladder in a wide variety of companies and industries. It is only in development companies that the question of language and even platform is at the forefront. When working at companies that delivered a non-IT product, technology decisions are made on the basis of “Can it do what I need”. So I agree with you whole heartedly that many company deploy PHP because they want to use ones of the solutions that is built on it and I ask you “so what?” However, you seem to either not know about or openly ignore companies that are large enough to build out their own IT infrastructure that choose PHP. My favorite example has been mentioned above, the BBC. The BBC is a customer of Ibuildings. They did not deploy PHP so that they could use an existing application, they had a project that needed to be built and after carefully considering all the options, selected PHP as the best solution. You are free to disagree with them on their choice but you are doing so at a serious disadvantage. Since you have no insight into their problem, infrastructure, available resources and the host of other factors that come into play in a decision of that magnitude, you run the risk of being seen as someone who opposes PHP…just because. So, in some cases, yes, companies deploy PHP to get the solution that best fits their needs. In other cases though, and from what we are seeing at Ibuildings, an ever increasing number of cases, companies are weighing all their options and selecting PHP as the best of breed tool for their specific needs. Again, thank you for your comment. Sincerely, =C=
I didn't get the part with name calling(not being an native english speaker?)
I raise my hat in front of you, I AM ABSOLUTELY SURE there are good PHP developers and write good looking/manageable code and most of the things you said above are correct (regarding unexpected/expected i was refering to string functions, pdo methods and some more that come in my mind... aa .. i am sure you know about everything i said, if you put aside php-love for a few moments) As Mr.Billy-G(ates) said: PC guy is the one grandma loves. Remember, i noticed the reader here that these are frustrations of a frustrated guy, ME beeing that one (not solely because of PHP's fault) I do 90% of my daily job in PHP and i seriously consider that PHP core people should be more open to new language features (the old key/value arguments to functions, new array syntax, yaddi-yadda) and also the need to start a cleanup process. HUUUGE, FRUSTRATIONS APPEAR when "php professionals" give you the feeling that in every company you work, there is a nuclear bomb in the hands of 20 developers where just 2 of them are aware of its effect. I am sorry if i am offending anyone by this rant and i also wish PHP team should REALY BE MORE OPEN TO NEW ADVANCES in programming languages development. (and no, i will not thank/see PHP as the one that feeds me, i feed myself, through my own struggle) All the best to everyone.
Personally I am excited as to the direction PHP is going in. I think the core tipping point for most enterprises to take PHP more seriously was the wide spread adoption of PHP5. Fixing and improving the object model in v5 was one of the best things the core PHP team did for the language. That being said, I think v4 was simply dead-weight that held PHP back as a viable business platform solution.
I think what most of these companies are finding out is that majority of Java-based web applications can be developed faster and more quickly deployed in PHP. I also think the ease at which one can switch between an OO and procedural paradigm is a strength to PHP. In fact it's a tremendous strength. Unfortunately it's also a double-edged sword and can create a lot of poor programming habits with novice users...which probably adds to a lot of negative stereotypes PHP receives.
I whole heartedly agree with your viewpoint Cal, but you failed to mention how much Zend and IBM are in bed together...
I'm a php programmer that has been working for nearly a year now at an i5 installation. My VP has made the decision to start moving towards PHP (thus hiring me) and away from RPG. This was not a decision made lightly, nor by a single person. It was a board approved decision after several consultants from far and wide were contracted for advice. We use Zend Core with Zend Platform and I develop on Zend Studio for Eclipse (i5 version) on an Ubuntu box. The integration is amazing. There are still a few issues, but everything is moving in the right direction. The products are free except for Platform which has very reasonable licensing. IBM now bundles Zend Core with their hardware. Zend and IBM have been very supportive as well as other community members (kudos to Alan Seiden). I look forward to the new release and it's speed improvements. Keep up the good work... Nay, great work! Cheers from Canada!
Hi Rick!
Thanks for the comment. You are correct, I totally left out the Zend/IBM/i5 point but it was an honest oversight on my part. I didn't specifically mention Zend in the main body of the article because, well, everyone know Zend works with PHP and should know how much they do to help the language and it's surrounding eco-system. However, the whole IBM/i5 relationship is an exciting thing and something of which more PHP developers should be aware. Both companies have put in a lot of time and money to make sure that PHP developers have yet another career path available to them. As you are proof of, it is starting to pay off. To all my friends at Zend (a partner of Ibuildings) and IBM (good friends of Ibuildings) I apologize for the oversight. Thanks again Rick for being part of the conversation. =C=
You make good points. None of them speak to PHP specifically as opposed to open-source stacks in general.
While PHP has its proponents among professional programmers, much of its appeal has been to (a) hobbyists working on smallish code bases and (b) people who don't have control over their development environment (and hence have to accept whatever Dreamhost or whomever is willing to offer). PHP is -- finally -- getting better support for large-scale, structured programming. But much of the existing library infrastructure is a tangled mess, at least partially due to the fact that good namespacing and object construction/destruction are latecomers to PHP. "Legacy" PHP code -- and a language is only as attractive as the libraries available for it -- didn't get to take advantage of namespacing, lambdas, or even modern the modern class model and did often screw with globals and magic methods, polluting the system. There are literally thousands of built-in functions, with seemingly-random naming (isset vs is_array) and order-of-argument conventions, and weird syntax issues due to its legacy (*what do you mean a trailing space after the ?> will screw everything up???*). MySQL and PHP have both benefited from a low learning curve and easy access, but neither of these are big considerations when making the jump to long-term, large-scale, professional development. PHP is worth supporting and interfacing with because there are droves of PHP programmers and the added value is obvious. But in a straight comparison of PHP with other languages in the same niche (say, Python, Ruby, maybe Java in some cases), PHP lacks language constructs and features that allow for long-term, mutli-team development. Maybe I'm biased due to too much CS education, but I don't see any compelling reason to choose PHP.
I find that there are two compelling reasons for the use of PHP. Number one is programmer efficiency, you can write programs faster in PHP then in just about any other language. Number 2 is deployment flexibility. Programs that you write in PHP are inherently cross-platform. The mythical quest for the "write once, run anywhere" language is very well fulfilled by PHP.
Yes, it would be nice if the syntax was a little more consistent, even Leardorf(sp?) has said this. But compared to the DOT NET monstrosity or having to cope with the meta language of C macros, I'll take PHP any day. As far as the comments above about "bad code". Well, yes, I have seen a lot of "bad code" written in PHP and C and VB and any other language you care to name. Writing bad code is mostly a function of the programmer, not the language. If you are expecting the language to force you to be a good coder then you are in the wrong place. Maybe you should try Pascal? just don't complain when the language gets in your way and prevents you from doing things that you need to do and it takes ten times as long to write your app. One thing that I keep encountering is the belief that PHP is only for web development. This is wrong, PHP is great for daemons and as you point out above, it's also great for quick little admin tools (bye bye PERL). Call me crazy, but so far I have written the following apps in PHP. Web Server, SMTP+POP3 Mail Server, various console apps using Ncurses, and recently a DNS Server. Why would I want to do such a thing when there are already so many programs available!?!? Well, for one thing, I get really tired of dealing with other peoples bugs -- yes indeed there certainly is a lot of bad code out there, but most of it is written in C(++). But even more compelling is deployment flexibility, and the ability to add custom functionality. In the case of the DNS Server for instance, it was actually an act of desperation. We've been using myDNS for years and it has worked great. But it has also not been updated in years either. When we tried to deploy it onto Ubuntu we found that the old myDNS code would not work with the latest mySQL library. Yes we looked at myDNS-NG, but what scared us off is that after about a year of development effort it was still in beta. After careful consideration of the options, it was decided that the lesser of evils was to develop our own in-house DNS Server. Using PHP, it took me less than a week to write including time spent reading the specs. I'd like to see you do that with C-Anything. And in the process we gained smarter load distribution and dynamic capabilities then was available from any other conventional DNS Server software. Also because PHP is inherently not vulnerable to buffer overflows, we feel that it is going to be a lot more secure then the most popular DNS programs that are commonly used. And the performance is just fine thank you very much. While I don't have before and after benchmarks of the DNS Server, I do have benchmarks for the email server and we were surprised to find that conventional wisdom/assumptions are often wrong, we too expected that PHP would be slower, but in fact, in the case of the Email Server the PHP version is actually faster then the C program that it replaced. As for the PHP DNS speed, the bottom line for us it that it is fast enough to keep up with our load. ---------- I do have one serious beef with PHP though; and that is the Bug Reporting system is very broken and the release process is unreliable. What I mean by this is that serious bugs often sit in the database for months, even years, without getting looked at, and often legitimate bugs get marked as bogus. The release process does not sufficiently vet the code. 5.2.9 has a huge number of changes in it, and we found that it is only a beta quality release with many problems, but being presented as a final stable build. If anybody is listening...? will you please fix your process... This more than anything is what is hurting PHP adoption right now.
Hi Cal:
A nice article that make me understand what the potential php have. I have interesting in learning php. I have translated this article to traditional Chinese and saved the translated article in my hard disk. Can I post the translated article in my blog. The source of the article and original author are at the top of the article. I am taiwanese. Excuse me for my poor English. Lo
Lo Jen-Chih,
Please contact me at cal@ibuildings.nl and we will discuss it. Thanks for the kind comments! =C=
Thanks, Cal! I've been studying PHP lately, I'm VERY beginner. This article opened my eyes to the possibilities PHP offers. They are truly endless. Thank you for helping to understand the nature of PHP, and imagine the possibilities!
by the way, on the subject of IDEs. After a very long and often frustrating journey in which I used many different IDEs for PHP Editing and interactive Debuging.
I finally arrived at www.Eclipse.org as being the most optimal solution currently available... at least for my needs. One place that most IDEs fall flat on their face is CLI debugging. Eclipse is excellent for this. It is not perfect, none of them are. But it is free as in beer and cross-platform. Older versions of Eclipse PDT were barely tolerable, but the latest version is a huge improvement and has fixed most of the problems. If it's been awhile since you last tried it, or if you have never tried it, then you should definitely give it a look. I am also found of www.Bazaar-vcs.org because it does not force me to adopt ugly directory structures but lets me layout the files however I wish. It's very flexible.
I read the article when it was just released, I can't deny my excitement when I was reading and confirmed the bright future of PHP. I started with PHP since two years ago and I'm very proud to use it (well of course!).
Then almost a month later I revisit the post to enjoy its reading again, but this time I found so many comments, thx for that, all of them teach me new things and get me clear other ones. It's very nice to see how the normal "reasons" to why not to use PHP are taking down one by one. @codeslinger : in some time will be available netbeans 7.0 with great support for php and some frameworks as Symfony, the framework which I use (and fall in love with) since a year ago. Again nice post, nice comments!
You got to love PHP and how fast it has matured into a dominating scripting language.
I would say PHP is racing towards the enterprise level. The company I work for is well picky about selecting languages due to the resource tie up. I suggested PHP, which they are now testing for a new internal intranet / social network.
|
Blog









