News for hackers. Stuff that matters.
Re:Google App Engine finally supports PHP by danbruc on Saturday May 18, 2013 @09:13AM (#5728776)
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.
Re:Google App Engine finally supports PHP by Joeri on Saturday May 18, 2013 @09:23AM (#5728811)
But, 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.
Re:Google App Engine finally supports PHP by xaritas on Saturday May 18, 2013 @10:00AM (#5728917)
I 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.

Re:Google App Engine finally supports PHP by wmil on Saturday May 18, 2013 @09:45AM (#5728887)
The 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.

Re:Google App Engine finally supports PHP by gngeal on Saturday May 18, 2013 @10:48AM (#5729098)
Half 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. :-)

Re:Google App Engine finally supports PHP by jasonlotito on Saturday May 18, 2013 @10:21AM (#5728971)
I 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.

Re:Google App Engine finally supports PHP by cglace on Saturday May 18, 2013 @12:56PM (#5729537)
Yeah, 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.

Re:Google App Engine finally supports PHP by danbruc on Saturday May 18, 2013 @09:57AM (#5728913)
There 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-de...

Re:Google App Engine finally supports PHP by Killswitch on Saturday May 18, 2013 @10:25AM (#5728996)
We get it, you don't like PHP. Move on already.
Re:Google App Engine finally supports PHP by PommeDeTerre on Saturday May 18, 2013 @11:00AM (#5729142)
No, 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.

Re:Google App Engine finally supports PHP by Killswitch on Saturday May 18, 2013 @11:34AM (#5729247)
Except nobody jumps in for a karma train of circle jerking each other about flaws in Python, Ruby or anything else.. Just PHP... Because it's the new cool hip thing to do.. Bash PHP... If you don't, then you won't get high fives from the rest of your hipster friends.

I've been writing PHP for 12 years... I've learned that its got flaws... Just like anything else... I've gotten over it... Why? Because I actually enjoy writing PHP. And nothing you or anybody else can say will change that, so just get over it. Use what's best for you, not what is the new hip thing to use.

Re:Google App Engine finally supports PHP by elbear on Saturday May 18, 2013 @12:04PM (#5729340)
It's not a cool hip thing to bash PHP. It's been happening for quite some time and Python and Ruby don't get as much flak, because they don't deserve as much.

I realize it's annoying for you, someone who enjoys writing PHP, to keep hearing people complain about PHP, but it's always going to happen. And although it won't convince you to stop using it, it will surely convince others to think about trying something else.

Re:Google App Engine finally supports PHP by PommeDeTerre on Saturday May 18, 2013 @12:22PM (#5729430)
Python and Ruby aren't riddled with security holes. Python and Ruby offer quite sensible language features. Python and Ruby have relatively clean, comprehensible standard libraries. Python and Ruby make it easy for developers to rapidly create complex systems, while still retaining a high degree of safety and security. Python and Ruby are getting better with age, rather than stagnating or gaining features in an ugly, tacked-on fashion. Python and Ruby generally have more experienced, professional communities behind them.

Simply put, they don't suffer from the many inherent problems that PHP suffers from. That means they won't catch anywhere near as much flak.

And your description of anyone pointing out PHP's flaws as being a "hipster" or doing it because it's a "new cool hip thing to do" is absurd. Many of us who speak out the loudest against PHP have been doing so since the late 1990s, and many of us are now well over 50 years old. We're about as far from "hipsters" as you can get, in just about every respect.

Re:Google App Engine finally supports PHP by Killswitch on Saturday May 18, 2013 @12:34PM (#5729469)
http://www.cvedetails.com/vulnerability-list/vendor_id-10210...

http://www.cvedetails.com/vulnerability-list/vendor_id-7252/...

Nope, no vulnerabilities in Ruby or Python, just PHP. Because PHP sucks, Ruby and Python and Erlang and Go and Java and C++ and blah blah blah blah blah are superior languages to PHP, blah blah blah.

Insert beating a dead horse image here.

Re:Google App Engine finally supports PHP by danbruc on Saturday May 18, 2013 @01:03PM (#5729556)

  Python  15 in  5 years
  Ruby    36 in  7 years
  PHP    341 in 14 years
No one claimed that other languages are flawless. Besides that the biggest problem are not vulnerabilities in the languages; the biggest problem are vulnerabilities in products build using the languages and PHP makes it especially hard to write correct code because of its many quirks making it (almost) impossible to be aware of all edge and corner cases.
Re:Google App Engine finally supports PHP by sbarre on Saturday May 18, 2013 @11:26AM (#5729215)
Except 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...
Re:Google App Engine finally supports PHP by PommeDeTerre on Saturday May 18, 2013 @12:12PM (#5729384)
Those 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.
Re:Google App Engine finally supports PHP by sbarre on Saturday May 18, 2013 @03:40PM (#5730099)
Sound like you need to hate the players, and not the game...

Sorry if that's cliche, but your justification sounds more like it is rooted in your experience with badly developed programs, not so much a bad language.

I've been working with PHP for a long time. I've worked with other languages as well, but for the last 10 years career-wise PHP has been my bread and butter. And I've seen plenty of bad PHP as well, I absolutely don't deny that. As one of the most popular and most accessible languages out there, it's inevitable that lots of beginners will produce low quality code.

But I've also seen plenty of very good PHP code.

I've worked on quite a few large-scale PHP projects that were delivered on time and on budget, have maintained good performance under extremely high loads, and have had no security issues over years of time in production environments (including banking and automotive).

Want to know why? Because we wrote the applications properly, we tested them well, and we knew what we were doing.

I'm sure equivalent teams can do just as well with Java or .NET (or whatever else), but our stack expertise is with PHP, so that's what we choose because that's what we are best with.

Any tool in the hands of a bad craftsman will produce shoddy results. And as I said before, PHP's popularity is certainly a dual-edged sword, but I believe the good outweighs the bad...

So unless you can name some magical framework or language that can prevent mediocre or inexperienced developers from making mistakes or producing bad code, I think you're being narrow-minded and unfair in your criticisms..

Re:Google App Engine finally supports PHP by Joeboy on Saturday May 18, 2013 @04:23PM (#5730321)
> Sound like you need to hate the players, and not the game...

Hating the players seems like a reasonable reason to avoid the game.

Re:Google App Engine finally supports PHP by danbruc on Saturday May 18, 2013 @11:38AM (#5729260)
The 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?
Re:Google App Engine finally supports PHP by thenomad on Saturday May 18, 2013 @03:29PM (#5730049)
So, 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?

Re:Google App Engine finally supports PHP by Joeboy on Saturday May 18, 2013 @04:14PM (#5730276)
> 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).

Re:Google App Engine finally supports PHP by thenomad on Saturday May 18, 2013 @05:38PM (#5730569)
In 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.