7 ms·
To replace PHP you need: 1. To be on all shared hosting everywhere. I.e. you need to be really easy to install, and preferably not involve long-running process
by kemayo 15y ago
To replace PHP you need:
1. To be on all shared hosting everywhere. I.e. you need to be really easy to install, and preferably not involve long-running processes that shared hosts might choke on.
2. To be beginner friendly. No requirement of understanding MVC, or running commands in a shell (hi RoR!). Pure instant gratification. Someone's first step into using PHP is likely going to be "I want the current date in the footer of my page", or "I want a random image on my homepage", or something like that. Anything like that you can handle by taking your existing page and dropping a tiny snippet in where you want the change to happen. <?=date('Y')?> is a potent thing to someone who has never programmed before.
(Note: For point 2 many of the things serious programmers hate about PHP are actually advantages. All the functions in one big namespace? That's great! A newbie doesn't have to try to understand `<? import datetime; print datetime.date('Y'); ?>.)
It's easy to replace PHP for serious developers. We like advanced features, and care about a sane default libary. We're willing to use complex tools to get a payoff.
It's hard to replace PHP for non-programmers who just want to tweak their static page in notepad, or install a blogging package on their cheapo shared hosting.
To sum up: if you don't address both of these points then you haven't killed PHP. You're competing with Python or Ruby or whatever. PHP will carry right on ignoring you, because you're not addressing its fundamental use case.
- InclinedPlane 15y agoI don't agree that MVC and beginner friendliness are fundamentally incompatible. Nevertheless, if you can't get a "hello world" site set up in a very small number of essentially trivial (and easily memorize-able) steps then that's a big show stopper.
- gaelian 15y agoIt really depends on the beginner I guess. It seems like what kemayo is saying is that there are beginner programmers and then there are people who don't want to be a programmer at all really, but might like the idea of having a dynamic year string printed in the footer of their page. Those of us who have been working with computers for a long time - particularly those of us who write code - too easily forget what it's like to be that true beginner and often have a very different idea of what 'trivial' means compared to the beginner. What might barely be a speed bump for us can often be an insurmountable obstacle for them and I really wish I was better at remembering this more often.
- InclinedPlane 15y agoFrom the perspective of the "average" professional programmer with a CS degree the vast majority of all programmers, even those who get paid to do it, are rank and utter beginners. Most programmers cannot solve fizzbuzz. Most programmers don't grok recursion, and have trouble with iteration from time to time. If you were to look at a graph of # of programmers within different skill level bins the "beginner" bin would outweigh all the others by a significant margin. That's why you can replace PHP with RoR, you need to replace PHP with something that out PHP's PHP, but is based on sounder principles so that in the important cases where a beginner is climbing up the skill ladder or a system originally created in a "beginner language" grows or becomes sufficiently advanced they won't hit a brick wall where they need to migrate to an entirely different technology in order to progress.
- gaelian 15y agoWell said. Your second paragraph expands well on what I was thinking when I said we forget that beginners have a different idea of what 'trivial' means. The MVC concept (for example) might be trivial to those who get it, but it's likely seen as undesired friction by the beginner, while simultaneously being a good next step for them to acclimatise to should they be wishing to progress. Something that better facilitates this - or things like it - than what we currently have would be great.
- ajross 15y agoYeah, exactly. This headline could have been written with the same justification in 1999. Yet PHP refuses to die. Clearly us hackers are missing something important.
- xd 15y agoThe fact it actually solves real world problems would be a first "something important" us so called hackers are missing.
- ra 15y agoHaving not used php for 12 years, I recently accepted a freelance job for a client who had been left in the lurch by his php developer who seemingly abandoned the project because she was out of her depth. I have to say that I was pleasantly surprised by some of the new language features that php has borrowed from elsewhere... eg: closures, anonymous functions, docstrings. IMHO php is held back primarily by messy, inconsistent documentation and extremely ugly parts of the core library that are also riddled with inconsistencies that should have been deprecated years ago. Not that I would consider starting a new project in php - I just love programming too much for that; but I believe php will evolve, benefiting from other languages. Really, it needs it's own "Python 3" (out with the old, smarten up the new).
- _ikke_ 15y agoNote that python3 still doesn't have widespread adoption, because there are still widely used libraries lacking support for it.
- spdy 15y agoBut in the coming future it will. All major libraries and frameworks are going to port over to python 3. But we are missing the point here. PHP could need a cleanup from the ground up even if they have to break a lot of stuff this could help the language to evolve.
- 15y ago
- xd 15y agoAre you saying that developing an API in PHP is insane?
- kemayo 15y agoNo, I'm saying that the stuff built into PHP is weird and inconsistent. I should change it to "sane default library" from "sane API". My current favorite example of this (ignoring the naming scheme for string functions entirely) is that in_array and strpos are functions that perform (almost) the same task, on two different types. They take their arguments in the opposite order. strpos($haystack, $needle) vs in_array($needle, $haystack).
- maratd 15y ago> No, I'm saying that the stuff built into PHP is weird and inconsistent. You never asked yourself WHY. See, that's the important question, isn't it. WHY. I'll tell you WHY. Because two different dudes implemented it. At different times. Probably, from different continents. They didn't notice it at the time. But, eventually, someone noticed it. And then they did something really crazy. They didn't fix it. Because that would break the software already using those functions. It's impossible to write a perfect language from the start. Hell, it's not possible to write a good language from the start. Things that you didn't see crop up and you have to add functionality. And sometimes, the way you added it isn't right ... at that point, you have two choices. You can fuck your existing user-base up the ass, refactor your code, change the interface, and do it "right" ... or you can do everything you can to mitigate the damage, while keeping the interface the same. I can pull up software I wrote 10 years ago and it'll still work. Perfectly. You can only say that about languages that do it right. And guess what? Those languages, they always have lots of warts. Because someone made the hard choice and kept something that's ugly, instead of fucking over a shitload of people to make it pretty. I'll take function over form any day.
- kemayo 15y agoYou're ascribing things to me that aren't present in the text. I had a pretty good idea why that's how it is. I even completely agree with not changing it now. Backwards compatibility is important, no argument there. That doesn't change that it's the sort of niggling annoyance that drives people to dislike the language.