I was talking to some guys who work at google the other day, and it turns out, most google employees hate php. Turns out, google is actually programmed in python, java and c++, just thought I might share that with everyone.
Printable View
I was talking to some guys who work at google the other day, and it turns out, most google employees hate php. Turns out, google is actually programmed in python, java and c++, just thought I might share that with everyone.
PHP is good for small scale development, especially for newer coders. Personally, as a fairly serious coder, I think it's perfect for me, perhaps because I already know it. I rarely find myself needing anything PHP can't do, but I also don't stress it too much. The only time I find PHP to be too limited is when I want to work with images (beyond the basics), but that's not too frequently, at least not at the moment.
I think it's traq who has posted a few links here about trouble with PHP on larger-scale projects. I can't remember the details, but one of them was about facebook being run on PHP and having trouble because of scale.
PHP isn't perfect, but I don't get why people would "hate" it. If you want to move on, go for it :)
the reason they hate it, (and they were quite specfic with the term hate), seems to be because it's basically easier to write new code then to maintain old code, the crux of their argument is that php is terrible to maintain, I just thought this was interesting as prior to this, I had thought google was done in php.
That's a very interesting point. I don't know any other languages well enough to compare them, but I do agree that maintaining with PHP can be difficult.
It's easy to maintain your own code, and I also recommend/try to always comment my code in a very detailed way (sometimes each line).
But there's nothing worse than trying to take apart badly written code and make it work again.
I assume the problem comes when many people are working on the same code.
Yeah, I can see that. I wouldn't be surprised at all. In that case, they may be right. But I still think "hate" is an exaggeration-- they just have different needs.
maybe it has more to do with how fast php is still evolving. php has never been *overly* concerned with backwards-compatibility - it is "for the most part", but every major release brings at least a few (usually obscure) changes that can "break" older code.
Additionally, new releases often bring new functionality that, while not being "incompatible" in the strictest sense, makes aspects older coding completely obsolete by comparison. The object model between php4 and php5, for example. I recently upgraded from 5.3 to to 5.4 - and WOW, big additions. traits, anonymous functions (similar to javascript's), lots more. Even the little things (such as the new array syntax) is amazing in terms of convenience. I'm never going to writearray( )again.
There is also the simple fact that php is viewed as a "kiddie" language by many simply because of its origins as a web language. A huge portion of php programmers are amateurs or beginners, there's a lot of blind cut-and-pasting going on in the community, and that leads to a big collection of "not-quite-bad-enough-to-fix" code. It's interpreted rather than compiled, so there's the general (not always accurate) expectation that it is slow and inefficient. There is also a good number of php coders, who are generally recognized as "experts" by the amateur community, but (to put it mildly) really aren't very good at programming at all.
As far as documenting php code, or working on large projects collaboratively, it's certainly as possible with PHP as any other mainstream language. PHPdoc is a sort of de facto standard for documenting code (and it works very well), and version control systems (e.g., git) are language-agnostic anyway.
--- edit ---
I'm learning python too, though, and I do like it quite a bit.
Weird. I didn't know about the short array syntax. I suppose I can try that :)
I don't really mind array(), though. It seems logical to me, and it's not excessive to type. I'd like to see some shorter ways to write the annoying ones, like mysql_real_escape_string().
The reason is more to do with maintaining it, and how they believe the sacred languages (java, c++ and python) are easier to maintain, and thusly, better for a long term, large scale site such as google.
C++ is the "sacred" language (if you want to call it that). Java used to have almost as many haters as PHP does. and Python is still a fairly "new".
Daniel: I didn't think I'd really care aboutarray( )vs.[ ], either. But then I tried it. :)