7 ms·
More potential for one of the worst languages to spread - let's have one minute of silence. And after that someone please start building an alternative keeping
by danbruc 14y ago
More potential for one of the worst languages to spread - let's have one minute of silence. And after that someone please start building an alternative keeping the good parts that made PHP successful and getting rid of the insane stuff.
- Joeri 14y agoBut, what if it were the insane parts that made PHP successful? PHP is basically a shell script hooked up to a web server, with '$_REQUEST' flowing in one way, and 'echo' flowing out the other way. Its over-simplified architecture is exactly why beginners like it so much.
- wmil 14y agoThe simple architecture is actually what PHP got right. For comparison, if you were using mod_python with the default settings, you needed to restart apache whenever you changed a file. The insane part of PHP is the actual language. It's an overgrown template language. Half the functions are based on C, half the functions are based on Perl. There's no regularity or consistency.
- jasonlotito 14y agoI don't know. Other languages have become successful following that same path. See objective-c as a perfect example, though in obj-c's case, it only became popular because of the platform it was used on. The benefit there is understanding. With PHP, knowing the C functions mean I understand how the PHP function works. The same with obj-c, I can drop down into C and work there. And the change in syntax, the way things works, helps me understand what is going on. Again, knowing C, I can do things in obj-c without needing to learn the obj-c part. Maybe I'm one of the few, but context matters more than consistency. Maybe that's why I like vim.
- gngeal 14y agoHalf the functions are based on C, half the functions are based on Perl. There's no regularity or consistency. Recently, a third half of it was based on Java. :-)
- cglace 14y agoYeah, the standard libs lack consistency but that is annoying for about the first 1-2 months and then you get used to it. However, a lot of modern PHP frameworks(Doctrine, Symfony2) are quite nice to work with.
- danbruc 14y agoThere may be some insane parts contributing to the success but I can not even imagine a world in that all of them would contribute to the success. PHP: a fractal of bad design [1] lists many - really many - broken things for which at least I am unable to see how the behavior could not cause headaches let alone contribute to the success of PHP. Go ahead and read it - it is long but entertaining. [1] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
- xaritas 14y agoI don't think that's the insane part. When I think of 'insanity' and 'PHP' together what usually comes to mind is: ambiguous semantics for common operations, dubious security practices, irritating syntax, inscrutable runtime. There are some nice ideas in there, though. I dislike PHP-the-language as much as the next guy but sometimes you just need a three page website that you can hand off to a junior developer or web designer. If there is a language that does this, without being PHP, that would be awesome, but I don't think there is so I completely understand why somebody would just write three .php files rather than... install ruby, passenger, configure nginx, some supervisor script, etc. etc. I think that Google Apps for Business + GAE services complement PHP nicely--now you can use that shell scripting core to tie together your data with some powerful APIs and basically have no operational worries. We'll see what they do with it. Maybe the next Facebook will start out as a three page website on AppEngine.
- deleted 14y ago[deleted]
- Killswitch 14y agoWe get it, you don't like PHP. Move on already.
- PommeDeTerre 14y agoNo, it's good for people to be extremely vocal about technologies riddled with serious flaws. It's unfortunate, but ultimately beneficial, even when they have to do this repeatedly. It doesn't matter if we're talking about PHP or JavaScript, or a web framework like Ruby on Rails, or various NoSQL databases, or even certain operating systems. Even if people have used such technologies with some degree of success in the past, and even if they may still be using them today, it's important for us to move past them, as a community and as an industry. Making their flaws widely known is a very good step toward moving to better technologies. So I encourage people to be vocal about their bad experiences, or about the flaws they see in technology. It's an important part of advancement.
- sbarre 14y agoExcept his two-line post didn't actually say anything other than a long-winded version of "PHP sucks!" and that gets really old really fast...
- danbruc 14y agoThe text between the lines was supposed to read as »I would have preferred if Google had not added support for PHP and it would have been way cooler if they had build something as easy as PHP but without insanity«. Okay, that's just an opinion but what else should a comment on a simple fact like »Google App Engine finally supports PHP« be?
- PommeDeTerre 14y agoThose two sentences say a lot more to those of us who have used PHP extensively. This is especially true for those of us who have had to maintain relatively old PHP applications developed by numerous (often inexperienced) developers over the course of many years. And it says even more to those of us who also have had many years of experience with other, better tools.
- thenomad 14y agoSo, serious question - what language is better for small limited-scope web coding right now? I don't mean major, fully-fledged app stuff, I mean simple CMSes, on-page loops / conditionals, <? echo $_GET["foo"] ?>, etcetera. I'm no hardcore uber-coder, but I know enough to know there are languages I prefer to use than PHP. Personally, I like Ruby. But for a bit of quick glue or a relatively simple bit of web coding, I simply can't figure out what you'd use instead of PHP - and I assume from the number of "PHP sucks" comments that there must be such simple options?
- Joeboy 14y ago> I mean simple CMSes, on-page loops / conditionals, <? echo $_GET["foo"] ?>, etcetera. Serious return question - who has requirements like that? In my experience CMSes are never simple, and I can't think what kind of site has the latter requirements, but only has those requirements and won't ever need any more functionality. Personally I'd maybe use something like Django + the Flatpages app for a "simple CMS", and a tiny wsgi app for adding simple logic to a web page. Not, to be honest, because they're a perfect fit for those particular tasks but because I'd get to use a sensible language (python) that will remain sensible for the majority of other tasks (including non-web based ones).
- thenomad 14y agoIn my case, I use simple, quick code a lot for landing pages for clients and advertising in general, as well as for websites that are mostly static but occasionally need dynamic elements - most of my web series web pages end up either like this or built in Wordpress. Anything that's either focused on content or sales and either doesn't have a programmatic backend or hands off to another site will probably fall into the "not a full-fledged webapp" category. If I'm running an A/B test on a landing page, for example, I just need logging code and a conditional to choose what variants to display on-page. There's a lot of conditionals based on input conditions, too - "Hello, Hacker News reader!", redirects depending on country of origin, that sort of thing. I'll also use simple snippets of PHP or Javascript on sites that are already using Wordpress, but there you're locked into PHP from the outset, of course.