4 ms·
In ten years it might actually be a first-class language. It's going to take a ferocious amount of work to shed its reputation as a web-only scripting language
by astrodust 13y ago
In ten years it might actually be a first-class language.
It's going to take a ferocious amount of work to shed its reputation as a web-only scripting language.
- RobAley 13y agoI refer you to http://www.phpbeyondtheweb.com http://www.phpbeyondtheweb.com
- astrodust 13y agoThe subtitle for that book could be "Just because you can doesn't mean you should". Why would anyone write non-web code in PHP? It's completely out of its element. If your selling point is "not having to learn" you're not being very fair to developers that use PHP. If you can't learn, you've got a problem. New technology comes up all the time, and if you can't adapt, you'll get left behind. Would you recommend a PHP to JavaScript converter so you can do PHP in the browser and avoid all that painful "learning"? What about "bash beyond the shell"? It's possible. Would you want to write an application in bash? Please, do not. Everything that made PHP popular and versatile is now a massive liability. Perl went through the same cycle from saviour to relic and that community has been struggling to try and reinvent itself (Perl 6) in a manner that's in keeping with today's concerns. The level of change you'd have to introduce in PHP to make it current is so staggering you may as well write a whole new language. Even the relatively modest changes made to modernize Python have caused an enormous rift.
- maratd 13y ago> shed its reputation as a web-only What? It is web-only. That's the entire point behind it. It's not a reputation, it's the goal of the project.
- blister 13y agophp5-cli is pretty robust, to be honest. It is a fairly slick server-side scripting language to integrate processing tasks inside of a normal web environment.
- SDGT 13y agoImplemented a websocket server in PHP as a curiosity, which is a php cli daemon independent of apache. Its absolutely awesome barring having to work with the websocket framing protocol with ordinal casts, etc. PHP has an odd flavor of hex/ binary arithmetic. You pretty much just pull characters out of a string byte by byte and use bit shifting/ ANDing to get a message decoded. And the best part! No need for anything like APC for the cli; it's useless as the daemon doesn't work like a standard PHP lifecycle in apache.
- pionar 13y agoI did this for a project in 5.3 (client: "PHP EVERYTHING"), it wasn't as difficult as I thought it'd be, but I will admit, there are better solutions.
- astrodust 13y agoIt's the "better solutions" that make me wonder why people go down this road for any reason other than academic curiosity. Given an arbitrary back-end written in Python, Ruby, Go, Perl, Java, Scala or PHP I would expect, nine times out of ten, the bad apple to be PHP. Anyone who knows how to program PHP properly, and by that I mean using all of the modern conventions, would be far more productive in something like Java or Python where they didn't have twenty years of appallingly bad design decisions influenced by its role as a web scripting language weighing down their code.
- coldtea 13y ago>Anyone who knows how to program PHP properly, and by that I mean using all of the modern conventions, would be far more productive in something like Java or Python where they didn't have twenty years of appallingly bad design decisions influenced by its role as a web scripting language weighing down their code. Yes, because Java doesn't have it's own twenty years of bad decisions...
- 13y ago