ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Is PHP a "good" computer language

May 21, 2008 10:28pm

Subscribe [8]
  • #1 / May 21, 2008 10:28pm

    Chris Malumphy

    16 posts

    PHP Sucks, But It Doesn’t Matter is an interesting article about the language itself. I wonder what the ExpressionEngine developers think. The article does point out some of the post popular software products made with PHP.

  • #2 / May 22, 2008 2:27am

    John Fuller

    779 posts

    Chris, Yes.

  • #3 / May 22, 2008 2:50am

    Rick Ellis

    107 posts

    I wonder what the ExpressionEngine developers think. The article does point out some of the post popular software products made with PHP.

    Someone in that thread quoted the developer of the C++ language as saying that there are only two types of programming languages, those that people complain about and those that no one use.  There’s a lot of truth to that.

    Programming languages are a lot like human languages.  They all have their quirks, their strengths, their oddities. Spanish is a gorgeous language for poetry, but it’s not well suited for the hard sciences.  Does that mean Spanish sucks?

    PHP evolved from a simple macro language, and its development has had an interesting history, with lots of twists and turns.  It did not emerge fully formed, as some languages do, nor was it originally even conceived as a “real” programming language.  That came later.  Heck, it wasn’t even an object oriented language until version 5, and even then it missed the mark in many ways.

    None of that matters, though.  PHP is the de-facto programming language of the internet.  It’s supported in nearly 100% of hosting environments, it offers people the most choices of applications, and the barriers to people learning and using it are low.  It also has an endless number of pre-built functions designed for the kinds of things web developers need to do, so it saves us time.  And (most important, possibly) their user guide is hands down the best of any language.

    I happen to like PHP a lot, not because I’m blind to its shortcomings, but because it offers a lot more positives then negatives, and it allows me to offer web applications that are usable to the broadest audience possible.

  • #4 / May 22, 2008 10:24pm

    Chris Malumphy

    16 posts

    John thanks for your link and Rick ditto for the post.

    One thing I love about the EllisLabs team is that you always get well thought out responses to questions, even those that are off topic like this. I myself think that PHP is pretty cool. The author of the article seems to bemoan the large number (hodge/podge) of functions available in PHP listing all those that begin with the letter “a”. To me that is one of its benefits, not disadvantages. Find the right PHP function and tons of programming/scripting time is saved. I wholeheartedly accept the notion that we should always adopt the best available tool for the job.

    Victor,

    I get your point, but note that the Wikipedia links you cited say:

    “In computer programming an interpreted language is a programming language whose ... ” and “A compiled language is a programming language whose ... “

    So according to Wikipedia both interpreted and compiled languages are programming languages.

    I started out in the old days with BASIC way back in high school before personal computers were a twinkle in anyone’s eye. Later, on my Apple II+, BASIC was interpreted. Now I use REALBasic on my G5, which is compiled. So BASIC made the transition from interpreted to compiled, but it has always just been programming to me. You might call PHP a scripting language, since it isn’t compiled, but when I use it, I’m programming (at least in my mind).

  • #5 / Jun 02, 2008 4:05am

    Andrew Hedges

    12 posts

    Yeah, it’s a little silly to say PHP isn’t a programming language. If it’s not programming, what is it, exactly? Sure, it’s not compiled, but neither are shell scripts. Python is interpreted on first run, then byte-compiled. Is Python not a programming language?

    Anyway, yes, PHP sucks, but it doesn’t matter. As Rick so aptly said, it’s the de-facto language of the internet. That counts for a lot. It also counts for a lot that the syntax is quite similar to the _other_ de-facto language of the internet, JavaScript. IMHO, this is likely one of the reasons for it’s ubiquity. Coders who started out hacking a little JavaScript can more easily make the jump to PHP compared to, say, Ruby or Python.

    And, I agree that the high quality of PHP.net is another big reason for PHP’s success. I liked it enough to make a Dashboard widget for it!  :cheese:

  • #6 / Jun 02, 2008 7:28am

    Andy Harris

    958 posts

    I liked it enough to make a Dashboard widget for it!  :cheese:

    And a fine widget it is too, cheers!

  • #7 / Sep 04, 2008 4:42pm

    Bjørn Børresen

    629 posts

    You can do all the stuff you do with rails (ruby) and django (python) in PHP, the difference is that PHP makes it easy to write crappy code - rails & django make it hard 😉 A bit simplified, but still ..

    I think a lot of the reason why PHP has become so popular is the low treshold to get started. Anyone can get started without knowing programming or theory about OO.

    There are a lot of frameworks for PHP as well, which help a lot. Examples are CodeIgniter (of course), Zend Framework and CakePHP.

    - bjorn

  • #8 / Sep 05, 2008 3:33am

    John Fuller

    779 posts

    You can do all the stuff you do with rails (ruby) and django (python) in PHP, the difference is that PHP makes it easy to write crappy code - rails & django make it hard 😉 A bit simplified, but still ..

    This seems to be a somewhat common argument from developers but I think it has limited relevance in the real world.  Not that I even agree with this statement.  Ruby on Rails is not going to turn a bad programmer into a good one.  If that were the case, we should all be using ROR.  I’m sure I could show you crappy Ruby and Python code, probably something that I wrote.  😉

    The fix to this problem seems to be simple enough.  Don’t hire crappy coders.

    If you are a DIY person with no experience in any area of web dev, you will probably create a crappy design, crappy HTML/CSS and crappy PHP (if needed.)  The same is likely true if you pick up a “will code for food” guy in front of a 7-11. 

    Hire good people and they will do good work.  Sometimes knowing who is good can be hard, but that is a different discussion.

  • #9 / Sep 05, 2008 3:45am

    Bjørn Børresen

    629 posts

    Sure, a crappy coder will write crappy code, no matter which language he/she is using. It’s not hard to agree on that one 😊

    I love PHP, don’t get me wrong, but it’s still the devil 😉 It’s the little devil on your left shoulder asking you to take that little shortcut, it doesn’t matter. It’s the little devil telling you that writing unit tests aren’t that important, and if you _must_ you’ll have to set it up yourself. RoR is the angel notifying you that _you haven’t written_ unit tests for those and those classes, and reminding you that maybe you should.

    Sure, one can probably find frameworks for PHP that does much of this.

    I’ve never tried RoR, but this is the impression I get. Maybe I’m mistaken, maybe it’s all hype about rails.

    I come from a Java world and going directly to PHP was probably more challenging than starting from scratch 😉 heh .. That said, PHP is definitively a language to get things done, and that’s what I like about it.

    - bjorn

  • #10 / May 11, 2009 6:20pm

    bkuberek

    124 posts

    Great topic. I happened to be doing a search on PHP Unit Testing and found this thread (actually was the only result). I agree with most of you, PHP like any other language is tied to the programmer’s ability to create a good program. The difference is that you don’t need to be a programmer to write PHP 😉. That’s why PHP has a bad reputation among “real programmers”.

    Now just a little bit off topic, since I believe people in this thread will be able to help me.

    We are using PHP Unit to do unit testing on our CI Application. I was wondering if I could do the same for EE or there is something else available that will work better. Things I want to test are custom Addons we write and perhaps just the business logic of some templates.

    Thanks a lot

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases