TL;DR: Because we used it. Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things. Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me r…
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
Why so much hate for PHP?
51–60 of 74 posts
Re: Why so much hate for PHP?
#52TL;DR: Because we used it. Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things. Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me r…
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
But more to the point, if anybody knows how to use PHP properly I'd think it is somebody who has worked at Facebook, and you can't just dismiss natmaster's complaints with hand-waving that he must not have been doing it right.
Re: Why so much hate for PHP?
#53 $foo = [];
$foo[$userSuppliedString] = 'foo';
foreach(array_keys($foo) as $userSuppliedString) {
if (! is_string($userSuppliedString)) {
die("I understand all the reasons for this behaviour, but it violates the principle of least astonishment");
}
}
Supply a string. Works fine? Try running with a string that looks numeric.I use PHP every day, it's a great language for many things including teaching programming. Every language has its quirks and i don't really think PHP's quirks are worse than others.
"The Tao gave birth to machine language. Machine language gave birth to the assembler. The assembler gave birth to the compiler. Now there are ten thousand languages. Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao - but do not program in COBOL if you can avoid it."
Re: Why so much hate for PHP?
#54Earlier quoted context omitted.
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
Well for what it's worth, I keep reading that from people whose exposure to programming languages and techniques is limited to making LOB applications in PHP and maybe one or two other lowest-common denominator languages. Most people I know who have any real breadth of programming experience find PHP's language deficiencies glaringly obvious, even if they find it occasionally useful due to deployment requirements, et…
Well, considering the scenario he described in his own post, it's obvious that PHP wasn't used in the right way. Working at facebook itself, unfortunately, means nothing as i have no idea how their code actually is and what natmaster was doing there.
> Well for what it's worth, I keep reading that from people whose exposure to programming languages and techniques is limited to making LOB applications in PHP and maybe one or two other lowest-common denominator languages.
For what is worth, i've seen PHP applied with different patterns and architectures in scenarios that were pretty wide, powering millions of contacts daily. It's probably because of this that i learnt that it's actually a well-done language whose only fault is that it isn't popular among engineers and mostly used by amateurs. But this has nothing to do with the language itself.
Re: Why so much hate for PHP?
#55TL;DR: Because we used it. Like many people, many years ago I learned php. It was easy to deploy, and make simple dynamic websites. Many hosting services provided support for it. I was quite happy to use it for these things. Then in 2008 I interned at Facebook. At the time, there had not yet been any attempts to improve the language by Facebook itself. Using php in an actual codebase - real world software - made me r…
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
Re: Why so much hate for PHP?
#56Earlier quoted context omitted.
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
Strange, I learned php before I ever went to college. By time I went to university I knew 11 programming languages, so I don't think this applies to me.
Re: Why so much hate for PHP?
#57Earlier quoted context omitted.
I keep reading always the same things from people who simply don't know how to use it properly and feels hurted by a different-than-what-studied-at-school syntax.
If it's apparently so difficult to learn how to use it 'properly', maybe it's just a shitty language.
Re: Why so much hate for PHP?
#58Earlier quoted context omitted.
Laravel is a great framework and has really helped push the community towards writing tests and producing packages that can be easily shared via composer. Of course Symfony has a big part to play in Laravel's success to. 2013 was a good year for PHP. Most of the time when I hear people complaining about the language, it's as if things haven't changed since 2005. There's a lot of horrible, badly written spaghetti code…
The only thing I think I don't like about Laravel is that it doesn't use Twig as the default template engine.
Re: Why so much hate for PHP?
#59A standard, no crazy stuff, database-backed blog+login site made in Symfony consumes ~60MB of memory. Then discards it and starts again. On each request. Even if the bytecode itself is cached, it has to create/register all the classes and global objects it uses every single time.
I think people should find that at least weird and probably scary. Other languages, which separate continuously running application servers from the page serving, do not do that.
Re: Why so much hate for PHP?
#60Earlier quoted context omitted.
Strange, I learned php before I ever went to college. By time I went to university I knew 11 programming languages, so I don't think this applies to me.
Mh, not sure what you mean here. As you know 11 programming languages, you might be aware that "knowing your tools" is always valid and goes far beyond syntax itself. PHP is as capable as complete as any other language. Reasons behind most devs "hate" are mostly minor things and mostly a matter of taste.
Just because some orgs can wring a production system out of it does not mean it's the bee's knees. Far, far from it.
PHP is functional, I'll give it that. But arguing it's merits in a world that has Rails, Django, Node.js or even Chicago Boss, is going to lose you friends amongst people who appreciate elegance and speed in their libraries and applications.
As if you couldn't guess, my personal opinion is that PHP is one step up from CGI scripts in Perl5. PHP5 gained mindshare because your grandma could figure out how to embed a variable in a template and toss it in a directory that apache was already hosting with mod_php. And that, my friends is why we're even talking about PHP.