• cfreak (unregistered) in reply to Tim
    Tim:
    Dear God,

    Please kill PHP.

    Sincerely,

    Everyone except PHP programmers (and VB programmers).

    I'm a PHP programmer and I wish it would die. (Fortunately I know a few other languages as well)

  • Matt Burgess (unregistered)

    Despite all the TRWTF=PHPLOL attitudes the issue here is not the language but this implementation of it. I've been a PHP programmer for many years and I like it. But there's no way in hell I'd use it to write firmware, any more than I'd use a salad fork to cut a watermelon.

    I do think PHP is in need of an enema. I was hoping PHP 6 would take the opportunity to spring clean, but sadly not. I'd love to see some redundant functions removed, and some inconsistencies cleaned up. It's clearly been built by 1000 different people, all of whom used different naming conventions, etc. strtotime, nl2br, isset, is_array, empty... what a mess.

  • wocky (unregistered)

    Normally I'm a bit-twiddling C and C++ person, but I just rendered a movie in PHP. Seriously.

    I needed to make a video that showed off a large set of images. Imagine a field of constantly changing images, spaced on a grid, and together forming a pattern given by an input bitmap. The video starts centered on one of the images and does a series of movements including a nonlinear pullout zoom, panning with acceleration, and changing the properties of individual images on the fly.

    Solution: use the PHP imaging libraries to create the frames, output them as pngs, and use VirtualDubMod to make a video out of the frames. Total code to render an awesome looking 60 second video, 186 lines. I don't know any other language with such simple but powerful image manipulation so easily at hand.

    Any decent programmer needs multiple languages. You need a near the hardware language like C or C++ for applications and game programming, as well as for scientific programming. You need a powerful symbolic language like Matlab for prototyping complex algorithms. You need a managed code language with good network support like Java or C# for building client/server systems. You need a scripting language like Python, PHP, or Perl to generate web pages or to script simple tasks that would be too painful to write out in shell. You need a client side scripting language, for which Javascript is the only real contender.

    Any of these languages can do the work of any of the others, but a competent programmer will use the right tool for the job. There are precious few languages that aren't well suited for some project or other. So yes, it's funny that someone wrote a driver in a scripting language, but that doesn't make the language a joke.

  • Michael (unregistered)

    These are all turing-complete languages we're discussing here, right? Why are we quibbling about mere things like running times that only differ by a polynomial?

  • argh (unregistered)

    I like the naming convention for the functions. If I didn't know better, I would think it's part of the PHP standard library.

  • Ben (unregistered)

    PHP is not an appropriate language for a RAID controller. It's not an appropriate language for firmware. You shouldn't write an interpretive language interpreter in PHP.

    But what PHP does do, it does quite well. It's a stable, powerful scripting language that minimize development time. It's like a cross between a RAD prototyping language and a production environment - take meaningful business logic and complex website concepts from concept to implementation in a matter of hours, with good enough performance to become a production system!

    It's a decent CLI environment, too.

    You don't do brain surgery with a 4-lb sledgehammer, you don't write firmware in PHP. But for rapid prototyping of highlevel business logic rules and "weblication" development, it's really hard to beat PHP's awesome combination of power and simplicity. Other languages come close, (perl and python jump to mind) but PHP is just really good at what it does.

    No, it's not the "purest" language around - for that, look to Pascal. But for raw "get it done" power, it really is hard to beat PHP.

  • a (unregistered)

    bad coder + your favourite language => bad code.

    kill bad coders? nah, educate them.

  • Barf 4Eva (unregistered) in reply to skin256
    skin256:
    But I use VB in the web world too, I like PHP also and C# and Perl and Python and C and C++ and Java etc...I like programming..why bash at all??

    So true. This is what I say to those who continue to chuck their tasteless diatribes at developers slightly different from themselves....

    Let him who is without spaghetti cast the first meatball.

  • Dave G. (unregistered) in reply to a
    a:
    bad coder + your favourite language => bad code.

    kill bad coders? nah, educate them.

    The problem is that most managers have difficulty distinguishing between bad coders and good coders.

    To wit: a reduction in the number of bad coders caused by, for example, their untimely demise, causes the supply curve for coders in general to shift left (bearing in mind that for most managers, a bad coder and a good coder are perfect substitutes)

    The reduction in supply of bad coders will result in increased salaries for the remaining good coders, because the equilibrium price for coders is now at a higher point on the demand curve.

    You were right the first time. Kill the bad coders.

  • v.dog (unregistered)
    So, if there was a problem that affected all eight hard drives -- say, a power issue... ...I doubt anyone actually makes it until the last step, though. It's much easier to just yank the power plug in frustration.
    Power Issues.

    The cause of and solution to all of life's problems.

  • (cs)

    When you keep hitting your fingers, is it the hammer or the nail to blame? Or maybe the shoe you're using instead?

  • Dark (unregistered) in reply to jspenguin
    jspenguin:
    %s %s: "%s" "%s" "%s" "%s" "%d" "%s" "%s" "%s" >/dev/null 2>&1
    Buffalo buffalo: buffalo Buffalo buffalo 5 Buffalo buffalo buffalo
  • Arkh (unregistered) in reply to rycamor
    rycamor:
    don't try to be clever or cute with your programs (see A and B).
    Too bad closures are coming in php. I sense a lot of WTF coming.
  • (cs) in reply to rycamor
    rycamor:
    (ducks flamewar).
    Your favourite ducks aren't as good as my favourite ducks! Mallards are rubbish! All real programmers use Mandarin ducks!
  • (cs) in reply to Matt Burgess
    Matt Burgess:
    Despite all the TRWTF=PHPLOL attitudes the issue here is not the language but this implementation of it. I've been a PHP programmer for many years and I like it. But there's no way in hell I'd use it to write firmware, any more than I'd use a salad fork to cut a watermelon.

    I do think PHP is in need of an enema. I was hoping PHP 6 would take the opportunity to spring clean, but sadly not. I'd love to see some redundant functions removed, and some inconsistencies cleaned up. It's clearly been built by 1000 different people, all of whom used different naming conventions, etc. strtotime, nl2br, isset, is_array, empty... what a mess.

    Agreed totally...

    I always wonder to myself, "Why did Oracle name a function NVL2()?" What a stupid, stupid name for a very common function in one of the most powerful, well-known, and oldest applications on the planet.

    But just because it's a stupid name doesn't mean I wouldn't use it, nor does it mean I think all of Oracle sucks.\

    PHP is the same. It has some idiotic stuff -- extract(), for example -- but if you use the language primitives and build up a platform (like Cake, Zend Framework, etc.) you can get away from that mess and create a clean foundation.

  • rycamor (unregistered) in reply to Arkh
    Arkh:
    rycamor:
    don't try to be clever or cute with your programs (see A and B).
    Too bad closures are coming in php. I sense a lot of WTF coming.

    Ahem... I think the sort of PHP programmers that produce most WTFs don't even have the slightest idea what a closure is.

    Of course, closures are one of those "a little knowledge is a dangerous thing" problems. They are great solutions to certain types of problems, especially for event-driven programming, but are a rich source of Failidity when used gratuitously.

  • Sigivald (unregistered) in reply to rycamor
    rycamore:
    The whole concept of firmware runs completely counter to the idea of scripting languages.

    I believe "firmware" here is being used loosely to mean "embedded software".

    I suspect the "RAID controller" here is not a RAID controller card, but a NAS box. (After all, cards don't typically have an LCD; detached server boxes are pretty likely to.)

    In that case, the "firmware" is doubtless the whole OS; probably linux + apache (possibly + DAV) + samba.

    Which means they probably already have php for their webpage/admin stuff, so why not have one of their PHP guys write the driver for the LCD?

    (Turns out the reason is "because he won't do performance testing", but...)

  • (cs)

    When all you have is a swamp, every problem looks like it can be solved through desktop search.

  • Matthew (unregistered) in reply to Hivemind
    Hivemind:
    I'm an IT geek whose primary language is PHP *ducks* Though I've never done anything like this, I at least know when to NOT use PHP. For shell scripting - yes, anything browser-based - ok. but that? hell no.

    sigh

    For shell scripting?? You need to be shot.

  • iToad (unregistered) in reply to Zach Bora
    Zach Bora:
    http://ca.php.net/manual/en/preface.php:
    http://ca.php.net/manual/en/preface.php PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Its syntax draws upon C, Java, and Perl, and is easy to learn. The main goal of the language is to allow web developers to write dynamically generated web pages quickly, but you can do much more with PHP.

    the sky is the limit!

    Suggested additional areas for PHP use:

    • Avionics
    • Medical devices
    • Weapons control systems
    • Nuclear power plant emergency shutdown systems
    • Pharmaceutical plant control
    • Chemical plant or refinery operations
  • (cs) in reply to Tim
    #!/usr/bin/php -q
    
    <?php
    
    $langs = Array("C", "C++", "PHP", "Perl", "Python", "Ruby", "Java", "VB", "C#", "Lua", "Delphi");
    $lang1num = rand(0, count($langs) - 1);
    $lang2num = rand(0, count($langs) - 1);
    while ($lang2num == $lang1num) $lang2num = rand(0, count($langs) - 1);
    
    $lang1 = $langs[$lang1num];
    $lang2 = $langs[$lang2num];
    
    print "Dear God,\n\n".
    "Please kill $lang1.\n\n".
    "Sincerely,\n\n".
    "Everyone except $lang1 programmers (and $lang2 programmers).\n\n";
    
    ?>
    
  • Egon_Freeman (unregistered) in reply to Hivemind

    I'm a "PHP programmer", and that is to say I write Win32 apps in PHP. I know, double-kill: PHP + Win32. But it works.

    When I need to do something that stupid, though - I build an extension. PHP wasn't designed to do this, I agree completely. PHP wasn't designed to do a LOT of things, it's just that the language and a lot of its constructs/extensions are written in a way that does not implicitly disallow it (not that I'm complaining, do mind). And it is a helluva lot easier than C...

    But then, there's a reason why C exists in the first place, and this program is it. :D

    I've also dropped exec() in favor of the more native StartProcess() from w32kernel (had to write my own ext. to do it, though).

  • 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.

  • (cs)

    If all eight disk drives had lost power at once, wouldn't the controller probably have lost power too?

Leave a comment on “Raiding the RAID”

Log In or post as a guest

Replying to comment #:

« Return to Article