3 ms·
>It gets the job done This sounds like other similar language will not get the job done. The truth is that there are much better alternatives which are a lot m
by thrownear 11y ago
>It gets the job done
This sounds like other similar language will not get the job done. The truth is that there are much better alternatives which are a lot more pleasant to use and will get the job done in a much better way.
> it's easy to use
This is a myth. Php is not easy to use. May be, It is easy to start. But you need to know a lot of useless stuff (outside the context of Php), to get anything to work any where near reliably. Also, be prepared to write a lot more automated tests if you want to keep it that way.
- V-2 11y agoTo quote the classical piece on the subject ("PHP: a fractal of bad design"): There is a whole lot of action at a distance. Consider this code, taken from the PHP docs somewhere. There is a whole lot of action at a distance. Consider this code, taken from the PHP docs somewhere: @fopen('http://example.com/not-existing-file', 'r'); What will it do? If PHP was compiled with --disable-url-fopen-wrapper, it won’t work. (Docs don’t say what “won’t work” means; returns null, throws exception?) Note that this flag was removed in PHP 5.2.5. If allow_url_fopen is disabled in php.ini, this still won’t work. (How? No idea.) Because of the @, the warning about the non-existent file won’t be printed. But it will be printed if scream.enabled is set in php.ini. Or if scream.enabled is set manually with ini_set. But not if the right error_reporting level isn’t set. If it is printed, exactly where it goes depends on display_errors, again in php.ini. Or ini_set. etc. :) (Perhaps this particular issue is obsolete now, still it's emblematic of problems underlying the language, the ones I had to encounter when I worked with PHP few years back. Talk about "easy to use")
- krapp 11y agoSome people simply cannot accept that anyone would find PHP useful... or even tolerate its existence, and employ one particular (and increasingly obsolete) rant as if it were an objective argument against someone else's opinion on the matter. And yet, it's all subjective. If you don't like PHP, don't use PHP. It's that simple.
- V-2 11y agoAnd that's precisely what I did, of course - I no longer use it. But it doesn't mean I'm prohibited to share my experience with it. I never denied it's "useful" (is it supposed to mean much? Obviously, if apps are written in it, apparently it is of use, by definition), however I'm not alone in thinking there are better alternatives and - again, based on my personal experience - the more exposure to other languages and technology stacks a PHP developer has had, the more critical they get about PHP. The rant may be getting obsolete, but the mentality persists. To quote the creator of PHP himself: "I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "Yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I’ll just restart Apache every 10 requests". And this attitude seems very common among PHP developers. It's not just about the language, it's also about the culture. And no I'm not saying other languages are surrounded with perfect cultures (like Java's "achitecture astronauts" with mammoth frameworks and overuse of design patterns).
- TazeTSchnitzel 11y ago> This sounds like other similar language will not get the job done. That's not what they're saying. If someone knows a tool and it works for them, then it's more immediately useful than another tool which they don't yet know how to use, or how well it works. > The truth is that there are much better alternatives which are a lot more pleasant to use and will get the job done in a much better way. Quantify "better". PHP has its flaws (quite a lot of them), but it also has its advantages. It's a very popular language, so if you want to do something with it, almost certainly someone else has tried to do the same thing, so there will be libraries for it, guides, people who you can ask for help if you have trouble. It has a shared-nothing architecture, which aids scalability. It has extensive documentation. It has a large selection of battle-tested frameworks. There is an almost infinite selection of hosting providers. > This is a myth. Php is not easy to use. May be, It is easy to start. PHP's flaws can make it an occasional pain, but it is not really harder to use than any other ALGOL-like language. It is sometimes easier as it tends to expose simple interfaces to things, rather than requiring the user deal with a lot of complexity. > But you need to know a lot of useless stuff (outside the context of Php), to get anything to work any where near reliably. This is, to some extent, true for other languages as well. But yes, I'd agree with you here that PHP has more baggage than its contemporaries. > Also, be prepared to write a lot more automated tests if you want to keep it that way. This is true of dynamic languages generally. Though PHP has (limited, runtime) type-checking, which can reduce the burden here somewhat.
- thrownear 11y ago>Quantify "better" Better as in more correct. The endless gotchas in the language makes it harder to write correct programs that works as intended by the programmer. >so if you want to do something with it, almost certainly someone else has tried to do the same thing, so there will be libraries for it, guides, people who you can ask for help if you have trouble. That is more or less true for the alternatives as well (Python, Ruby, Javascript...) >This is true of dynamic languages generally. Yes. that is why I emphasized "a lot more"...