|
|
Subscribe / Log in / New account

PHP 5.4.0 released

PHP 5.4.0 released

Posted Mar 2, 2012 22:22 UTC (Fri) by khim (subscriber, #9252)
In reply to: PHP 5.4.0 released by Kit
Parent article: PHP 5.4.0 released

It was discussed many times. PHP is completely build around violation of Rule of Repair - that's what makes it “suitable for non-developers” and that some thing also means it's turing tarpit.

It's much easier to create half-working prototype in PHP, but to create production-quality code you need not only fight the task at hand but you need to somehow curb this insane tendency to “help you”… by adding security holes to perfectly valid algorithm.

Think about it: how many things may fail if the result of sort() is not, in fact, sorted? Regular expressions are pretty fundamental - yet PHP screws them, too. And so on.


to post comments

PHP 5.4.0 released

Posted Mar 3, 2012 0:03 UTC (Sat) by rfunk (subscriber, #4054) [Link] (2 responses)

It's funny, I dislike PHP too, but I'm very familiar with it and use it all the time (imposed for reasons I mentioned elsewhere). And while I can think of many stupid things about PHP, the things you mention would be at the bottom of the list at most, and in some cases I don't even see them.

- Rule of Repair violation. The only place I really see this is in the fact that it's a loosely-typed (and dynamically-typed) language with implicit conversion. While these attributes certainly annoy programmers used to a different type of language, there's nothing inherently wrong with them.

- Turing tarpit. Not even close; in fact it's more of a kitchen-sink language, with everything thrown in with little regard to consistency.

- "help you by adding security holes". Very true, but most of this can be avoided with proper php.ini configuration (though the existence of such a thing is itself a big problem) combined with a "good parts" approach to the language. This is where a novice really causes havoc with PHP, and why I cringe at its common "non-programmer" uses.

- Regular expressions. OK, so they don't perform as well as they could. So what? If you want performance you're looking in the wrong place anyway, and if you're coming from Perl and want a little more speed you just need to use regexes a little less.

All that said, I do think PHP deserves quite a bit of ridicule. It's the most wildly inconsistent language I've ever seen taken seriously, didn't gain anonymous functions (sorta) until the last major release (despite having array-transformation functions that need that sort of thing), and only now is getting a sane array syntax. My years doing Ruby instead were great (except for deployment/sysadmin), and these days I'm much happier when I can do Javascript (including some server-side) than when I'm doing PHP.

PHP 5.4.0 released

Posted Mar 3, 2012 1:00 UTC (Sat) by elanthis (guest, #6227) [Link] (1 responses)

> Rule of Repair violation. The only place I really see this is in the fact that it's a loosely-typed (and dynamically-typed) language with implicit conversion. While these attributes certainly annoy programmers used to a different type of language, there's nothing inherently wrong with them.

1) Identifiers magically turn into strings, mostly I believe because function handlers have just been strings until relatively recently.

echo FOO; // prints FOO

2) Magic quotes. Yes, they're finally gone, but the fact that some dork put them in there in the first place proves that said dork had no business designing, implementing, distributing, and promoting a language.

PHP 5.4.0 released

Posted Mar 3, 2012 14:56 UTC (Sat) by rfunk (subscriber, #4054) [Link]

Ah yes, #1 is probably PHP's worst remaining sin. Luckily I don't encounter it a lot, but it did bite me not too long ago.

I loosely put magic quotes in the "help you by adding security holes" category. I'm glad they're finally gone, but I agree that their existence says nothing good about the language designer, or at least the language's aspirations beyond "Personal Home Pages".


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds