Why PHP Was a Ghetto

Note: I wrote this over a month ago, but decided not to publish it until now.

I was talking with the Co-founder of a pretty cool start-up in DUMBO the other day about why the non-PHP development world generally has such disdain for PHP and the community surrounding it. He brought up an interesting point that stuck with me, largely because I hadn’t heard it before.

If you’re unaware of the usual beef most developers have with PHP, it tends to revolve around:

  1. Ugly syntax
  2. Lack of some necessary features that other languages have (prior to 5.3, namespacing, closures)
  3. Inconsistent function naming, usage, and other quirks
  4. Mix of procedural and OO-ness
  5. The fact that 80-90% of PHP projects are probably gigantic piles of shit

But his problem with PHP was a little different. He didn’t say the actual language was poor — he said it was the general culture surrounding the language, which is usually iconified by a language’s founder, that seems to encourage bad practices. That is, PHP code bases tend to be hacky and unmaintainable.

The concept that the community surrounding a language or framework embodies an author’s philosophy seems to be true. He brought up Ruby and Matz. Matz wanted a language that was easy to read and write, and enhanced programmer productivity. Don’t Ruby developers seem to harp on rapid application development and the elegance of their language?

Then DHH and the Rails came up. Then Guido and Python. So I thought: What about Rasmus?

Rasmus Lerdorf is an interesting figure. He created the original version of PHP, continues to contribute, is widely considered a demigod in the community and the authority on almost anything PHP. He steals masses of attendees at conferences, gets hired by big internet places, and garners the respect of everyone despite one glaring property: Rasmus represents what most non-PHP developers hate about PHP.

Rasmus generally promotes abstention from using frameworks, and the use of PHP as more of a templating language. To him, this translates to raw speed and scalability (load-wise). To everyone else, this translates to piles of procedural spaghetti code, and unmaintainable projects. For roughly 10 years following the birth of PHP in 1995, this was how PHP projects were written.

But another issue cropped up:  In it’s pizza-faced adolescent years (pre-5.0), PHP gained a serious following among novices. The language has a fantastically low barrier to entry, so anyone could get started in 2 minutes by downloading some self-extracting *AMP stack for Windows. Additionally, the acceptance of the MVC paradigm hadn’t really occurred yet in web development. What do you get when you mix n00bs and a lack of best practices? Unmaintainable garbage. And that’s what proliferated.

Don’t get me wrong — there were some great PHP developers around, even back then. But like I said, unrefined n00b-sauce was all around. When cowboy PHP developers with no standards got together to build a project, it came out looking like PHPbb, PHPNuke, or some other gnarled mash of .php3 files. But can you singularly blame PHP developers? No! The other web language giants, ASP and Perl, were also gross as hell and promoting the same spaghetti-code practices.

So why does PHP get a bad rap? Because of its legacy. And most old-time PHP devs who have fled to Python, Ruby, and Java haven’t really looked back to see what kind of development has happened in the language since the introduction of MVC on the web. Additionally, there were super-outspoken critics like “Ruby guy” Zed Shaw complaining of developers with “PHP-Infected Brains”, and the distribution of stuff like this on RubyInside.

PHP was a ghetto.

But the development of frameworks like Zend and CodeIgniter have greatly pushed the language development into the right direction. In fact, it’s been pushed in the opposite direction of where Rasmus would probably like to see it. Check out the Zend or CodeIgniter frameworks and tell me it’s not some of the best documented, most well-written code you’ve seen.

When most developers learned Ruby, they were learning Rails and MVC  at the same time. PHP was in use for a full 10 years before that. So there really wasn’t a period of time when heinous Ruby was being written by novices. There was an established standard in place for Rails, and the barrier to entry was a much higher, typically keeping less experienced developers out.

The fact is, a PHP applications can be as well-written as an application in any other language, and probably have the additional advantage of speed. The widespread use of MVC-style development in the PHP world is a relatively recent phenomena though, and admittedly, we can probably thank Rails for it.

So what does PHP have going for it now?

  1. Standards (not universal, but generally a flavor of MVC for most projects, and little procedural crap)
  2. A very low barrier to entry
  3. Speed & Scalability (maybe the best among script-based languages)
  4. A great unit testing framework
  5. Arguably the best documentation for any language

