IanKelley, thank you for showing the intensely irrational anti php points graeme raised. I don't mind dislike, that's fine, we all have preferences, but to say things that are simply wrong merely expose that all we are looking at is bias, not fact, and certainly not informed opinion. For example, I don't like enforced indentation and no C like features, I find it a pain that gets in my way. I can type, so typing in clear delimiters does not slow my coding down, ie, {};, and if it does, the coder should probably find another line of activity to engage in. Logic is 99% of the problem in real coding cases, and in trivial cases, all languages are similar.
However, given there was no actual response, I have to admit that upon reflection, I started to think about why I like PHP, and I think it's precisely because it allows me produce solutions without having to become an alleged professional programmer, and I suspect strongly that one big reason I can produce such solutions is that I don't consider myself a programmer at all, for me the language is merely a wrapper for the logic, and it's the logic that creates the solution, so the language i want is the one that gets least in my way, and getting in my way is for example breaking all my code in an upgrade. I have better things to do with my time. But then I thought more, and realized, oh, this is that old zen thing, in the beginner's mind, the possibilities are endless, in the expert's, they are few. Since I barely have to think about PHP at all beyond learning some of the slightly inconsistent ways it does things (because, as noted, of their intensely strong belief that when you write code, it should keep working), it's been since day 1 for me the best wrapper for my logic, and for the client's needs. I've never hit a problem where some combinations of php, sql, and other server side scripting languages could not rapidly solve the problem, so there's been zero reason for me to move from php, though I do check into each and every new prospect I find in case someone has finally found a better way.
Since all php functions are c/c++ (I don't know which they tend to use, nor do I care, since php is fast) all he's saying is that scripting language x is the same as language y in this area (no surprise, they all are more or less). He admits python is slow, that's good, since if you make everything an object, that clearly must come as a cost. He ignores the respect for the developers (ie, years of deprecation warnings, and smooth handling of version to version changes, which requires a discipline that only many years can reveal. Python does NOT have that discipline. Period), which he must ignore, because python has a dismal track record on their upgrades breaking things. I have seen even small upgrades, like 2.5 to 2.6, reveal errors in a way I have literally never seen, in one case, python actually took an existing function, or method, I forget, name, and repurposed it, which kicked up errors on 2.5 and made the thing fail. When I saw this, I decided that python was permanently removed from consideration in my tool palette. Should python chose to become adults and create architectures that handle such things smoothly, like php does, and has done, I'd consider it again, but sadly, I need at least 5 years of clear evidence that such a thing is done, and by the time python shows that, I'll be long gone from the coding scene.
Further, as a suggestion, graeme, when your biases make your brain read different words than someone writes, my suggestion is to just stop, and say, I don't like x. Don't make up fairy tales about x that make your bias seem like an objective statement of fact, just say you don't like it and leave it at that. For example, when you say I'm reinventing the wheel etc, you totally misread what I wrote: I said I like all the builtin functions php offers me, which seriously minimizes the number of libraries I have to plugin , each of which is now a point of a failure in future upgrades. In other words, php is such a rich language with so many features that I simply almost never need to use libraries, though of course, I do, when required, classes in this case. SOAP, XMLRPC, all this stuff is builtin. Though obviously you will need to modify defaults when required. But you'd have to actually use PHP to know this. This is why I don't make comments about other languages that I haven't used beyond the things I do know as true about them. This is also known as knowing what you do and don't know, a basic principle of wisdom.
In other words, the dependency issue is largely under my control.
Rather than repeating more nonsense, why not read about Hack, the PHP derived language of facebook.
[
fastcolabs.com...]
"It has been specifically designed to interoperate seamlessly with PHP," says Verlaguet, the technical lead on the Hack project, whose background includes a mix of formal academic study of programming languages and industry experience.
I realize that the notion that the developers of php tools tend to care A LOT about existing code bases, which translates to a deep and fundamental respect for the time of developers (a respect that is sorely lacking in most languages in the world now) makes certain of these concepts very hard to grasp if you are using a more 'modern' language that has no qualms about screwing you over randomly with little warning, but the more I do this type of work, the more deep my respect and admiration grows for those very few places on in computer landscape where my finite time and energy is actually respected as a core component of language design and implementation over time. And it is this that makes PHP continue on as the by far and away most dominant language on the web. And that's why if I raise this point, it's always ignored, because no other group has this much respect for its users. And if one does, let me know who it is. It's not python, it's not perl. I don't know about ruby, it may or may not be. I never use it or see it, so no idea.
I've read some of the more stupid but still commonly linked to criticisms of php, the one by the perl guy who clearly simply could never accept that php fixed perl, and by fixing it, that means the flaws of perl that made normal users dislike it were corrected, and the language normalized and made accessible, which is why PHP took off like a rocket on introduction. I think of php as fixed perl, I always have. And I believe it's one big reason Perl 6 took so long to get done, the real developer mind hours were grabbed by php years ago, that's the language developers, until basically very few people cared about perl anymore.
I've put timers on PHP driven forums, and I can tell you, that code is FAST. Not just slightly fast, mind you, it's stunningly fast. Most of the speed issues you see come from bad database schemas, and sloppy handling of those types of things (I have a backend tool written for a client that takes 10 to 15 seconds to generate a report because of the sql, NOT the php. Since it's just a backend tool nobody cares about that delay). And PHP 7 is supposed to be even faster, and not just slightly, I don't remember exactly, I think it's in the order of 2x faster. [
zend.com...] yes, it's 2x faster, and 30% less memory use. And PHP was already super fast. This is what ongoing incremental improvement looks like, and good language design. Doesn't require breaking stuff like python 3 did, just makes it better. Who else does this? Most of the databases, MySQL, MariaDB, PostGRE do good incremental adult improvement because you are not allowed to break data in the real world. XFCE4 is doing that, as do most of the light weight window managers in *nix land, but NOT the bloated ones. Who else? Very short list. Shell languages do it. Does C do it? Go promises to do it, explicitly, though only within major versions.
I've read a bit about the facebook Hack php. Some of that logic is in php 7 from what I understand. I do understand why people who want to blindly criticize php have to find ways to ignore facebook, no matter how irrational. I really like the facebook ideas re php, particularly forcing typing etc, but these can actually be done now, since that is all free software, ie, opensource, if it's a big deal to you. All my code will work on php 7.
All huge sites are going to move certain things into C / Java etc, as they discover areas of optimization, that has nothing to do with the languages used, google always did that, though they generally were more honest about their use of python than most, they considered it merely a prototyping language, once the feature was ready for prime time it would get rewritten, probably now in Go, which is itself an interesting language, but one that is designed for large computing environments, ie, it's a language designed to handle the random bad behaviors found in large groups of programmers hired every year, and is very clever in that area.
So python is a huge fail for long term maintainable code, and doesn't take upgrades and the reality of long lived code bases seriously. That is why I excluded python from the options I would consider. Neither I nor my clients feel like engaging the cost in time required to run a slow language, since it offers essentially no benefit to either the client or the end user.
explorador, I'm sorry, I should have been more precise: wordpress when competently themed, and void of the putrid pile of extensions and incompetently done extensions plugins and vile themes that can only break on any upgrade, that is, a clean well run wordpress, is actually one of the easiest to upgrade software packages I've come across. However, while in spirit this is true, in fact, the scenario of badly done wordpress is the overwhelming norm, so in fact, you are right. But you can in theory make wordpress pretty good, IF you use it as it was designed to be used, as a blog, with a real theme. This if is so uncommon that you can safely say that in fact, upgrades of normal wordpress installs can be lethal. This is why I refuse to work on anyone's generic wordpress site, for any amount of money.