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.planetfrank.us frank

    nice post, totally agree.
    most RoR developers were just great PHP developer a few years back. thats it

  • http://www.mikebritton.com Mike

    I’m hopeful that the folks who abhor micro-architectures like CodeIgniter, and dismiss the MVC design and patterns in general, will become managers and stop writing spaghetti code.

  • Manuel Gomes

    You make good points about the ghetto reputation of PHP – in a way, PHP’s greatest strength if PHP’s greatest weakness: It’s got such low barriers of entry, that even a trained chimp can make dynamic web pages. You therefore DO get trained chimps making dynamic web pages – and that’s got nothing at all to do with the language.

    It reminds me of Perl (and this may not be incidental) – now that Perl is mature and relatively unpopular, most of the ‘chimps’ have left it, and we’re left with disciplined, high quality developers for the most part.

    I suspect that as the language matures and there is some method thrown into the madness, the quality of the average codebase will rise, the language will gain new respectability and the community will further organize into an acknowledged set of best practices.

    There will always be starting, or unskilled programmers using any language, but by now being a skilled, disciplined PHP programmer is no longer like being the high priest of a low cult.

  • Kenny Katzgrau

    Definitely true and very insightful — thanks for the comment.

    It’s true, I remember Perl being much more popular (for the web at least), and at the same time having a bad reputation. It’s funny, because I had recently written a project in Perl (more for the sake of learning), but I hadn’t thought twice about it. I was was doing some text processing and I wanted a lot of power and portability — made so much sense. It goes to show that Perl has in-fact matured,
    and has become a language developers respect.

    I suppose that popularity of a language declines when new features aren’t really being added anymore, at the same time making the codebase more stable and dependable. Once that happens, I guess the chimps leave? Hm.

  • Kenny Katzgrau

    Ha, agreed. Although sometimes those that end up as managers insist on the same practices for those underneath them.

  • Kenny Katzgrau

    Thanks! Yep, probably. I have seen a pretty consistent pattern of people who came to Ruby/Rails from Java/[framework] backgrounds too.

  • oh well

    oh well, if you look inside code igniter you will find EXACTLY the kind of crappy PHP code you were talking about. the just hid it behind a shitty kinda-like-object-oriented-programming facade.
    and you should look at some recent benchmarks concerning scripting languages.

  • Kenny Katzgrau

    If you could provide an example of whatever you’re talking about regarding “recent benchmarks” or “crappy PHP” in CodeIgniter, I’d definitely like to see it.

  • http://erosbence.blogspot.com Bence Eros

    big +1, I totally agree.

    A few additions: you mentioned Ruby and RoR as the main influence on the PHP world. I think Java also opened many eyes from the point of design patterns, application architecture etc etc (especially for me, since I came to PHP from Java:)).

    I hope spaghetti-guys will stop writing shit in PHP in a few years and they will go to an other platform. I damn fed up with the cases when Java or C# devs think me a total noob only because I write PHP.

  • http://skyclerk.com Spicer Matthews

    Very well put. Your posting describes what I have been thinking for years but never could find the right words. Cowboy php is crazy. People left and never looked back. Most people learned ruby a with rails. Amazing points. I am sure if strong frameworks had not come along I would be on to RoR by now. I am going to be referencing this post for years to come.


  • http://fijiaaron.wordpress.com Aaron

    You can’t look at the 1001 variants of Moose, etc. and say that Perl is full of disciplined developers. Brilliant, yes, but OO Perl frameworks are the self-aware regexes of the 21st century.

  • http://raphaeldealmeida.wordpress.com Raphael Almeida

    Is inevitable the comparation with the popstar RoR. In fact the new way of make web applications, with all web 2.0 features us force find more efficient tools. I’m also language-agnostic, but a funboy of good ideias for make our developer life more simple.

  • Pingback: A semana no mundo PHP (15/04/2011) | raphael.dealmeida

  • http://www.150000goodpeople.com Gixx

    Interesting article.
    I checked out the CodeIgniter but it seems to be too lightweight for me. I don’t want to hurt anybody’s feelings, but placing the configuration into a PHP file instead of .ini or .property or .xml is not so professional nowadays. It remembers me the PHPmyAdmin days a bit. But that is just one of the many tiny (alone is negligible) and embarrassing problems I met using this framework.

    Ok, I admit I’m probably too headstrong and I use Zend Framework for a very long time, but ZF seems to be infinitely flexible and modular to build websites from a very basic and lightweight blog to a hardcore multi-language, multi-domain portal monster.

    ZF is constructed in a far more logical way than any other PHP framework I’ve seen before. I think it’s worth to try it. the documentation is very helpful, and even a beginner can learn fast how to start to use it.

  • http://www.homelist.org HomeList

    As a noob programmer, this article sheds alot of insight onto the “language wars”. Thanks. Also, I rather like php =)

  • Kenny Katzgrau

    I’m not a big fan of keeping configurations in .ini or .xml, largely because they’re plaintext (PHP won’t emit a blank page if they somehow get served), you end up replicating a lot of strings with xml, and with ini, the complexity of your config data is limited.

    I do agree that CI is a bit lightweight for some, but I think at the very minimum, you get clean code and speed.

  • Burn Notice

    “Rasmus generally promotes abstention from using frameworks, and the use of PHP as more of a templating language.”
    I support Rasmus on this one. There is something of an over enthusiastic crowd who use or say they use php that just strikes people as odd,approximately 4 weeks down that line.

    Php is still very much a ghetto.

  • http://njclarke.com Norman Clarke

    PHP’s interpreter doesn’t really have speed going for it at all, in fact it’s one of the slowest VM’s out there. Take a peek at the benchmarks here:


    But my point is not “don’t use PHP” – I do a lot of Ruby programming and Ruby is also *quite* slow – on some benchmarks like this one, slower in fact. But I don’t care because I use Ruby for web development, and raw VM speed is much less a factor in there than it is in desktop app development. I definitely agree – ignore the haters – you can create great software in PHP. But don’t deceive yourself thinking its VM is blazing fast, because it’s not. If you want to see fast scripting language VM’s take a peek at Lua, LuaJIT or Javascript V8.

  • Kenny Katzgrau

    I don’t think those benchmarks are a realistic comparison. *Everything* on that list above PHP is either not typically used as a web language, or is compiled in some way (including Python). Is there anyone out there writing webapps in C? I’d bet C is pretty damn slow compared to something written in raw machine code.

    I think the only way you could make a somewhat-valid comparison on that list is to benchmark PHP with APC (PHP’s bytecode cache).

  • Gunt

    Now can you seriously claim that the namespaces and closure implementation in PHP 5.3 are not something else than utter crap? Personnaly, I’m keen on code ergonomy and aesthetics, and I just can’t stand using backslashed to separate names in imports. I just can’t, it’s an insult to my eyes, my soul and my brain. I’m not pragmatic enough, and I’d rather prefer selling my body than touching this things to pay the bills. Seriously.

  • Kenny Katzgrau

    I can’t say it’s the prettiest implementation of namespaces and closures. In fact, I was pretty grossed-out myself when they were first announced. Maybe it’s just that the blackslash seems so foreign. And the ‘use’ keyword in closures is nasty too.

    Anyway, if the price is right, I’ll hack on PHP 3 apps 😉 I generally keep a few side projects going at all times, so regardless of whatever “pile of shit” I’m working on at any given moment, I do my best to learn something new apart from that.

  • Isaac Gouy

    @Kenny Katzgrau – “I don’t think those benchmarks are a realistic comparison.”

    My guess is that originally “oh well” and then “Norman Clarke” felt kind-of provoked by your “ultra fast framework for PHP” comment 😉

    Why ask the rhetorical question “Is there anyone out there writing webapps in C?” and ignore the obvious truth that there are plenty of people writing webapps in Java?

    If you looked at those benchmarks a little more closely you’d find a couple of pointers to “Overall Performance: PHP is rarely the bottleneck” :-)

    I’ve saw a comment from Rasmus – “There isn’t much point in using apc from command line php.” [2004-11-04 18:06 UTC]

    If you know better please explain how to use APC with command line PHP.

  • http://pooteeweet.org Lukas

    Without getting into a discussion if CI/ZF are good/bad examples of PHP and noting that I am very much a PHP only developer when it comes to the middle tier, I totally agree. Open source communities have a DNA and PHP tends to be pragmatic to the point where users are shooting themselves in their foot just a few weeks down the line. And yes PHP is like a rapid fire foot gun for beginners because they can so easily get to some semi useful state which makes these people viable instead of dying out quickly.

    Indeed since the PHP 5.x days a growing number of developers has been fighting this DNA, mostly by adopting ideas from RoR, Django, Spring etc. So in a way the PHP community is working on a split personality. Or rather the community of PHP users is separating itself form the development process in core, which is still very “cowboy” aka “I was here first so shut it”. That being said its not like there are no people trying to change core, but of course its much harder the closer you get to the origin of this DNA.

    Then again, this DNA of being pragmatic over everything undoubtedly has gotten PHP where it is today, arguable because this is pretty much how the web works: its not about having everything working all the time, but enough working sometime.

  • Kenny Katzgrau

    I asked about C because it was at the top of the list. More importantly, the reason I said that list was unrealistic is because it was full of languages that are either compiled (like java) or are not typically used in webdev. It’s like comparing Fortran to PHP.

    That is, don’t compare PHP, a purely interpreted language with things that are compiled or run on a VM. That only way you *could* compare PHP and Java (/JSP) as web languages is to install APC.

    And no, I wasn’t suggesting to use the CLI + APC — that’s not what APC was intended for. The point is that focusing on PHP in a set of benchmarks containing languages like C is absurd.

  • Kenny Katzgrau

    @Lukas, agreed :)

  • http://njclarke.com Norman Clarke

    > or is compiled in some way (including Python).

    PHP is compiled, just like Ruby, Python, Lua etc.

    > Is there anyone out there writing webapps in C?

    Of course not. You completely missed my point.

    > I think the only way you could make a somewhat-valid comparison on that list is to
    > benchmark PHP with APC (PHP’s bytecode cache).

    APC improves website performance by caching the compiled PHP code. By not having to compile on every request, you get a big speed improvement. But the execution speed of the compiled code is not improved by APC at all, so that would not affect these benchmarks.

    Again, my point is NOT to say, “don’t use PHP because it’s slow.” For web apps, there are many other performance considerations. Really, I think PHP is just fine for web apps if that’s what you prefer to use.

    My point is to try to stop this meme among PHP developers who think PHP’s VM is the fastest thing out there, when 5 minutes of research will easily prove otherwise. Before 5.3 in fact, PHP was the slowest VM on the benchmark, slower even than Ruby 1.8.

  • Kenny Katzgrau

    Hm, I don’t think we agree on what “compile” means in this context. Your description of runtime compilation (what the Zend Engine does) is what I’d call interpreting. Compilation (to most, I’d think) traditionally means compiling to bytecode (or lower), and always running those files instead of the uncompiled form.

    Java, C++, and Python run compiled files (.class, .o, and .pyc). Natively, PHP has no such thing. The closest you’ll get is APC, which, yes, caches the post-interpreted intermediate bytecode. That does not qualify as traditional “compilation.”, and is the reason for the disparity in those benchmarks. As for a real PHP compiler, see Facebook’s HipHop, Raven, or phc.

  • http://njclarke.com Norman Clarke


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

  • Kenny Katzgrau

    And re-“compiled” every time. As good and fast (and essentially what is) interpreting. Is a .class file in Java not essentially a byte-code cache? That’s exactly why it’s unfair to compare something running on pre-compiled bytecode with something that isn’t. Good god man.

  • Isaac Gouy

    @Kenny Katzgrau – “That’s exactly why it’s unfair to compare something running on pre-compiled bytecode with something that isn’t.”


    If you don’t make the comparison how do you find out how much faster it is to use something running on pre-compiled bytecode?

  • Isaac Gouy

    @Kenny Katzgrau – “The point is that focusing on PHP in a set of benchmarks containing languages like C is absurd.”

    Not when the point is to “try to stop this meme among PHP developers who think PHP’s VM is the fastest thing out there, when 5 minutes of research will easily prove otherwise.”

  • Isaac Gouy

    @Kenny Katzgrau – “As for a real PHP compiler…”

    HipHop for PHP: Benchmark – Revenge of PHP [english version]

  • Kenny Katzgrau

    Please, enlighten me to the group promoting this “meme” hailing PHP as the fastest general purpose language (outside of a web context). I’ve never heard of anything like that, and it strikes me as accusatory and uninformed.

  • Toby

    Another important aspect of PHP’s popularity is hosting – it’s pretty much a given that you have PHP available in any hosting package from $5/mo. on up, which makes building (and moving) small apps and sites very easy, as opposed to depending on every oddball host having the versions of Ruby or Python needed.

  • Ward Bekker

    Regarding your praise about Zend Framework (don’t know code igniter). I have to assume you never did a decent sized project with it. Glancing over it, it looks like Zend is well documented, but it just a _lot_ of crappy documentation. I got the impression the authors got payed by the word. The chosen examples are high noise, low signal. eg. the db select page, how many times can you repeat how a select looks like in code?. The API docs don’t really tell you the params functions accept, or their return types when not trivial. Most of the time, the Zend framework is a thin layer draped over native php functions, making it look ‘OO’-ish. The quality of 3rd party zend extensions is most of the time horrible. I am left with the impression that they started out with a enterprisy feature matrix and made sure they could check each box off as fast as possible. Everything I’ve touched that got Zend as prefix (Also think Zend Java Bridge, Zend Studio) made me want to poke my eyes out. Let’s just say I wouldn’t recommend it anyone. Oktnxbye.

  • Si

    These comments are ghetto

  • Brian Hogan

    I liked this article a lot. I haven’t done a serious project in PHP for a very long time, and it’s good to know that things are tightening up around PHP.

    I strongly agree that a lot of doors are opened to the web developer who knows PHP. But I don’t necessarily think that’s always good… knowing PHP might get you stuck working on a spaghetti code mess from 5-10 years ago. That said, I always encourage my students to learn it.

    Also, your assertion that PHP powers sites like Digg and Facebook… I see that reason touted a lot, but it feels very much like “appeal to authority.” Those sites use that technology because that’s what the original devs used. Then they threw tons of architecture in front. They’re caching things, running their own compiled code, etc. This has been beaten to death over at HackerNews several times. With that architecture, I could use classic ASP. I could use Perl. I could use Ruby or Java. At that scale, the language doesn’t matter as much. But it sure does matter when you’re starting, because you have to use a tool that lets you get something up in front of people.

    And sometimes that tool is PHP, which often times, is more than good enough.

  • Kent Brockman

    Great write up. PHP is actually a great language – everyone who says not is the type of person with nothing else to talk about but to bash something they aren’t familiar with,

    silly novice bashing php is for kids

  • Chris Koning

    While I agree with your overall point, I have to say I think that you were poking the proverbial bear with a stick by submitting this to Hacker News. What did you expect?

    That said, I think it boils down to three things:

    (a) Bad devs can/will write bad code in any language (though some languages make it harder to do so)
    (b) Good devs can/will write good code in any language (though some languages make it easier to do so)
    (c) Conflating raw language execution speed with framework/platform performance is misleading at best
    (d) Haters gonna hate

    At the end of the day, pick a language or two you like and learn to write well designed software. At the end of the day, design patterns are far more influential on performance than language choice. If you have the skill to create software of sufficient quality to cause the language implementation to be the bottleneck and the traffic to make it matter, then you probably have far greater engineering problems than syntax and language choice.

  • http://ixmat.us Parnell Springmeyer

    Having been a core developer for an advanced but little-known PHP5.x framework (KohanaPHP) and defected to the likes of Python+Pyramid; I have to say this: for large, scalable, and maintainable web applications – PHP is not the right way to do it.

    From my perspective of both sides, PHP is wonderful for scripting together a small and dynamic “website” (which is what it originally was intended to do). More general purpose, high-level, interpreted programming languages are better suited for big web applications.

    Also, PHP’s community is still a ghetto. PHP 5.3.x’s “catch up” features (notably, namespaces and closures” are mostly just hacks. Closures use the closure object and wtf is up using forward slashes for namespaces?

    Great stepping stone language, bad career language (that’s just my opinion though).

  • http://blog.philipbrown.id.au/ Phil Brown

    it’s behind some of the internet’s most influential websites and tools, like Facebook, Digg, Wikipedia, WordPress, Drupal

    Whilst WordPress is quite the ubiquitous blogging tool, it’s also one of the best examples of how not to write PHP. I’m surprised you didn’t mention it with phpBB and PHPNuke.

  • brad c

    i still see php as training wheels without the bike. variable scoping, proper and meaningful error checking from the parser, consts that don’t do weird strange things in a vaccum…it seems that practically every major feature in php is ill conceived in terms of direction and implementation.

    php is not a great language. by design, it can’t decide if its perl, ruby, or java. by implementation it can’t provide even basic safety features i would have gotten out of practically any other tool. pdo is a crappy reimplementation of perl’s dbi ten years too late. the namespace syntax is a joke. most of the core functionality is utterly mis-spec’d but can’t be fixed now as it would break the world

    and please stop hanging php’s success on facebook. facebook is a success DESPITE php, not because of it. indeed they wrote hiphop to address glaring deficiencies of the tool and by rights have forked php and can change anything they want now, including core syntax. its not like the developers had fb sat down and had a “bake off” comparing tools and picking the best…they use php because that is how the site was built from day one. thats it.

  • http://dev.af83.com/ Bruno Michel

    I didn’t know Code Igniter, so I went in the code to see it. And it’s not good at all. For example, the protection against XSS attack is based on a blacklist, that is a very bad idea. If even the basics are not done correctly, I don’t how you can trust this framework.

    For reference, the code in question is here: https://bitbucket.org/ellislab/codeigniter-reactor/src/c5ea18af24c8/system/core/Security.php#cl-194

  • Walter

    As a PHP developer of ~12 years, I would agree that most projects are a pile of shit.

    However, this is because it’s a very easy language to get in to, and a language that solves problems in an area that is highly in demand (ie: webapps).

    I disagree that the language is inherently flawed though, despite the fact that syntax is a little quirky (most annoying: argument order is frequently different between functions).

    Anyway, there’s still a huge bunch of bonuses for PHP: it’s everywhere, almost everything you need is compiled in, speed is excellent compared to other web languages, you can stick with procedural OR go for OO, depending on your choice.

    I personally stick with procedural most of the time (since it’s OO didn’t exist when I started: much like perl’s, in which I am also fluent), don’t see a problem in doing so and actually encourage fellow developers to adopt non-OO architectures when collaborating on projects.

    My gut feeling is that this rant is from a ruby or python user who has never maintained a large, high quality codebase in PHP and felt its benefits.

  • http://lamehacks.net Pedro

    Quite frankly, if this topic keeps being discussed (like it has been for the last 5-10 years) without any data to back it up, nor any clear code examples, this discussion is pretty much a flame war.

    You guys jump in and bash PHP applications in a cheap fashion. Take phpbb, it’s easy to point out defects on an 8 year old code base. But back then you probably used it yourselves. Have you ever wondered why you couldn’t find alternatives written in all those superior languages you mention?

    And now, while facebook spreads its tentacles to every last inch of the web, discussions like this keep the programmers of other so-called superior languages busy.

    PHP does have quite a bit of limitations that most of other popular languages don’t. It appears that everybody is too knowledgeable to discuss them, let alone trying to understand why they exist.
    On the other hand, PHP offers much more than a programming language. The latest clearly outcomes the prior. Hence the massive popularity.
    I would be pleased to discuss this, but it appears that most of the people in here are just too busy pointing out defects on PHP projects.

  • http://www.thilorusche.com Thilo


    great post and I agree with most of it, however I have to object to this:

    “I’m not a big fan of keeping configurations in .ini or .xml, largely because they’re plaintext (PHP won’t emit a blank page if they somehow get served)”

    Anything that you don’t want to “somehow” get served does not belong inside the document root of your web application in the first place.

    Configuration files need to be maintainable by non-programmers in many cases, and using .ini or similar formats greatly reduces the potential for breaking the whole app by missing a semicolon in a PHP file.

  • Parnell Springmeyer

    @Walter: I’ve maintained very large PHP codebases (> 400,000 sloc) and find that php pales in comparison to python, ruby, erlang, and scheme. I included the other two languages because they are functional but share one fundamental trait: that there is /some/ form of encapsulation that can capture the necessary abstraction to deal with very large projects. Eschewing object-orientation or any other form of encapsulation is decidedly the /yucky/ way to go about it nowadays. Scale, orthogonality, maintainability, expressivity, and minimalism are the keys to building /modern/ software. Phps core is yucky. Compiling all extensions into the core is the wrong way to do it you should be doing it with a modular plug in system or module/package based system as python, ruby, and many other languages do it.


  • Pingback: PHPプロジェクトの80-90%は巨大なクソの山であるという事実 : candycane development blog

  • SpookyAction

    I’m primarily a Perl programmer and constantly read about people bashing the PHP community. I’ve done some PHP hacking and it’s just not that bad as a web language. Just because it’s popular and attracted a community of amateurs isn’t a valid criticism. Look at some of the successful PHP apps, Drupal, which runs whitehouse.gov and a slew of other government sites and corporate sites, Joomla and the 800 pound gorilla in the room, Facebook. People rave about ROR but Twitter had to abandon Ruby on Rails due to scalability issues, but Facebook ran on PHP for years. Even with the advent of Hip-Hop for PHP, it wasn’t a scalability issue but a way to reduce hardware costs. ROR just couldn’t scale, no matter how much money Twitter threw at it, even though, when it comes to raw performance PHP and Ruby are close to equal. The problem was the ROR stack. If PHP is a ghetto powering some of the most important and profitable sites on the web, then I’ll happily live in the “ghetto”.

  • http://ProdLines.com Nick

    Excellent! I was expecting another self-pleasuring rant and was pleasantly surprised. Thank you for codeigniter info.