14

Apr

Filed in Code, Django, PHP, Python |

Constantly, and only in Python channels, I hear the argument brought up that “PHP is <insert random insult>” or “<N> is a PHP developer so he must suck”. One of the things I hate most, is stereotypes, based on false information. Stereotypes about people from Texas being rednecks are ok, because it’s true. Now, let’s get into this a bit more.

PHP is thought of as a poor language because:

  • Namespaces are nonexistent.
  • There are 80000 globals.
  • The language is very lazy in its syntax. You can code in at least a dozen styles.
  • You haven’t used the language but you like to troll.
  • [insert a hundred random reasons]

Now while these are VERY valid points, this doesn’t make PHP a horrible language. Let’s take a look at something like Perl. Now, I’m sure I’m going to get an earful for this, but it’s completely fucking useless. It’s not good for web apps, it’s outdone for shell scripting, and it’s not very useful as a scripting language (relative to other, more useful languages, such as LUA). PHP also has an extremely high availability, and is relatively simple to deploy. Python doesn’t, and isn’t (each site needs it’s own configuration to an extent).

The fact of the matter is, PHP tends to attract more unprofessional developers, and younger developers, because it is so widespread. If Python was the same, you would be able to talk just as much smack about it as you do PHP. So more to the point. There is nothing wrong with PHP or PHP developers.

And yes, I write both PHP, and Python, and I excel at both, but I prefer Python. So please, educate yourself, and stop talking shit :)

(For the record, no one has said anything bad about my PHP code, I just get tired of hearing the opinion “PHP sucks”.)

