4 ms·
The problem is everyone is conflating things. PHP the language sucks ass. PHP the environment (part of the server + html processor + no setup or configuration
by greggman 15y ago
The problem is everyone is conflating things.
PHP the language sucks ass.
PHP the environment (part of the server + html processor + no setup or configuration for most users + page is the app + etc..) = WIN for many many people.
Not a single other environment has ever duplicated that. Until someone does they'll never displace PHP. It's ripe for the replacing but understand that it's not just the language, it's the entire environment surrounding it.
- frankus 15y agoI found myself thinking whether one could make an heir apparent to PHP that removed the suckiest aspects and left the same basic "no configuration, just a bunch of files" model in place (any inherent problems with that model notwithstanding). Sort of how SVN fixed some of the most glaring issues with CVS without forcing people to really change their habits. But I think that the things PHP really has going for it (huge installed base of the runtime, huge installed base of legacy apps, huge developer community) aren't going to smoothly make the jump to a new language. And once you've given up that sort of backward compatibility, why not fix a few other things while you're at it? Still, I think there might be potential for a PHP-like language that breaks some backward compatibility but fixes a lot of basic things like unicode support, modules loaded at startup or runtime rather than as a ./Configure flag, syntactic quirks, etc. Something where you could spend a few minutes to a few hours (max) refactoring a PHP script into PHQ (or whatever you want to call it) script and gradually modernize your app.
- Zarel 15y agoMost of the gripes with PHP seem to do with its syntax, error messages, and inconsistent function naming. It seems like it shouldn't be too difficult to write an automatic converter from "PHP" to "Improved PHP", which might solve a lot of these issues.
- conner_bw 15y agoObligatory "If PHP Were British"? http://www.addedbytes.com/blog/if-php-were-british/ http://www.addedbytes.com/blog/if-php-were-british/
- roryokane 15y agoPharen (http://scriptor.github.com/pharen/ http://scriptor.github.com/pharen/), a Lisp that compiles to PHP, might be or become such a language. It's not quite as simple to jump right into as PHP is because you need to run Pharen's compiler after editing your code, or set up a script to watch for changes and then compile. But Pharen could theoretically improve its tooling and get very close to PHP's ease of use.
- wvenable 15y agoThe thing is, the language doesn't fully suck. It has a few sucky parts that are more or less easy to ignore. As has been said elsewhere in this topic[1], the code one produces in PHP is pretty equivalent to what you do in most other languages. [1] http://news.ycombinator.com/item?id=3824767 http://news.ycombinator.com/item?id=3824767
- TylerE 15y agoSo, what exactly ARE the good parts? * Syntax? Sucks * Arrays? Or wait, are they hash tables? Sucks * Stdlib? Sucks * Performance? Sucks
- mseebach 15y agoSyntax is awful, granted. PHP doesn't have arrays, it has hashtables. Although PHP probably got there by accident, consensus in dynamic languages today is that the hashtable is the superior default collection datatype. The standard library is state of the art in C, which is most of the time state of the art, full stop. The interfaces to the libraries are awful by way of being inconsistent. Performance is more than good enough. Scaling it properly is more of an artefact of good application architecture, but this is the case for any environment.
- chaostheory 15y ago"Not a single other environment has ever duplicated that. Until someone does they'll never displace PHP" Someone in the Rails community is trying with a small start. http://www.kickstarter.com/projects/1397300529/railsapp http://www.kickstarter.com/projects/1397300529/railsapp Ruby and its community are far from perfect. The biggest difference that I see between it and other communities, is that when a lot of people come about some negative aspect of using Ruby, eventually within a few months people start working on actually fixing it. X number of months later, it ships.
- maratd 15y ago> PHP the language sucks ass. Depends on how you define the language? Nobody is twisting your arm, you don't have to use any of the inconsistent syntax. Just write your own functions. The core language is actually very similar to C.
- danellis 15y agoThe core language has a superficial similarity to C, that's all.
- lhnn 15y agoThis is the best way to describe it. I wrote a few tools for my IT team a month or two back. I needed a Quick and Dirty web UI. How do I write some .py files that output HTML, put them in a web directory, then goto http://server/tool.py http://server/tool.py? It was just easier to use mod_php and rewrite the simple tools in PHP. Trust me, I REALLY wanted to use Python, but couldn't. To be fair, I didn't have superuser, but I did look for docs on how to do this for Python, and apparently isn't not easy. You have to use WSGI or something? I don't know. My tool now works well, in PHP.
- jamesgeck0 15y agoPhusion Passenger is your Apache plugin and/or standalone server. It supports Python and is really easy to setup. Flask is your quick and dirty web UI. It comes with some of the best documentation I've ever seen. You need different knowledge than PHP, but I can't say that it's harder than PHP.
- antihero 15y agoI don't think people replicate it because having an environment that is based on directly mapping to the filesystem tree is completely inane for modern webapps. Most decent PHP software now hands the request off to a single file (eg index.php) that handles the routing. Yes, PHP has mass appeal for people that are happy to limit themselves to the lowest common denominator, however people that want to reach even a tiny bit further can discover other languages that have better ways of doing things. For instance, his "Hello world" example is completely fucking inane, and just spitting out a thing like that will lead to poor app design and unmaintainable spaghetti code.