Additionally, it’s behind some of the internet’s most influential websites and tools, like Facebook, Digg, Wikipedia, WordPress, Drupal, etc. I’d bet that having a solid understanding of it opens more doors for a developer than any other.

If you don’t agree with the above, comment on this post, or email me — I’d like to hear why you don’t think so.

I’m no PHP fanboy — in fact, I’m very language-agnostic. I write PHP more often because, you guessed it, people pay me to. So it all comes down to this:

If you are capable of making wise software design decisions, PHP is a great choice to build your web application with.

By the way, if I just convinced you to build your next webapp in PHP, check out CodeIgniter. It’s the lightweight, no magic, ultra fast framework for PHP. When it comes to CodeIgniter, I am a fanboy.

4/4 Edit: I’ll be presenting a tool I wrote in Perl called ‘divvy‘ tonight at Hack and Tell in NYC. Here’s a video of a previous event (about 10 minutes in) where a developer plugs in his laptop to reveal Windows XP on his desktop (strike 1.5) and then admits to being a “PHP Coder” (strike 4). Is it me, or can you feel the judgment in the air? Maybe it’s me.

On Twitter, I’m @_kennyk_.

This entry was posted in Life, PHP Development, Soap Box and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • http://www.ruturaj.net/ Ruturaj Vartak

    Loved every word of it. In India too – PHP – hmm… lowly work.. used only by noobs, or bit-brains !
    I’ve seen shitty code all over the place, Java, Python, .NET. Just ’cause u put ur code in a private method and a protected member variable doesn’t mean the code is structured wonderfully !

    +100 from me!

  • Mr Cit A. Tioneeded

    [wikipedia link]
    “PHP source code is compiled on-the-fly to an internal format that can be executed by the PHP engine.”

    Wikipedia is a bigger ghetto than PHP. It is not a real encylopedia. It’s not authoritative, so stop copying snippets from it then leaning back in your chair smugly. In all likelhood, another Norman wrote that statement; another average person who, also, thinks it’s compiled. All you’ve shown is that another anonymous yahoo takes the same interpretation of compilation you do. You might as well copy any random forum post to “prove” your point.

  • http://roy-t.nl Roy T.

    I agree with a lot of the things you said, except for this point:
    “5.Arguably the best documentation for any language”

    I think PHP has arguably the worst documentation of any language. The documentation is inconsistent, has a lot of errors and the samples all promote spaghetti coding and bad practices. As a novice programmer the documentation can only make you write worse code.

    And then there are the comments on the documentation, unmoderated, infested with all kinds of bugs, totall wrong often.

    No PHP’s documentation doesn’t hold a candle to the documentation of for example ASP (MSDN really is one of the finest documentation’s I’ve every seen). Or to that of JAVA or many other languages.

    (on a different note, when using Opera it is impossible to place a comment here, once you start typing half the page disappears)

  • http://activedeveloper.info mhitza

    @Parnell Springmeyer: that’s not a large project in my opinion. At least triple that and you’ll have the application I work on currently.

    And I’ve seen also large PHP projects written procedurally which looked ok. When talking about procedural code don’t think of WordPress spaghetti code style.

  • datt

    I know that php is a script language on server side social network like Facebook used for php for their site.yeah you are right it’s has a drawbacks like not following MVC architecture some of the reason like people moving to Drupal,Ruby and Rails,python but all languages have their own important in the market and so many company asking for PHP developer still this is good news.This article is in depth insightfull about php..

  • Alex

    I agree with a comment above stating CodeIgniter is crap. Just because it has phpdoc for everything does not make it a great tool.

    Try unit testing a library or component in CodeIgniter context – it is impossible. If you look at its code base and you will realize it is one giant monolithic monster, impossible to customize at its Core. The libraries that are provided are a joke (especially the ORM) and thus useless.

    What remains of CodeIgniter is a bad MVC framework. There are much better ones out there or you could write one yourself in a couple of days.

    If you do not realize that CodeIgniter is a very bad choice, you are lacking experience with really good frameworks or overall Experience in what Best practices are. CodeIgniter has nothing of Best practices. In contrary.

  • AKX

    > Is there anyone out there writing webapps in C?
    >> Of course not. You completely missed my point.

    OkCupid uses C++ for webapp development according to (among other sources) this Quora.

  • http://Www.christopherscott.ch Christopher Scott

    Abiture great Framework/CMS is symhoony http://www.symphony-cms.com . Unfortunately Not very well known, but is salt based and not messy at all!

  • Renaud

    right on…mostly :)

    Some of the details in the post I might disagree, but I agree with the general gist of it.

    One thing I think compounded the problem: talent flight. For most of the 90s and early 2000s, if you were a talented developer starting with PHP, you would inevitably be tempted by other languages when hitting the ceiling described in this post (i.e. PHP weaknesses on big projects). A lot of the good/great developers I know who started out with PHP moved on to Java or .Net or ruby, etc.: this only made the problem worse by depleting the PHP community leadership from some of the talent capable of fixing the problems.

    I also want to insist on the past tense used in the title for this post: while this WAS true, this has started to change a few years ago because of frameworks (Zend, CI, Symfony) that bring best practices from other languages/ecosystems. The vibe and energy I am picking up from the community has changed accordingly, and talented individuals who started out 2 years ago do not feel as strongly that PHP stifles then in any way. This is very good news..

  • Derek

    Fairly recently, I, a Ruby programmer by day, moved out of the greenfield suburbs of Ruby land and attempted to gentrify the ghetto that was PHP on a freelancing project. It’s true that you can write good, object oriented code, but the language still feels clunky. I’m very interested in what you consider to be a good unit testing framework for PHP. I used standard PHPUnit and attempted to use its BDD framework. While standard PHPUnit works just as well as Ruby’s Test::Unit (and every other language’s *Unit framework), the BDD framework was just terrible to use compared to RSpec.

  • Kyle

    I programmed PHP for 6 years. I read a book on Ruby, and was so moved by the experience that I quit my job, so I could dedicate to Ruby development full time. I’ve been working with it for 6 years now. I largely consider switching to be the best decision of my entire life. It opened doors for me I didn’t know I could open.

    Read the first part of the Ruby “pickaxe” book, and tell me PHP can even approach it. In Ruby, everything follows the same rules. There’s no functions that crash out with errors, no silently failing code.. you get real exceptions for -every- error. I can do things in ruby with one line of code that took a dozen in PHP. It’s incredibly easy to make high grade reusable code, and they have world class testing frameworks of all kinds. There’s a huge gem (third-party software) library that is constantly adding hot new software and solving all kinds of problems for you. There is absolutely nothing like it in PHP.. Seriously, take a look: http://rubygems.org

    As for speed, everybody loves to criticize ruby’s performance. Which is hilarious to me, considering that my ruby web framework gets over 1500 hits per second on one core of my MacBook. Even Rails (which I don’t use, I use Sinatra.. it’s not all Rails, there are good choices!) gets 400 or so. Contrast that to some of the Zend/Shopigniter benchmarks, which are far lower than that (I recall seeing a Zend benchmark that only got 70 hits per second.. I can’t find it now unfortunately because I’m running late for a flight). The real performance problem with web development is blocking IO, which is a universal problem that almost every high level language shares. But ruby also provides EventMachine, which is in the process of fixing that problem. If you build a real OOP framework in PHP, it slows to a crawl.

    Using better designed languages will make you more productive. I’m more productive now. I can handle thousands of hits per second on a single machine. It’s fast and I’m productive. What more needs can be said? PHP is not a great programming language. I never want to go back.

  • jon w

    Procedural doesn’t mean “crap.” In fact, it’s easier to create hard-to-change crap with objects than with procedural interfaces.
    I still think PHP would have been a lot better with more language theory behind it.
    You can’t index off a function return value. Arrays are value types, but mutable. The list goes on…
    Also, speed? Tried node.js? It runs rings around PHP.
    BTW: work is a million-line PHP code base, so I have some perspective.

  • http://www.romku.com Pierre

    I would say it applies to all languages, not only PHP. I am language-agnostic too and feel that there are a lot more bad programmers than bad languages. And the fact that big companies/products like Facebook, Digg, Wikipedia, WordPress, Drupal are using PHP is a simple proof that PHP’s a great platform.

  • http://philsturgeon.co.uk/ Phil Sturgeon

    Kyle: “Seriously, take a look: http://rubygems.org” OHRLY?!

    This article is not saying PHP is the best thing in the world, it is just saying most of the negative opinions are no longer relevant. I know several Ruby developers – some who give talks at the conferences you probably go to – and they are incredibly smart people. That said, they switched away from PHP around version 4 and some of them dont even know about autoloading of __call(). They’re complaining about things being missing that have been in the core for 5 years.

    There are people going around giving strong opinions against PHP who actually don’t know all that much about it and I see this happen all the time. We’re all prone to it. How many of you like ASP.NET? Had a chat with somebody who uses it? They’ll probably tell you things got a lot better since version X.

    Side note: for the love of god, can everyone stop saying “fuck it, use Rails!”. I love Rails, its really good; shiny syntax, great gems, we’ve got it: Rails is good! Now go and tell your boss he’s doing it wrong. Then go and tell all of your clients to switch servers and fire their development team. Not really an option is it.

  • http://trovetracker.com cies010

    php is not faster or more scalable when going OO+MVC.

    http://www.beyondcoding.com/2008/05/26/ruby-on-rails-passenger-modrails-vs-codeigniter-and-kohana/
    http://www.alrond.com/en/2007/feb/04/in-addition-to-the-test-of-mvc-frameworks/

    OO makes PHP crawl (and not any more pretty if you ask me)
    Ruby always crawled :) Now with 1.9.2 it slowly learns how to walk.

  • http://wilmoore.com Wil Moore III

    @Lukas:

    Agreed 100%.

    @Kenny:

    I understand your gripe about the verbosity of the .ini format; however, it does make up for that verbosity with flexibility. If you are using something like Zend_Config (Zend\Config), you get section inheritance which is great for deployment to multiple environments. It may seem like overkill to those that don’t need to think about deployment, but for larger longer-lived apps, this is a huge plus.

    BTW, with Yaml configuration files, most of the verbosity goes away and you get a few more cool features. Check out Symfony’s Yaml component.

    Also, you alluded to clean code w/ Code Igniter. I suppose you can write clean code against CI, but that would be like wearing your best new suite on top of dirty underwear. Not trying to offend anyone that uses CI so I won’t go any further than that.

    @Ward Bekker:

    Zend Framework’s documentation isn’t perfect. Anyone using it for any non-trivial amount of time knows this. That being said…it certainly isn’t close to the worst documentation out there. BTW, under-documented !== “crappy documentation”. The documentation that _does_ exist is quite clear for an experience PHP developer. That being said, it probably isn’t very good for a beginner to either PHP or to web development in general. It is what it is. And yes, the API docs suck, but how many other PHP projects have excellent API docs. They all suck because the current tools suck. Again, it is what it is.

    Also, Zend Java Bridge and Zend Studio have nothing to do with Zend Framework.

    @Brian Hogan:

    You make an excellent point. A team of good developers could write any of those sites in just about any language (given a few weeks ramp-up time) even if that isn’t their _native_ language or language of choice. It is simply a virtue of a talented developer.

    @Chris Koning:

    Your comments were similar to Brian’s and I agree with you as well.

    @Derek:

    Yes, for the majority of the php community, PHPUnit is the defacto standard as it relates to unit testing. For BDD try Behat.

    @Kyle:

    Yup, Ruby is so much nicer from an OOP stand-point. It is not a panacea, but it is a much nicer environment and platform for development. There are some amazing gems out there which have been around for years and it seems that many are just now being copied over to PHP. To a smaller degree, the same is happening with Python/Django where developers are seeing excellent libraries and are copying them to PHP. Some of these ports were not even possible pre-5.3 or would have been extremely obtuse. Many people hate the namespace delimiter (backslash, not forward as someone earlier mentioned, and yes, it is a bit ugly) but it was implemented in the same style as PHP was invented. To pragmatically scratch an itch. Some may call this a hack or an after-thought or a late entry…and they would be right. That said, it isn’t stopping me from using it and writing extremely maintainable code.

    @jon w:

    I’m not going to hate on procedural programming as every paradigm has its time and its place. That said, you mentioned “it’s easier to create hard-to-change crap with objects than with procedural interfaces”. I would say, it depends on the developer. OOP in and of itself is not a panacea…certainly, procedural programming is not either. Let’s not confuse these things. A carefully architected system likely consists of many paradigms (OOP, Functional, and strategically-placed procedural)

    @All:

    As for speed…people, please stop. If you can architect scalable applications, small speed differences matter much less. The problem is, many developers are lazy and want scalability handed to them in the form of raw speed. They aren’t the same thing. A ruby app can be made to scale just as a PHP app can. Nobody wins outright here. I would say, the better developer (or team) wins.

    @Phil Sturgeon:

    I agree that PHP isn’t the same PHP from 4 years ago and autoloading and some of the SPL and PHP 5.3 features make it much less of a pain to deal with on a daily basic. That said, autoloading and __call() doesn’t make it a Ruby equivalent. I apologize if that isn’t what you were trying to get at. I am just noticing that some people in the Ruby camp (why are there camps anyway…aren’t we just developers using and creating tools) don’t get PHP so they bash it blindly, but the same is happening from the PHP side where Ruby gets bashed (slow, magical, etc.) blindly by those that either don’t grok it or have worse, never tried it.

    You wrote, “Then go and tell all of your clients to switch servers and fire their development team. Not really an option is it.”, and I get that statement…well put. But at the same time, let’s not forget that developers also need to step up and make a case for the right tool at the right time. If there is an opportunity to utilize Ruby for a particular slice of an application (we are advocates of decoupled architectures aren’t we :)), then why not if it fits. It isn’t really good enough to say, “I’m comfortable with PHP so I’m not even going to try Ruby”.

    Also, if your client is already on Dreamhost (cheap $8.95/mo), there is no other excuse _not_ to use Rails, other than, “I don’t care to learn it”. Of course, if we are talking about developers that take on $50 website/CMS jobs, then, that’s an entirely different set of issues.

  • Mr. B-o-B

    Great Article! I love php! I think it’s a great language. Sure it has issue as many have mentioned, but don’t they all? If you know what those issue are you can work around them.

    Years ago I was a n00b to php, and fell into the category of writing some crappy code (even though on the outside they worked fine for the users). This is true in any language. As experience rolled in rewrote many(most) of those early programs in production. Now they are not crap anymore :)

    I also hear the same arguments from other developers. Some are the old timers that left (blowing out dated crap), but a lot of what I come across is the “Oh, I didn’t know it could do that”.

    I am the IT Dept where I work so my job is not just programming. I use PHP for just about everything now. Its great for system scripting too. Thing I used to write in NT Batch or Linux Bash I code now in PHP. One big advantage to php over a lot of the system shells is the fact it is so easy to work with databases. Everyone hears PHP and they seem to only think of webpages. It can do so much more. I know this makes some people cringe, but it’s my shop, php gets it done, and I can move onto the next item on the todo list.

    I could go on & on, but I wanted you to know that I enjoyed your article and I am god damned proud to live in the ghetto!

  • http://mindplay.dk Rasmus Schultz

    If the PHP ecosystem used to be a ghetto, today it’s more like a jungle – there are a few predators, but the jungle is open to anyone, and it’ll always be crowded with monkeys.

    The PHP language to me is like paint – any age and skill level, you can pick up a brush and start painting. But it takes many years of practice before you can call it art.

    Very insightful article, thank you!

  • http://www.somacon.com/ Shailesh

    PHP’s best and worst feature is its low cost of entry.

    * minimal learning curve (you know some C from school, right?)
    * free of cost runtime, web server, development tools, etc.
    * near universal installation in cheap web hosting sites
    * complete/excellent/fast-loading documentation
    * out-of-the-box functionality to do just about anything
    * no framework to learn

  • http://ithink.ch/blog/ Ölbaum

    “Arguably the best documentation for any language”

    I beg your pardon? And yeah, what Roy T. said.

    Also, is it normal that half the comments that are referenced in other comments (e.g. @Parnell Springmeyer and “a comment above stating CodeIgniter is crap”) are missing?

  • http://ithink.ch/blog/ Ölbaum

    Ah, ok, there are two pages of comments, it displays the last one by default, and the buttons only appear at the very bottom.

    If WordPress had been written in Ruby, such bugs wouldn’t exist.

  • http://till.klampaeckel.de/blog/ till

    Hey,

    I had to read this a couple of times, and while I agree with many of your points, here are some thoughts.

    First off, I wouldn’t single out Rasmus like that.

    Everyone’s entitled to their own opinion about how people use PHP and from what I can tell, his use of PHP in many circumstances is that he’s using it as a templating engine whereas what people generally use a framework for is where he writes a C-code to excel and gain performance.

    I don’t think a language should be judged by how its creator likes to use it. Of course he had something in mind when he created PHP and now it turns out differently. But that’s the beauty of open source.

    And Rasmus, despite his position in the PHP community, is not a BDFL. Core is driven by a number of people nowadays.

    So lots of people use PHP in many different ways, and they all have a write to do so.

    And despite e.g. Rasmus stealing crowds with his talks and all that, there’s IMHO there is less of a cult around the creator of PHP as there is in other languages. He manages his audience well because he is a really smart person and on top of that someone who doesn’t have to use the hype to bring his point across.

    He’s pretty real in the end, has lots of street credibility (if I am allowed to use this analogy) and that is what maybe makes him unqiue in this respect. Yes, DHH build large sites too, but in Rails land, there’s nothing comparable to the size of PHP applications today.

    One should also mention that a lot of people who left PHP for Ruby and related were not great PHP developers and they are not any better in Ruby or Python. Now all their code is beautiful but it still breaks. I meet them on a daily basis since I do some Ruby as well, even attended a couple conferences and user group meetings. They tell me they are sorry that I have to do PHP and at the same time, I wouldn’t hire any of them because they are just not great developers.

    Generally, there are fundamental skills needed for programming (or scripting), and if you have them or not doesn’t depend on the language.

    Using the language as an excuse for sloppy code is pretty poor. Just because there’s no compiler which complains on the mis-use of variables (e.g. C) or a three page stacktrace when you try to add a number to a string (e.g. Java), is just no excuse for poor programming skills.
    Point taken, maybe that also makes it sometimes harder to produce ‘quality’ PHP code or at least it requires more experience and a QA person in place to get people there — it’s possible though.

    Once thing though which struck me as odd is, that you use CodeIgniter as an example for a great MVC framework when you mention phpBB and phpNuke as examples for bad PHP software. I don’t want to get into a framework pissing contest with anyone, but from my over 12 years of experience with PHP, you’re not doing yourself a favour.

    What people forget about PHP and source code in general is that often pretty code doesn’t matter. You named phpBB, phpNuke – let me add Joomla and WordPress. From a code point of view, I guess most people would agree that these are prime examples for bad PHP code. Or at least they used to be for a long time.

    In the end, the majority of people using any of these tools couldn’t care less though and they don’t. While theese tools may be poor examples of PHP code, they are great examples of software which enables people to get things done. There are blogs written in Ruby, Python and Java yet tons of websites are powered by WordPress these days and many of them make a killing.
    It doesn’t matter to the people running them if someone disagrees with the quality of WordPress’ code base. In the end it enables people to blog and there are a gazillion extensions out there to create pretty sophisticated websites with them.

    Ghetto or not. That’s sort of like, do I want a double-shot latte or a flat white for breakfast. A luxery, first-world problem. Not a real one.

  • http://mikbe.tk Mike Bethany

    @Roy T.

    It’s interesting how people can have such diametrically opposed opinions about a thing.

    I think Microsoft’s documentation is some of the worst I’ve ever read. Examples sometimes don’t work, granted it’s not often, but even when they do they are rarely written using best practices and never seem to be written by real programmers but instead appear to be written by summer interns with no understanding of the languages or even basic computer science ideas.

    A perfect illustration of this is the socket example code. If you were to use their own code example after connecting to just a few sockets you’d get an error. If they actually bothered to test the code they wrote they would have seen this and could have modified it to use the proper closing code the author(s) of the library intended.

    Worst of all there is no central “feel” to Microsoft libraires and they ironically don’t follow their own coding practices. I never feel like reading the docs for a Microsoft library will actually give me any idea of how to use the library.

    While I feel the Ruby docs are incomplete and often not enough they are the very first place I go when I need to know something because even with those weaknesses they are hugely useful. Conversely I actively ignore Google hits on the Microsoft docs because I know they will be useless at best and might actually be harmful if followed.

    Not to mention Microsoft actually sells their help files as books. FTW?!

    I’m not a Microsoft hater, I think C# and the whole common language runtime idea was brilliant, I just think they lack a central focus and competent follow through. They have a few geniuses on the edge but their products seem to be driven more by internal company politics than by good design.

  • http://www.anthonyw.net Anthony Wlodarski

    I would have to disagree with the notion that Zend Framework has awesome documentation. Lets face it, their docs suck and it is a miracle that #zf-talk on Freenode gets the job done helping everyone get up and running (there are a million people asking for help). Second you mentioned Drupal. I am going to tell you now that everything you mentioned before, all the spaghetti code, the unmaintainable mass of code bases are present. Not to mention that the CMS has yet to adopt OOP practices. It never ceases to amaze me that for a single page to load in Drupal you have to load every single module.. That’s absurd! Now they have created seven different revisions and still not addressed what the rest of the PHP world is addressing? Sometimes you have to face-palm when it comes to PHP and solid software development.

  • Pingback: » Weekly List #6 » Stefan Laketa - laketa.com

  • Pingback: 为什么说PHP是个集中营 | NaTian

  • Pingback: 为什么说PHP是个集中营 | Article2Net

  • Pingback: 为什么说PHP是个集中营 | 麻菜.co

  • Pingback: 为什么说PHP是个集中营 | PHP---Civon

  • Pingback: 为什么说PHP是个集中营 « 在地球以南寻找光年之北

  • http://www.filmsupload.net filmsupload.net

    This article is not saying PHP is the best thing in the world, it is just saying most of the negative opinions are no longer relevant. I know several Ruby developers – some who give talks at the conferences you probably go to – and they are incredibly smart people. That said, they switched away from PHP around version 4 and some of them dont even know about autoloading of __call(). They’re complaining about things being missing that have been in the core for 5 years.

    There are people going around giving strong opinions against PHP who actually don’t know all that much about it and I see this happen all the time. We’re all prone to it. How many of you like ASP.NET? Had a chat with somebody who uses it? They’ll probably tell you things got a lot better since version X.

    Side note: for the love of god, can everyone stop saying “fuck it, use Rails!”. I love Rails, its really good; shiny syntax, great gems, we’ve got it: Rails is good! Now go and tell your boss he’s doing it wrong. Then go and tell all of your clients to switch servers and fire their development team. Not really an option is it.

  • http://www.claudiocpires.com Claudio

    Liked a lot the article…recently I have written a related post, mentioning Zend Framework and Agile Development: http://bit.ly/jbQ5XX .

  • Pingback: Por que o PHP era um gueto? | Microcamp Empresa Virtual

  • Pingback: Finding 0-day vulnerabilities in the ghetto | Nick Carneiro

  • Pingback: Linkdump #55: PHP – Personal Home Page. « Tomasz Kowalczyk

  • Pacoup

    Hey, you can write awesome HTML while 99% of what exists is pure crap right?

    It never made sense to me that a language with such powerful support, i.e. being used by major projects, would be that bad.

    And recent developments bring really nice stuff. Nginx + PHP-FPM with APC is pretty awesome speed.

  • miked

    I have been using php for years…both for websites and for data gathering from oracle websites.
    I feel the need to express the fact that why yes it is great for websites…it was also an amazing tool for automating reports from databases for excel and other formatted reports.
    I use to spend hours a day running reports in programs like Toad and than formulating the data in excel before emailing out to my clients, but once I learned php I only had to schedule the job to run and it was done.
    The beauty in the php language IMHO is the flexibilty of it for more than just website, more often than not large corporations can use it for testing conditions on the system and fixing problems before they ever become a problem that causes major downtime.

  • goluhaque

    I am a noob web developer, and I use CakePHP. It’s been a very good learning experience for me reading the article _and_ the comments. Strangely enough, I don’t find talk of CakePHP when people talk about ZF and CI. Any specific reasons?

  • maxwell

    PHP has come to stay considering the amount of community behind it. The biggest and the most powerful CMS and websites are built by PHP, so why are these developers from the other sides complaing about PHP having bad procedural coding pattern? Infact no language is easy to learn because the more deeper you go, the more things become complicated. l love PHP. Long live PHP.

  • SC

    Awesome article, though I was surprised that with all your mention of frameworks, MVC and the web, etc. that you didn’t list Joomla! as an example. It’s as pure as OO comes in the php-Open Source framework world.

  • Handsome derek

    Hi,
    All programming langs do more or less the same stuff but by different degrees of complexity.But at the end of the day we should all be working towards a universal lang that would make life a lot easier.

  • Pingback: Why PHP Was a Ghetto | mediumrareplease

  • http://www.facebook.com/people/Malki-Hamza/100003248521676 Malki Hamza
  • Paulogibison

    Well, I prefer CodeIgniter, thou new to PHP, I enjoy spinning it around CodeLobster, Eclipse and hope to test it out with Webmatrix.

  • http://www.facebook.com/pkocanda Philip Kocanda

    Great article, lots of love for CodeIgniter from me as well.

    Most arguments against PHP are indeed against the “cowboy developers”. I’ll admit something here: I once was one of those spaghetticoders. But since I learned CodeIgniter i haven’t looked back. I realised that in order to push forward and build greater products, I had no choice but to embrace MVC and improve my coding standards. And i’m all the better for it.

    Thanks CI, looking forward to version 3.0!

  • http://www.facebook.com/la.kueva.online Daniel Silver

    I was developer for 3 years in python and django.

    Django breaks compatibility backwards, is a shit.Is not  for “developers with deadlines” because have poor doumentation, and 1 or two examples.
    Python sucks too… because is very new yet, you can write the same program of 20 lines in 3 lines of python.
    But sometimes… you must spend much, much more time googling for examples that work in python 2, but not in 3.
    I return to PHP, i think that codeigniter is lighweight too, but i’m doing my own right now.
    Also the speed of php agains python more or less the same, but the time that you spend searching for examples, is bigger than write php s*it code, that works perfectly.
    PHP gives you the freedom to do your own shit.If you just create three folders (mvc) and you are not verborragic, think the real name of each variable, functions, etc is perfect.
    I sometimes preffer to write in OOP but sometimes  is better to use just functions, because is more easy and each programmer that look at my code will understant in less time.
    My target is the time, and that my code remains legible…. for humans… and also for me, because in 5 months if i will touch something in my own codes, i don’t want pain for that.
    Sorry for my fuc**ng engrish.
    Chao 

  • http://www.facebook.com/la.kueva.online Daniel Silver

    I was developer for 3 years in python and django.
    Django breaks compatibility backwards, is a shit.Is not  for “developers with deadlines” because have poor doumentation, and 1 or two examples.
    Python sucks too… because is very new yet, you can write the same program of 20 lines in 3 lines of python.
    But sometimes… you must spend much, much more time googling for examples that work in python 2, but not in 3.
    I return to PHP, i think that codeigniter is lighweight too, but i’m doing my own right now.
    Also the speed of php agains python more or less the same, but the time that you spend searching for examples, is bigger than write php s*it code, that works perfectly.
    PHP gives you the freedom to do your own shit.If you just create three folders (mvc) and you are not verborragic, think the real name of each variable, functions, etc is perfect.Is very, very easy, fast, very well documented, so i can finish my projects in less time.
    Sometimes i preffer to write in OOP but sometimes  is better to use just functions, because is more easy and each programmer that look at my code will understant in less time.

    OOP can be a gigantic mess too, and a clear, and descriptive set of functions can be more legible, so oop or procedural programming is according to the programmer, if the programmer is a stupid, or just extends sh*t, the program will be heavy, as JAVA, that is a nice language, but the 99% or java developers are OOP compulsive, so expends a lot of time in write a lot of shit code, and if i need to modify or add some functionality, i need to read all a encyclopedia of shit and expend weeks in undertand a huge OOP code, because a stupid programmer just extends, and recycle sh*it code.
    My target is the time, performance, quality, undertand my code in the future, and also to develop understandable code, because maybe in the future others will read my code, so i can’t give them a book of sh*t.
    Sorry if my engrish sucks.

  • pabloezequiel

    Laravel 4.1 is simply magic… try it and never come back to any other framework/language… I love it!
    If you mix this wonderful tool with sublime text and it’s snippets, then you find the holy grail!

  • radwa ali
  • radwa ali