Correction: I wrote this hastily, so let me correct myself. I don’t mean in by any shape or form Perl sucks. What I meant to say, was it’s completely outdated. There haven’t been any *real* updates to the language in quite a while (correct me if I’m wrong).

  • Evan

    Constantly, and only in David Cramer’s weblog, I hear the argument brought up that “Perl is ” or “ is a Perl developer so he must suck”. One of the things I hate most, is stereotypes, based on false information. Stereotypes about people from Texas being rednecks are ok, because it’s true. Now, let’s get into this a bit more.

    (For the record, no one has said anything bad about my Perl code, I just get tired of hearing the opinion “Perl sucks”.)

  • Zonk

    Completely wrong. PHP sucks. I’m a very strong developer with strong background in C, C++, Java, Coldfusion and Python. When I needed to write a web app I opted for PHP 5 because it was supposed to be wonderful with OO features and lots of the warts removed. It took me six months of evenings and weekends to get 50% of the app working. I switched to Django and Python and had a production Version 1. The win was assisted by Django’s ORM, but the mostly the consistent language structure and library format of Python.

    I will never go near PHP again. Facebook and Yahoo can keep it.

  • David

    Ok Evan, good point ;)

    What I meant to say, was it’s a much superior language, in terms of functionality and deployability, for what it’s designed to do, than some of the alternatives, such as Perl ;)

  • David

    Zonk, maybe you’re just not good at PHP? :)

  • Duc

    >> And yes, I write both PHP, and Python, and I excel at both

    Are you sure about that? ;)

  • David

    No :(

    But I am sure about the PHP part, still fairly new to Python ;)

  • Zonk

    hehe … could be. Anything is possible, but I’ll fall back on Occam’s Razor as my defense.

    The thing is, there is nothing wrong with blaming the language as the source of the problem. Perhaps the reason PHP attracts young/noob/bad developers is because the barrier to entry is so low with respect to structure and design. A PHP file *usually* equals an HTML page. But that rule of thumbs breaks pretty quickly.

    As a professional developer you come to expect certain things from your tools. Consistency is one of them. Consistency of language constructs, of exception-handling, of file/socket/stream handling. PHP seems to go out of its way to trip you up. Python isn’t perfect in this respect, but it’s certainly *much* better.

    All the time I was using PHP I kept thinking “This is like the QWERTY keyboard. The worst possible design which evolved slowly over time. Sure I could get good at it if I keep pounding my head off the bricks; but do I want to?!”

    I don’t draw the conclusion that because PHP is bad that it implies PHP programmers are bad programmers. I don’t care about the other developers. I want my project to succeed.

    PHP, as a language and set a libraries, makes me inefficient and I don’t want to get used to wearing a hair-shirt.

  • http://anirudhsanjeev.org Anirudh

    Hi,

    I’ve been into PHP for almost two years and discovered django a week ago and love it so far.

    I personally feel that PHP is still good for quick and dirty projects and can also be used to build larger ones. In a way, it almost builds character compared to python. (http://xkcd.com/409/)

  • Wes

    Zonk, comparing your productivity as a new PHP developer to your productivity developing in Django is apples to oranges. Use a PHP web framework at the least for your comparison. Even then, it’s hard to distinguish between the gains you made because of PHP versus Python and the gains you make because of framework X versus Django.

    I personally prefer python and Django for my web application development productivity, but that it took 6 months for 50% of your PHP app and you just switched to get a version 1 doesn’t make much sense. As someone converting a PHP5 MVC (Smarty with “custom” ORM) over to Django, my experience is that Python is more fun and looks better than PHP, but Python does not turn me in to some super-productive machine compared to PHP. There are bad developers and bad applications in both.

  • Zonk

    @Wes,

    I agree with your point. I was a little concerned that my message would be misconstrued by the mention of Django.

    The reality is that I feel I was comparing apples to apples. I used Smarty as my template engine and admitted that the Django ORM was a great gain. I should also mention that I was struggling with InnoDB on MySQL for transactions under the PHP project and switched to Postgres for the Python project … which was also a speed up.

    David started with a pretty good list of problems with PHP and I’m sure a quick google would find the rest. I won’t repeat them here. But PHP started as a Coldfusion/ASP alternative for HTML pages and then tried to evolve into a standalone language. It has too much historical baggage to do that effectively.

  • David

    I agree as well, PHP has taken on a lot of baggage because of the way it started things off. Hopefully they get their act together with PHP6 and get some decent namespaces :)

    I’m in the position where I get to choose my language most of the time, but there’s legacy code, and I have a lot of projects in PHP as well as Python, and then a bunch in JavaScript. Going back and forth is a pain in the ass, but it also makes you realize how little the difference is sometimes.

  • who cares

    who cares? why would you bring this shit up. Apples and oranges people. Different use, different market, different everything. Everything has a time and a place.

  • http://metapundit.net metapundit

    I suspect at least part of the reason Python people talk smack about PHP is that a lot of them are PHP refugees.

    At least in the Django circles I think a lot of people came to Python because of Django and had previous web dev (PHP or Perl) experience (myself included: but see also David Cramer :) , Simeon Willison, Paul Bissex, etc).

    As a former primarily PHP dev I resented all the anti-PHP sentiment that floated about. I’ve got a CS degree. I wrote a framework that got out of the embed-php-in-html/one-file-per-url paradigm pretty early on… I did take security into consideration, used OOP when appropriate, made heavy use of PEAR libraries, etc etc. All that said – Django is so much cleaner than my old hand rolled framework and Python as a language is so much cleaner and more powerful than PHP – especially the PHP4 many devs targeting shared hosting were still on a year ago. And the Python community is much smarter in my experience.

    That sort of experience leads (for some) to the need to talk down PHP. If I used to use PHP and switched, it must suck, right? Or if I know lots of people who abandoned PHP, it must suck, right? I think that’s at least part of the reason Python people talk down PHP more than others (say Perl people) tend to. Of course there are a lot of Rubyists who feel the same way for the same reasons…

  • http://www.phpvietnam.net pcdinh

    @Zonk
    You are apparently not good at PHP. :D That’s fine because not everyone working with PHP find them PHP-competent. When I worked with PHP at the

    first time with Java background, I found that PHP is so messy. It turned out that I was wrong because I was not competent enough. I chose a

    messy way to work with PHP and I took my personal experience to claim that PHP was messy. After 5 years working with PHP, I found that my

    approach to software development in PHP was not relevant any more. I found I needed to change my way of programming instead PHP needed to

    change. Smarty sucks. Page-based web development sucks (not mixing PHP with HTML sucks. It doesn’t suck at all, really :D ). As of 2006, I used

    Front Controller to work with PHP in web development and it rocked. A tiny PHP code (foreach, while, if, date, for, echo and few other OOP

    helper code) mixed with HTML to build template pages making them very maintainable and extremely easy to build. Page-based web development

    abuses that kind of mixing logic and html but front controller-based does not. It just likes using Servlet with JSP but in Java you have to

    care about the difference in nature between JSP and Servlet. In PHP, it is just Plain Old PHP. Smarty sucks.

    In conclusion, you should never use PHP in messy way and say it messy. PHP is too flexible and easy to be abused. PHP is a general programming language. It does not encourage you to use it this way or that way. Frameworks do.

    Regarding to inconsistent function naming, I don’t care. Code completion rocks. Eclipse-based PDT rocks.

    Regarding to PHP namespaces, I can tell you that there are some way to simulate namespace in PHP 5.2–. You can see it in Zend Framework,

    SolarPHP framework. If you really care about built-in namespace in PHP, you can download PHP 5.3 from http://snaps.php.net and try it. This

    feature is available at the moment. Don’t wait for PHP6 if you don’t have to work with Unicode everyday.

    There is a fact in PHP world that you don’t ever need a MVC framework to make your web development more discipline. You can create a tiny one at any time without any special skill because it is so easy. Zend Framework is too bloated. To Python world, it is different, right?

    On Python
    I find that I am easily annoyed with some Python features.

    The fact that Python avails white spaces as part of variable scope and block separator makes it annoyed a lot, especially when working with

    HTML. To do it, you need to use a different template language to mix template logic code with HTML code. It is not OK all the time. Th fact

    that having to use another DSL language to make Python work with HTML more easily does not satisfy me.

    Python white spaces make me think that I have to come hack to VIM instead of using decent IDEs with features like bracket matching, code formater, bracket highlighting, code collapse….

    Also, having to assign lot of “self” as method parameter makes Python a bit poor OOP language. Why not use keyword “this” (or “self”) and make

    it available in class scope automatically?

    Also, there is not true PPP (public, private, protected) in Python making someone unsatisfied, not me. :D

    In fact, Python has a broader set of APIs in system programming, compared to PHP but it is not as relevant or flexible as PHP in web

    development. PHP has broader convenient APIs to deal with web page processing because the team behind it has invested lot of effort in many

    years to create and test them.

    No language is perfect in its design

  • Lee

    You list two serious problems with the design of PHP (globals, lack of namespace) and then state that nothing is wrong with PHP. And the fact that you think people can get more work done with Lua than Perl just shows how far you have your head up your own ass.

  • Mark

    Perl completely fucking useless. It’s not good for web apps, it’s outdone for shell scripting, and it’s not very useful as a scripting language??????
    Please tell that to a gazillion bio oriented programmers who can’t live without bio-perl, catalyst, cpan and all the perl based scripts, api’s etc etc.
    Don’t forget, a lot of python modules found their roots in perl modules. Don’t get me wrong. I mix python, c++, java and perl for the above but to classify perl as fucking useless is a slip of the tongue at least.
    (you might have noticed I banned PHP from the above ;-)

  • João Marcus

    PHP is a horrible language. It doesn’t mean that one can’t build good PHP-based web apps. It’s horrible, but it’s dead-easy to deploy and host, has lots of libs, and lots of coders.

  • david

    No. You are wrong. PHP sucks.

    Just kidding. I think it is great that ‘non-professional’ developers get into coding, if they do it via PHP, great! They will learn about more advanced languages as they traverse the software universe. It’s all good. Would I use PHP (anymore)? Never.

  • olivier

    PHP sucks. It does. Find a single programmer experienced in both PHP and python that would vouch for PHP. Find a single programmer that gleefully switched from python to PHP!

    I have programmed a lot on PHP with symfony, one the best frameworks for PHP.

    I programmed much less with python for the web but i’ve been MUCH more productive with python and django.

    PHP has never been created for big frameworks. At best it’s a botched up templating language if you want to add some dynamic features to an existing HTML page. Doing big sites like facebook or yahoo in PHP is just asking for troubles.

    If you tell people who think that python is better than php that they are not good at PHP you completely miss the point.

    Lastly, I hate the of arguments of the type: “well, no language is perfect and every language has his plus and minus sides”. This kind of reasoning will get you nowhere. It is true that python and, say, ruby are comparable and similar. It is true that python is neither better nor worse than C because they achieve different purpose.

    But it is true that python is much better than PHP. Why not admit it?

  • howard00

    Take a look at this..www.qcodo.com. I agree that PHP usually is a frikken mess, but qcodo makes it beautiful.

  • http://thisisbozeman.com Thomas

    I have been a programming for more than 25 years. I have programmed professionally in Basic, Fortran, several Assembly languages, Pascal, C, Perl, Java (i’m a certified Java programmer), PHP, Javascript, and Python.
    The language I like the LEAST is PHP (Basic and Fortran aren’t too hot either, but they’re old… like me :) . I would take Perl over PHP ANY DAY! But my Favorite language is DEFINATELY Python! Python and Django are GREAT!

  • oscar duron

    I am late to this patty (php programer) after 27 years programing (basic,dbaseIII,clipper,etc.)
    I have been searching about ruby and python because the fact there are many things about php that just make programing sometimes really hard. Yes, there was a big step on the kind of OO, and error handling routines in recent PHP releases, but late.
    All languages have obscure sides so there are many ways to compare them, all have bugs, the lack of good documentation, etc. But from all the winner is PHP with its horrible syntax.
    Now, I know PHP is the winner (popularity) but even if it were the number one in OO, the fact is that 90% or more of the PHP programers do not use or know about Objects, and of course if you check more than 90% of the php opensource apps, are only functional, not OO.
    By nature, 80% (my experience) of the php programers will never use Objects as neither relational databases and neither transactions. It took 10 years for programers to start using SQL, the same will take for php programers to start using Objects, relations and transactions. So only the real programers (redbones) and the new kids in town are getting into the wagon of OO, and in that case Ruby on Rails is to this programmers what was PHP3 in its conception in the past. So the point is, Python is the programing language for Experts, but the only chance for Python to get the popularity and support needed worldwide to get a better position is through Django, otherwise, the unstable, inmature, webtoy of Ruby on Rails will be the programming language (framework) of preference in the years to come. Either way, if you need formal, comercial, trouble free applications, you need Python, because it has already solved many problems and is stable in really hard situations. Not the same for Ruby, up to this days still have serious problems about memory, threads, networking, etc. It seem they are working on that because of Rails popularity, but it takes time, and that not counting on the serious problem of Rails itself. When PHP 6 will be ready to the level of Python? Never, because it is funcional from inside, it will have always many barriers to be ported to a 100% OO environment, and remember, they have to support more than 50% of the todays web applications working already. Why Python? please change that name, I don´t know, maybe Cobra would be a better name.

  • http://www.tylkograj.pl piotr

    I know many languages, but for me PHP is what “C” should look like. “C” idea and future has been destroyed by “pointers”.. PHP does not support this feature and… it works.
    I don’t understand where you see PHP syntax problems. For me it is so clean, almost as Pascal.

    There is a lot of messy PHP code on the net, because it is popular and can be used by amatours… because it is easy to learn and productive too.

    There are a lot of good frameworks for PHP, including CakePHP, you should try it before judging it.

    I agree with Oscar Duron that it can be a problem to introduce OOP in a large scale to PHP world. In Object Pascal OOP was the only solution, so there was no possible exception (Turbo Vision). In PHP you can even have problems with finding good structured code (functions) because you can mix HTML with PHP. But it doesn’t mean you cannot do it correctly by yourself.

    Python has many nice features – I’m not using it, but I have read many articles about it. The only thing I really hate in this language that stops me from trying it is it’s positional syntax (white space shouldn’t mean anything important).

  • tim

    @pcdinh

    see pydev for Eclipse, includes code completion for python.

    In PHP’s defence it has (many) rough edges but it came be written used properly, Zend Framework provides a very good MVC implementation and web applications can be written entirely OO. That said of recently started using Django.

    For my latest project we started with PHP5 + Zend Framework after we had a simple prototype we where not entirely happy and have since ported the application to DJANGO. I’ve only been using it for a week, but I don’t think php will ever get a look in again.

    Another big thing that has yet to be touched on here is that in a large scale web application there is always going to be a requirement for background processing, be it triggered by the db or a cron job, while php can technically be used for this task Python is a fair better solution. Personally I’d rather stick to one language for a project so just on this point PHP not an option.

  • brnotice

    @tim

    Take a look at Komodo… it have conde completion (for PHP and ZEND FW and even DOJO) and if im not mistake it have for Python to (and a buch of others JS libs)…. I prefere komodo over eclipse cose eclipse are not very good for “non-java”… (my opnion)

    @For Everybody…

    My today program base is a combination of PHP5 + ZF + DOJO with MVC and OO.
    (LA[Mysql, Postgres and Oracle depending on the project]P)

    It generates a VERY clean and fast code. Its quite easy to deploy new developers in the projects (cose the timeline for learning is sort) and if u keep a CMM control U will never get the “PHP listed problens” (at least not the ones listed here)!

    One thing most be clear… neither python or perl are originali designed to be focus on web dev like PHP… Where many ppl point weakness i see strength the language are not bad… Almost all complains in here are about BAD DEVELOPERS and that has nothing to do with the language… its like blaming a car cose it have a bad driver…. and after all it gets out of the context.

    I like perl and besides its “outdate” I would prefer it over python any day…

    I dont see much of again in python and i REALY HATE positional syntax plus other already listed stuffs.

  • Jerome

    Wonderful post. PHP truly doesn’t suck, it’s more useful all the time. it does attract a lot of new developers, but bashing it simply because some people write lousy code is a bit meaningless.

    Perl is the new COBOL, and Python and Ruby are great in their own ways but considering I’m not an OO fanatic, not very useful for me.

  • Please Take Into Consideration

    I do not see why all this fuss is about. The first programming language I learned was PHP, and it was fun and easy. Then I switched to python and loved it too. Right now I am trying java and it is a pain in the ass, but never the less I do not think it sucks. To say PHP sucks is like saying Perl or C suck(most funcionality and syntax is the same), so if you are of that opinion, go ahead and rant about your problem with learning a wide spread language. Oh, and for the note, I think that using Visual Basic and other M$-wanna-be-a-programmer software is plain retarded, and is not programming at all, it is mouse clicking.

  • Please Take Into Consideration

    *I apologize for the type I meant to say “nevertheless” not “never the less” and for being a bit harsh, maybe it is because I do not get why people think some languages are better than others and so they must suck. Example, my friend loves C# and he thought that PHP is just gay, today he apologized for being a dick and acknowledge his mistake.

  • http://salaamIT.000webhost.info Hafiz

    Hi and Salaam, (Specially to Zonk)
    I am PHP developer thinking of migrating to Python for Google App Engine. Mr. Zonk I want to say you that if you are tools dependent developer than tell me I hope that I will be able to make that application in a single month. No matter what it is?
    Never say PHP developers are bad programmers because programming is not tool dependent. No doubt good tool is important but programming approaches depends on person. Any way I am also a big fan of Python but I think this was not PHP’s weekness that you were not able to complete that app in PHP.

  • blitz

    Dude… no real statistics or facts(only personal experiences/grudges) and still you people manage to bitch about programming languages and that too about programming languages that can(and do) change so dramatically every year.

    Wouldn’t constructive criticism be a better option so the PHP/python/perl people get ideas to better their languages and the developers get better reference about “applicability” of a language for their own project.

    PS: some of the comments were actually good and had a better perspective on why people would want to compare programming languages at all. I have done c, c++, vb, asp, jsp, php, python, java, flash/flex and I love/hate them all for different reasons.

  • Rick

    I’m experienced in PHP and not so much in Python. The reason why I’m not that experienced in Python is because I hate its indentation-based blocks and IMHO-stupid rules on how a program should be written. Just having to type “pass” because I want to modify a block is horribly annoying. If I want to debug a PHP script, all I have to do is comment an if or replace the line with an “if true/false”. In Python I have to change the line to add/remove the pass statement.

    This is why I haven’t dedicated myself to study python that much. I only use it when it’s REALLY necessary. And for webapps, well, PHP suffices.

    This is not about how good or bad a language is. What we see here is that there are two completely different scripting languages, each one with its own syntax problems. I like PHP syntax much better because it’s very similar to C++, and with the extra benefit of variables always starting with a dollar sign.

    PHP was never meant to be a general-purpose programming language. Python was. This is why you can interface Python with Qt4, while to do that in PHP well it’s… let’s leave it at that.

    I think it’s unfair to qualify PHP just because it doesn’t restrict you to do something. If you want training wheels for your coding, well that’s YOUR problem. Other people prefer to write our own PHP-based frameworks using PHP as its own template engine. And you know what? It rocks.

    With a good framework design you can completely forget about too many global variables. Anyway, who writes each module as a standalone script? All my scripts declare their own modules (they don’t even have to be classes! A global function would do, even when it’s not recommended) and pass them to the main framework. And it doesn’t have to be Zend Framework, it can be your hello_world framework for that matter.
    Add the savant template engine (or a similar one) and your templates are easy to maintain. Add a good SQL library for PHP (I use a customized php_mysql with support for MySQL transactions) and you can have all your SQL statements in one place.

    Easy MVC using minimal effort in PHP. There. Was that so hard?

    So this “PHP sucks because most PHP programs suck” is simply a straw man.

    So let’s get to the REAL questions.

    What’s the memory usage of PHP compared to Python for a web application? What are the speed differences of equivalent programs? How does Python’s multithreading approach compare to PHP? Is it actually recommended for a web application to use a multithreaded approach? Yes/No/Why? Can PHP be used in embedded applications? Can Python? How do they fare to Perl? Is PHP scalable? Is Python?

    I came here looking for answers to these questions and what I found instead was a programming language flame war. I’d really appreciate the author if he submitted a link where I can find answers for my questions.

    Thank you.

  • http://www.visual-blade.com Daquan Wright

    That’s why you focus on “programming” before you focus on “PHP”. Any language can be written insecurely or securely.

    Would you blame the model of car if the driver screwed it up?

    Learning programming basics and how to code appropriately would keep PHP code in check, at least to a degree. Besides, PHP now has namespaces and it is improving.

    I’m a rather new developer myself, I just wish PHP forced me to declare variables.

  • http://doru.mp Doru

    “There are only two kinds of languages: the ones people complain about and the ones nobody uses.” ~ Bjarne Stroustrup

  • http://lol.com lol

    I like that comment by “Doru” :( ) lol

  • ifubad

    If you don’t have the experience to put a gun back together properly, it misfires and shoot your nuts off, who is to blame? Not the gun.

  • http://www.mahbubblog.com Mahbub

    I think the opportunity of bringing more and more non-programmers into web development with PHP created this issue of absuing PHP. People who did Perl and then PHP know that PHP is a blessing compared to PERL. And after doing years of PHP, you finally feel like having more challenge and try python and find that things are mostly ALREADY DONE in Python. But using PHP with a strict framework like Zend will of course make not “NOT SUCK”. And people who are trying to scold PHP should look around on the web development. It’s the PHP which brought web apps this far. Find me a better free blog than WordPress in other langs, find me better free CMS than Joomla, Concrete in other langs. It’s hard, right ? So instead of being after PHP for it’s bad sides, learn PHP deeply and you can make things much better.

  • http://nowebsite vlad

    So I could not find in any comments about PHP being inferior the exact reasons.
    Django is web development framework

    So Django+Python= PHP+CodeIgniter+Doctrine

    (http://www.doctrine-project.org/)

    I have now written thousands of line of javascript code and PHP, I have not generated
    a single form (except login) in PHP
    my PHP is web service with Post/GET/put support and various other functions.

    Reusable code sits in libraries (under codeiginter ‘libraries’ or ‘functions’)
    In classes, of course.
    My User account classes inherit from IAccount and then specialize the behavior
    for different types of users.

    My database subsystem designed to connect
    to different database instance based on
    hash of user ID, and then also check in cache
    (using PHP built in APC caching) if the data
    is already there before connecting.

    I have Collections of various objects that
    inherit from IteratorAggregate to insure
    I can use my collections as first class arrays.


    class CWFPagesDef implements IteratorAggregate

    I am getting ready to change some code
    to use closures available in PHP 5.3

    My web pages are separated into
    “viewes” under codeigniter and have only
    one in-html substitution –
    and that is where to get the Dojo packages

    So what is in PHP that is so inferior
    to Python?

    Yes, some times I miss the type system (I have been programming C++ and now C++ Boost
    with neworking and asynch programming for many years) —
    I miss compile time verification of my programs, templates and the ‘const’ function
    arguments. But they are not in Python either.

    PYthon has quite a bit more libraries
    for numerical applications, and I am planning
    to use PyTables just for that reason

    but I just do not see why Python+Django is
    some how superior to PHP with MVC framework and an ORM

  • Simón

    You suck, like most people who write on his blog about “something vs someotherthing”.
    I agree that all Texas people are rednecks, but I was actually browsing the web to find something more consistent about PHP and Python to help me take the decision to go for one or the other.
    Your post started well, you said you were against stereotypes, and I thought you were just about to provide some insights into the matter, but you only said that.
    I hate people who says they hate stereotypes all the time without providing anything valuable to the discussion.

  • David

    The post was meant to the make the point that both languages provide strengths, and weaknesses, and either will work just fine for web development.

  • BillyMcCool

    PHP is a very flexible programming language. I think for this reason lots of self proclaimed “expert” programmers love to hate it because they have moved on to more structured languages like jsp or python. However lets not forget the following. Every language has its pros and cons. PHP powers the 2nd and 3rd largest websites in the world, those being Yahoo and Facebook and Google uses lots of PHP as well. To call a language that powers a very large percentage of the webs dynamic content “crap” ridiculous.

  • Kendon

    I don’t see why people get their panties in a fucking bunch over programming languages. It’s just a language, I like PHP.
    I mean, come on, I don’t bitch about Python a whole lot, why do you even give a shit about a language, nobody really wants to hear your opinion anyway. So you can stop being asses about what someone else uses.

    If I want to use Brainfuck to program on my server, so fucking be it.

  • Tota

    Hi all,

    PHP, Ruby and Python are not so good languages. But !!! read on !!!

    Wrongs abt php
    ————–
    1) Can u tell me how many bytes of an uploaded file are transferred gradually to the server using PHP? No u can’t.
    2) Can u make sofisticated application in php standalone graphics using Gtk? No u can’t.
    3) Can u have so many of 3rd party libraries for PHP for acheving tuf tasks in maths, science in php? No u can’t.

    Wrongs abt python
    —————–
    1) Can u tell why there is no proper exception handling?
    2) Can u tell where are public,private,protected?
    3) Can u easily deploy python web apps?
    4) using Self. always?
    5) Proper design pattern implementation?

    Wrongs abt Ruby
    —————
    1) No proper libraries on many a areas
    2) Low speed
    3) Multitasking

    Conclusion
    ———-
    Ruby has good OO concepts than python or PHP. But the language is slow for complex tasks. Also, Ruby has some syntactic sugar that saves time. Very less libraries are there. PHP is good but somethings we can’t do in php well. Also, all scripting languages suk to some extent when u want to do refactoring.

    So till such time Ruby picks up speed, libraries and mutlitasking, optional type setting issues, I am with python and pylons framework. (Django is ok but not so good)

    Also, u guys check out web2py (good framework with average Data abstraction layer), unladenswallow (for speed), Wxpython (graphics) projects. These are very promising.

    Python can get ur work done with lots of libraries in its hand and is more cleaner than perl.

    I have nothing wrong to say abt perl but just can say that a very capable language that is not in trend now. Most programmers don’t like it tho it can achieve anything.

    Enuf features + Enuf speed + Enuf libraries + Clean + Gets work done + good frameworks = python (at present)

    My 200 cents
    Tota

  • http://diffract.me nocivus

    @Tota How can you ask your 2nd question about PHP? PHP stands for “PHP Hypertext Preprocessor”. It basically means it was designed for the web, not to create GTK desktop applications.

    My general opinion is that you should be open-minded and use whatever language makes more sense for the problem domain you are tackling at the moment.

    IMO, all arguments about “language X sucks” are flawed by definition, since most don’t provide the end of the sentence “sucks for Y”.

    All languages are good to solve one particular problem, at least, or they would not have been invented in the first place.

  • methos495

    Ok,
    I have to interject here on this whole argument…
    Just to give some background, I am a former C/Perl/Java developer who now works entirely in PHP.

    To say that PHP is a horrible language is a complete misnomer.

    - I loved working with C, and still do, it’s powerful and does exactly what you want. The bookkeeping is an absolute nightmare. Having to allocate and deallocate memory and keep track of where you have created dynamic memory blocks, though forces you to be dilligent and careful, wastes a lot of time in development and testing.
    - Enter Perl…This is a good language. All the modules are optimized C libraries, and using the strict module, you can easily keep a good structure to your programs. It has the same syntax as C with a few added extras, and allows you to perform virtually any function. The regular expression handling is second to none, which makes its extremely useful for its primary task (reading and parsing text). It has grown over the years, and in my opinion used in places it should not have been (such as the web). But for a long time it was the only game in town. Unlike C this is an interpreted language, which meant that production times are reduced significantly and modifications are easily implemented and quickly. It also means that a chance for lazy programming is introduced.
    - Now comes Java. This is a beautiful language full of structure and a strict object oriented approach. Kept simple, Java might have been the true dominant player that it was set up to be, but the community mucked it up. Like Perl it was introduced to the web, a space that it really did not belong. The whole purpose of Java was to write a desktop application once and deploy it anywhere. Once the community got involved with EJB, J2EE, and the like, the language starting becoming bloated and unwieldy. Java zealots started making developer see nothing but Objects, and XML for all tasks, where these were not needed for most. This is a shame, because Java, with its internal bookkeeping, perl-like garbage collection, and disciplined structure, despite being semi-compiled could have been the language of choice for everything.
    - The Web forced us to start thinking about languages meant for…well the web. Here comes PHP. The new kid in town, still retaining the C-like structure. This and used correctly is quite possibly the most powerful of all languages. With the advent of the mod_php and the cli engine, PHP has what it takes be a very clean-written, useful language. And used properly can allow a developer to put together a large-scale application (web or desktop) in a very short amount of time with very little code. Again being an interpreted language like perl, with the added benefit of Polymorphism, Extensibility, and inheritance (the definition of Object Oriented), like Java, PHP becomes a language that allows you to easily shoot yourself in the foot, as well as create powerful applications for web and desktop. The low bar for entry makes this a very user-friendly yet powerful enough for a seasoned veteran. This is the reason why it has become my language of Choice.
    - As for Python. I have worked with it. It is…interesting to say the least. I have to admit I am not a fan of the forced whitespace. In my opinion, it is a step backwards reminding me of the days of Fortran in the early nineties. It is a useful language and can look very pretty. It is functional, has some very friendly nuances, but doesn’t roll off the fingers like C, Java, Perl, or PHP. The syntax is the holding point. This is definitely an administrator’s language allowing for quick programs to handle large amounts of data in a logical fashion. Very useful, and powerful, but not one that a professional developer would hang on to for long.

    In all I have to agree to agree with Nocivus. Each language has its strengths and weaknesses and using the appropriate tool for the appropriate job is truly what defines a good developer, or software engineer.

  • Stomme poes

    “There haven’t been any *real* updates to the language in quite a while (correct me if I’m wrong)”
    It’s being updated constantly. It had a period of slowness but it’s a pretty vibrant, evolving language, esp with its experimental sister language Perl 6 (not a replacement for Perl5, who is still being updated regularly).

    Moose, Catalyst, the Padre IDE… Perl is still alive and well.

  • sashi

    PHP is a simple and great web development language, much useful for beginners. I dont like to know the disadvantages of the language or its use. PHP gives just what you need to develop your own code in a simple manner, and so does the python. Whats the fact in discussing their drawbacks, when we love to code in our own language?

  • http://www.technokyle.com Kyle

    I first learned ruby and I was truly amazed on how you can code websites in a fast manner. The problem now is how you deploy your sites which makes php a winner in deployment. I still love ruby on Rails but I haven’t used it for long because more companies opt to choose php(in my country)

  • Nick

    Apples to oranges comparison. I am very good in PHP, I like it and I will continue using it. I started to learn Python recently and I really like it. But it’s a different language.

  • Meiki67

    Dear colleagues !
    First of all I have to express my shock about the sometimes primitive language on this thread. I’m happy to meet here many knowleadgeable people, but I’m not used to see “suck” an “fuck” and “shit” in discussions about useability of programming languages. Maybe that someone is disappointed about one or the other feature of a certain product, but this should not be a reason to use XXX related lanuage.
    Now to the matter :
    I’m also an “aged” programmer, lot of Assembler, Cobol, PL/I, Fortran, Pascal, VB, asp, Forth, Postscript, MUMPS etc. My preferred language is – awk ! I bought in the nineties the Thompson Automation 32-bit awk compiler (tawk – long time discontinued) and realized with it big, heavy duty data processing tasks in many fields. Why I’m on this thread ? I have here a lot of aged DSM (Digital Standard MUMPS) applications which run on a VSM VAX cluster. I have to transfer it to a “modern” environment (aka Windows Server with MS-SQL). I came to the conclusion that I have no resources to rewrite it from scratch (as I have no will to pay the $$$ license fees for Intersystems), but have a good chance to write a DSM interpreter/compiler which simulates ^Global access (MUMPS lingo for data base tables) in an SQL environment.
    I’ve loved to do it in tawk, but since this product is discontinued I have no approach to modern technologies, IP, ODBC etc. I tried gawk but don’t see here a stable product which I can use out of the box for real world applications. My next thought was PHP – which in some domains resembles awk. Therefore I landed here.
    I Would like to hear your recommendations (please without lower body part language)
    Requirements summary:
    1. I need a compiler
    2. I need modules
    3. OO – nice to have but not a must
    4. I need powerful, fast UTF-8 string handling
    5. I need access to all sorts of file system (URI)
    6. I need access to database systems
    7. I need both raw level IP socket support and hight level xxTP (SMTP, HTTP, …) support
    8. Multithreading would be an advantage
    9. A clever IDE would be nice – but not a must
    10. It may cost money – but not a must (-;)
    Yours,
    Meiki

  • TruthHunter

    I came here because I was want to upgrade my skills to handle a modern Web language. I wanted specific info to help me decide whether to go with PHP,Ruby, or Python. It is difficult to find helpful comparisons. I will probably go with PHPif I can find a suitable Development Framework(Qcodo? thanks for the tip).

    My reasons have to do with accessibility and ease of entry. A C based syntax is a big plus based on previous exposure to C and Java. For me learning a new syntax and incompatibility of whitespace with HTML will probably keep me away from Python. After scanning through a text on Python I like it, but think its just too alien to what I already know. Most of my computer career has involved things other than programming.

    ROR looks interesting and efficient, but syntax(it show is Japanese roots!),speed, limited usage will probably keep me away. from it.

  • http://childparenting.about.com/cs/behaviorproblems/a/whining.htm whining kids

    You sound like a bunch of whining kids. If don’t have the balls to make your choice without talking something down — refer to first sentence.

    If I give you a 90-pound-7-feet European medieval sword, that won’t make you a Crusader. You’ll be a kid whining how heavy the sword is.

    If I give you a katana, that won’t make you a samurai. You’ll be a kid whining how short the sword is.

    Either way, if you ever meet samurai or Crusader, whatever sword you have in your hands, you don’t stand a chance.

    Programming language is a tool. It’s your job to learn how to use it. Whenever I hear “______ sucks!”, I know I’m dealing with an amateur.

  • http://sex.com from reddit

    Here’s something from reddit on the same subject:

    “These kind of debates remind me of a story I once heard about Formula 1 champion Graham Hill. He was hired by a British auto magazine as a reviewer, but it didn’t work out because no matter what kind of car they gave him to drive, he was always able to get it to do what he wanted, hence he was never able to be sufficiently critical for the job of a reviewer.”

  • dink

    you fucking excel at stroking your own ego.

  • http://jacobbeasley.com/ Jacob Beasley

    All of the most recent “big sites” have been PHP based: Facebook, MySpace, Youtube, and not Twitter (see http://www.radicalbehavior.com/5-question-inter... as they should have used PHP).

    So, why are the entrepreneurs using PHP? Easy. Its cheap to deploy and scales well. A PHP app can start on $5 hosting on site5.com, then move to a cloud-hosted linux server on vps.net as needed. Its scalable! Not only that, but finding PHP programmers is easy. With some basic training in security and whatnot, you can get a team of programmers setup and developing for less than in any other language.

    I've heard a number of “horror stories” from companies who build their systems in Ruby/Python but then have tons of trouble finding someone to reprogram their software. If you have any significant understanding of finance, you'll know that PHP is the way to go: its scalable and flexible.

    Yes, PHP doesn't force OOP, but THAT IS A GOOD THING! For the vast majority of web systems, OOP is overkill! I'll take Procedural PHP + Smarty Templating + MySQL over some complex OOP system anyday.

    Oh, and I've been programming for years; I'm not a big Ruby/Python guy, but I've programmed in Perl and concur with the author. Perl is too outdated to be of much practical use for the web, though some of the math functions are useful for people writing things in the fields of engineering. Its decently fast if you know what you're doing.

  • http://fuck.you/ Tom

    you don't excel at trolling, you should try harder. loser.

  • TOM THE GOD OF POINTER.

    Pointers did not “destroy” c. In fact you all use pointers when you're programming in a high level. They exist in the machine code in the image of your interpreter. They exist in your intermediate assembly code. If you can't do pointers, GTFO of programming.

  • SE

    Wrong:

    Twitter – Ruby, and now Scala (an awsome language that runs on the JVM)
    MySpace – ColdFusion
    YouTube – Python

    Facebook is the only major PHP site. That's not to say that there aren't tons of big sites running PHP, just that three out of the four sites you mentioned are not among them.

    PHP doesn't scale well, that's why Facebook had to rewrite the whole language in C++. But Ruby doesn't scale well either, which is why Twitter switched to Scala which kicks all these languages asses — it's even as fast or faster than Java on it's own JVM.

    OOP, which is, at the end of the day, a programming paradigm that promotes sensible design and code reuse, is never overkill. Only someone who knows nothing about OOP would say such a thing. OOP only looks complex because you obviously know nothing about OOP.

    PHP has a horrible OOP implementation and it is generally better to not use OOP in a PHP application — at least as long as it's not a big application. Big PHP apps tend to devolve into Perlish spaghetti code very fast without the structural discipline that OOP can provide.

    PHP is a “good enough” and “fast enough” language that is easy to learn and easily deployed, that's why it's popular. PHP code can be clean and readable and efficient, when it's written by someone who knows what they're doing. It's also doesn't “suck”. But so what? It's still a mediocre language and a refuge for mediocre programmers.

  • http://www.davidcramer.net David Cramer

    I thought MySpace was .NET?

  • SE

    I guess we're both right, but MySpace originally ran on ColdFusion, which is a Java technology.

    http://www.itwriting.com/blog/?postid=397

    “MySpace uses a product called BlueDragon, which lets you run ColdFusion pages on either J2EE or .NET – without using the official ColdFusion application server. In this case, the CFML markup is actually running on .NET.”

  • http://www.contussupport.com Php Programmer

    PHP is really no match to Python. I have been PHP developer for 3 years and switched to python because i feel Python is more like a hybrid language. Because of python flexibility features i can easily scale.

  • Franklin

    I program in Python and PHP. PHP just has a bad rap and a bad history. It has only recently begun to fully support true object oriented structures and patterns (v5.2). You can program and optimize as cleanly as you like (or not).

    Check out:
    http://www.amazon.com/PHP-Objects-Patterns-Prac...

  • Sdsdsdsd

    Why I don't use Python? Because I need to pay x5 times to be able to install an good Python app. Shell access needs money !!!

  • http://www.air-jordan-10.com/ air jordan 10

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum! http://spoon8.net/

  • Specialedx

    People from TX are Rednecks… LOLZ

  • http://www.uggs-outlet-store.com UGG boots

    I am also a XX fan who really like this! I also like XX, and purchase lots of it every time,
    <a href=” http://www.eeadie.com“ >eeadie
    like-minded friends can have a look ,we can communicate by the way~~

  • http://www.nike-air-force-one.com air force 1 shoes

    I am agree with landlord, many of us are not too concerned about sports news. As the World Cup. Many of us are also don't know what it is.I believe once you go to see some sports news,you will love sports.By the way ,I know some websites content is very well.But I don’t know how to choose.Can you help me?The website are Air force 1 high

  • http://www.cheap-nikeshox.com/nike-shox-TL3.html air force 1 shoes

    The post of content is very interesting and exciting. I learned a lot from here.The content from simple to complex, so all of you can come in . No matter you want to see what can Nike air force be found

  • http://www.discountbootsonsale.co.uk ugg boots

    Mark S. is definitely on the right track. If you want to get a professional looking email address, Id recommend buying your name domain name, like or
    ajf 13
    If its common it might be difficult to get, however, be creative and you can usually find something.

  • http://www.air-jordan-19.com air jordan 19

    “Here air jordan 21 products xx, has fashion model, superior quality and service, cheap price and updates quickly.I support strongly always! I want to buy XX, I hesitate to select which style more better.Hope your unique recommends.

  • http://www.saleboots.co.uk ugg sale

    Mark S. is definitely on the right track. If you want to get a professional looking email address, Id recommend buying your name domain name, like or
    discount ugg boots
    If its common it might be difficult to get, however, be creative and you can usually find something.

  • http://twitter.com/MarcDemierre Marc Demierre

    Hi !
    I am an IT student my background in programming is the following : started with basic C, then procedural PHP to build websites, then Java at school, batch and VBScript for windows scripts (worst languages I’ve ever seen), Object Oriented PHP + Zend Framework to build better web apps, C# for personal projects (XNA Games) and now Python + Django for an internship project.

    Here is my opinion about the web languages :
    - PHP is available on a lot of free and commercial hosting plateforms. It is now object oriented. The Zend Framework (or others) an OOP allow us to produce standardized and clear code. The PHPDoc is a cool tool (like the Javadoc, best code documentation I’ve ever used) BUT : the typing could lead to errors, the standard library seems to have no convention for function names, the unicode handling is approximative in some functions, I don’t like the dollar sign :) .
    - Python has a module and namespaces functionality which is better than PHP. It is also a general programming language, so you can use your knowledge to build other apps than web. It is strong typed. It is totally object oriented. It has multithreading and can run on an apache in worker mode. It has functional programming. It has better performance. Finally, it has the Django web framework, which is really an awesome product and allows to code big web application in a very short time. The standard docstrings are not very good, but epydoc or doxygen are here to correct this issue. BUT : the major problem is that it is available by only a few hosting companies (less with Django). It doesn’t have a real private-protected functionnality.

    Now, as I said PHP doesn’t suck. I really like the Zend Framework and without it for me PHP would suck^^. I am more experienced with PHP than Python and I produced good application with it. It is the best for personal projects if you want free hosting.

    But try Python with Django. It is so awesome that after trying it PHP, even with the Zend Framework, looks like “shit”, as some people say. If I could choose, I’d surely use Python. Maybe my opinion could change after trying the PHP Symphony framework, but I don’t think so. I think that PHP has too many problems coming from its past but it is slowly improving.

    Basically, these two languages allow you to do very crappy code if you want. But for me the most important is to write clean and well organized code. For web applications, unless you build youtube other big sites, the language is secondary. Take the one which fits the project needs the best.

    Yours,
    Marc

blog comments powered by Disqus