• beentheredonethat (unregistered) in reply to cfreak
    cfreak:
    PHP took the worst ideas from Java, Perl and C. Then they blended it together and called a language.
    What a load of rubbish. If the post wasn't as long as it is I would pin you with the troll tag.

    There are very clear directions on how they recommend that you do it, but as with e.g. Perl it's a very open language that has evolved and as with anything with free ranges of creativity allowed the results you see in different places are filling all the imaginable space.

    Every bleeding programming language have flaws and forces and those who actually works with them knows them, so why even waste time raging about language X because you like language Y when someone else could easily turn the boat around?

    Just my two bytes ...

    PS: I couldn't name a language where the exact same code couldn't be implemented in the exact same crappy way by a bad programmer - ie. not a language problem.

  • RogerWilco (unregistered) in reply to mos

    I agree PHP is bad, although if careful, you can write decent code in it.

    What I wonder is, why is it so extremely popular if other options like Python or Ruby are more sane? What did PHP do right to make it so popular despite its flaws?

  • John Winters (unregistered)

    I bet that code started life as:

    <?php $thisyear=date("Y"); $lastyear=date("Y")-1; ?>

    and then a year later it had to be "enhanced", then "enhanced" again, etc.

  • Sylver (unregistered) in reply to PHPGangsta
    PHPGangsta:
    Last week I wrote code to display a drop-down-field for birthday, with the last 120 years (1890-2010). That was done with a few (~5 or so) lines of code.

    Would be interesting to see this in your notation. Great code example!

    Watch out! Next thing you know, the guy will remove all line breaks and get everything in a single line

  • Mate (unregistered)

    I swear this is the last, last, last, last, last year I'm going to add one of these lines in the code.

  • Adam Jorgensen (unregistered) in reply to RogerWilco

    It's really simple actually. PHP in the form of the mod_php apache module is pretty installed by default along with apache. All the config is already done and getting up and running is as simple as putting php files in your document root and testing them.

    This makes for a really low entry barrier for PHP development. Add to this the fact that it's easy to produce output with PHP and you have what could be described as the ideal Get Stuff Done Fast solution.

    While both Python and Ruby can be used for the same purpose, neither is as simple to get off the ground. Both require additional setup in some form or other and those additional setups tend not to be installed as server default software.

    As for PHP as a language: Yes, it's ugly and all mixed up, but it isn't actually crap. On the contrary, it's very easy to get a lot done quickly with a fairly small amount of PHP code thanks to the fairly bare-metal, get-your-hands-dirty-fast approach to producing output.

    What is true is that most PHP programmers are crap and the PHP coding community takes cargo cult coding to a whole new level, never mind the huge pool of poorly written stock solution software out there (Joomla, Drupal, CakePHP, Symfony, etc, etc)

    Personally, my take having switched from Java web dev to PHP web dev. Don't knock the language. Sure, it's ugly, jumbled and a result of much evolution and kludging but it's also a quicker, easier way to produce results than either Java, Ruby or Python in the very specific realm of web development. Take it out of the web dev niche and it's your funeral.

    Rather, knock the legion of piss-poor moron PHP coders out there producing Joomla add-ons, Virtuemart and just about every other PHP project out there.

    If you need proof that PHP can be decent, take a look at the Doctrine ORM project.

  • FirstFirstFirstFirstFirstName LastLastLastLastLastName (unregistered) in reply to Frist?

    well, it is PHP, I'm sure it works well on his personal home page.

  • Fukeesh Sanjeev (unregistered)

    In the vb++ you type the:

    Loop While (7) Then Last++ End Loop For Me

  • Anonymous (unregistered)

    Personal Home Page. That is all.

  • foo (unregistered) in reply to RogerWilco
    RogerWilco:
    I agree PHP is bad, although if careful, you can write decent code in it.

    What I wonder is, why is it so extremely popular if other options like Python or Ruby are more sane? What did PHP do right to make it so popular despite its flaws?

    It imitated ASP, where you could just throw code inline in a web page. So it got picked up by a lot of "html programmers". Yes it is possible to do good coding in php, but you really have to wonder, "why bother?"...

  • Jake (unregistered)

    I wonder at the insecurity of people who feel the need to attack PHP. It's just a tool. If you find it useful use it. If not don't.

    I suspect it's simply because people who use PHP get things done quicker than those who don't know how.

  • Brian White (unregistered) in reply to foo
    foo:
    RogerWilco:
    I agree PHP is bad, although if careful, you can write decent code in it.

    What I wonder is, why is it so extremely popular if other options like Python or Ruby are more sane? What did PHP do right to make it so popular despite its flaws?

    It imitated ASP, where you could just throw code inline in a web page. So it got picked up by a lot of "html programmers". Yes it is possible to do good coding in php, but you really have to wonder, "why bother?"...

    What is wrong with ASP? ColdFusion had the same approach. So did Vignette. They all served their purpose just fine. And they have all been used on very complex web applications.

  • CodeGuy (unregistered) in reply to frits
    frits:
    Geez, don't they realize the numberline goes in two directions?
    <?php
    $thisyear=date("Y");
    $lastyear=date("Y")-1;
    $lastlastyear=date("Y")-2;
    $lastlastlastyear=date("Y")-3;
    $lastlastlastlastyear=date("Y")-4;
    $lastlastlastlastlastyear=date("Y")-5;
    $lastlastlastlastlastlastyear=date("Y")-6;
    $lastlastlastlastlastlastlastyear=date("Y")-7;
    $nextyear=date("Y")+1;
    $nextnextyear=date("Y")+2;
    $nextnextnextyear=date("Y")+3;
    $nextnextnextnextyear=date("Y")+4;
    $nextnextnextnextnextyear=date("Y")+5;
    $nextnextnextnextnextnextyear=date("Y")+6;
    $nextnextnextnextnextnextnextyear=date("Y")+7;
    ?>
    If this code is run near midnight on Dec 31, the value of date("Y") might change halfway through the code, resulting in things like $lastyear being equal to $thisyear
  • (cs) in reply to CodeGuy
    CodeGuy:
    frits:
    Geez, don't they realize the numberline goes in two directions?
    <?php
    $thisyear=date("Y");
    $lastyear=date("Y")-1;
    $lastlastyear=date("Y")-2;
    $lastlastlastyear=date("Y")-3;
    $lastlastlastlastyear=date("Y")-4;
    $lastlastlastlastlastyear=date("Y")-5;
    $lastlastlastlastlastlastyear=date("Y")-6;
    $lastlastlastlastlastlastlastyear=date("Y")-7;
    $nextyear=date("Y")+1;
    $nextnextyear=date("Y")+2;
    $nextnextnextyear=date("Y")+3;
    $nextnextnextnextyear=date("Y")+4;
    $nextnextnextnextnextyear=date("Y")+5;
    $nextnextnextnextnextnextyear=date("Y")+6;
    $nextnextnextnextnextnextnextyear=date("Y")+7;
    ?>
    If this code is run near midnight on Dec 31, the value of date("Y") might change halfway through the code, resulting in things like $lastyear being equal to $thisyear

    Thanks for the tip.

  • Rynus_Rein (unregistered) in reply to Sylver
    Sylver:
    PHPGangsta:
    Last week I wrote code to display a drop-down-field for birthday, with the last 120 years (1890-2010). That was done with a few (~5 or so) lines of code.

    Would be interesting to see this in your notation. Great code example!

    Watch out! Next thing you know, the guy will remove all line breaks and get everything in a single line

    Actually, for such a case (dropdown for 120 years in php) I employ loop unwinding (by hand). Saves numerous proc cycles!

  • mh (unregistered) in reply to RogerWilco
    RogerWilco:
    I agree PHP is bad, although if careful, you can write decent code in it.

    What I wonder is, why is it so extremely popular if other options like Python or Ruby are more sane? What did PHP do right to make it so popular despite its flaws?

    Umnmm - howabout "because it's easy to use"? Granted it's both a strength and a weakness (which should be for obvious reasons).

  • ... (unregistered)

    Oh come on!

    This is normal on embedded systems that don't have filesystems. I must say it's brilliant. But he has forgot the year FILE_NOT_FOUND. Woooooossshhhhhhhhh

  • Jesper (unregistered)

    I was born

    lastlastlastlastlastlastlastlastlastlast lastlastlastlastlastlastlastlastlastlast lastlastlastlastlastlastlastlastlastlast lastlastlastlastlastlastlastlastyear.

  • Steve H (unregistered) in reply to Adam Jorgensen
    Adam Jorgensen:
    PHP in the form of the mod_php apache module is pretty installed by default along with apache.

    This is not true.

  • Steve H (unregistered)

    As if nobody ever wrote crap in Java, C++ etc.

    Despite 10 years in the industry, I've never met a Java developer who knew how to write a unit test, for example. TDD has been the accepted process in the last two PHP teams I've worked in. Don't even get me started on the hopeless .Net systems we have to integrate with.

  • Anonymous (unregistered) in reply to Steve H
    Steve H:
    As if nobody ever wrote crap in Java, C++ etc.

    Despite 10 years in the industry, I've never met a Java developer who knew how to write a unit test, for example. TDD has been the accepted process in the last two PHP teams I've worked in.

    So you're saying that the only effective way to work in PHP is test driven? That's not surprising in the least, in fact it makes perfect sense when you're working with a horrific bug-prone platform like PHP. You seem to be arguing that PHP is brittle but there is no need to argue, we all agree with you!

  • Rostol (unregistered) in reply to highphilosopher

    Pretty sure it was a Sunday, but dont quote me on that.

  • jimbobmcgee (unregistered) in reply to Rostol
    Rostol:
    Pretty sure it was a Sunday, but dont quote me on that.

    Oops

  • (cs) in reply to MP(Real)
    MP(Real):
    A bad PHP programmer can get things done much faster than a bad <insert other language> programmer.
    Homer: There's three ways to do things: The right way, the wrong way and the PHP way. Bart: Isn't that the wrong way? Homer: Yeah, but faster!
  • blunder (unregistered) in reply to beentheredonethat
    beentheredonethat:
    Every bleeding programming language have flaws and forces and those who actually works with them knows them, so why even waste time raging about language X because you like language Y when someone else could easily turn the boat around?

    Just my two bytes ...

    PS: I couldn't name a language where the exact same code couldn't be implemented in the exact same crappy way by a bad programmer - ie. not a language problem.

    I agree. All languages allow bad code.

    The reason people talk down about PHP and its cousins is that the problems that get solved in those languages are unglamorous from a CS standpoint. I say this as someone who primarily does PHP work, but can recognize which problems are considered the "fun" ones. Generally, it's the ones that require advanced math; reinventing the same old CRUD wheel, despite being useful and honest work, is not the sort of thing pimply-faced youths daydream about.

  • Anonymous (unregistered)

    That code is too prone to mistakes, it should be like this instead.

    <?php $thisyear=date("Y"); $lastyear=$thisyear-1; $lastlastyear=$lastyear-1; $lastlastlastyear=$lastlastyear-1; $lastlastlastlastyear=$lastlastlastyear-1; $lastlastlastlastlastyear=$lastlastlastlastyear-1; $lastlastlastlastlastlastyear=$lastlastlastlastlastyear-1; $lastlastlastlastlastlastlastyear=$lastlastlastlastlastlastyear-1; ?>
  • Fukeesh Sanjeev (unregistered) in reply to Jake

    Yes, I agree, PHP is for the getting done of it quicker, very good point, that should keep the real computer engineers quiet now

  • Franonymous (unregistered) in reply to Steve H
    Steve H:
    Adam Jorgensen:
    PHP in the form of the mod_php apache module is pretty installed by default along with apache.

    This is not true.

    So is it false, or should I consider the default case ?

  • oksupra.com (unregistered)

    Supra shoes are so popular all over the world. Whatever you take on Supra being in the Supra Skytop Shoes market. Now Supra Strapped Shoes also very popular attention. It is nice that they actually took the time to make Supra Skate Shoes that work well. Supra shoes is a brand that has been inspired, designed and marketed by passionate individuals. We have brought to you the fullest selection of Supra footwear at cheapest price. Overload Skateshop carries a wide range of Supra Shoes to fit your 9-stair kickflips.

Leave a comment on “Last, Last, Last, Last, Last, Last, Last Year”

Log In or post as a guest

Replying to comment #:

« Return to Article