Hacker News new | past | comments | ask | show | jobs | submit login
PHP, the web’s most popular programming language, is coming to mobile (venturebeat.com)
63 points by neya on Oct 2, 2012 | hide | past | favorite | 74 comments



PHP's killer app is the LAMP stack and $5 hosting. Unless you can replicate that familiarity on a phone, PHP wont find traction. There are far better programming languages out there with more backing, and I don't think not having PHP has been a major hurdle for mobile development

PHP is the core web language because PHP devs (for the most part) are cheap, replaceable parts. You need to be smarter than that for mobile development, and anyone smart enough for mobile dev won't use PHP if they don't have to.


Sorry, but that last line sentence has really touched a nerve, maybe I'm being trolled, but here comes my 2 cents anyway.

I personally use PHP all the time, I love it. I can code large, maintainable and secure applications with far more speed than any other language I've ever used ( and trust me I've used a lot ). It's my language of choice when I'm building web applications.

Not only is it available everywhere! but it's been established for long enough that there are a wide range of top quality frameworks and libraries written for it. Oh and these have been written by developers who I'm certain are much smarter than us both.

And why the hell is mobile development any harder than web development. It's just code, not arcane magic. Trust me I've seen, and will continue to see, just as much badly written/badly performing code for mobile applications as I do for web based ones. Just because you're using Objective C / Java as the tool of choice doesn't make you any better or smarter a developer.

If there is a mobile offering coming up based around PHP, I'm looking forward to trying it. If it allows me the same benefits as the language does on the web then I'll be using it, regardless of how many people think that makes me "not smart".


Very well-written. I agree with you 100%. The PHP bashing has gotten really old.

I too am looking forward to what this new mobile PHP project will entail.


If it allows me the same benefits as the language does on the web then I'll be using it, regardless of how many people think that makes me "not smart".

That was part of the OP's point. "PHP's killer app is the LAMP stack and $5 hosting."

That option makes PHP useful in many cases where arguably better languages would not be smart choice.

But, without that same value in the mobile space, what's the case for using PHP over, say, Objective C or JavaScript or Ruby or Lua, other than not knowing Objective C or JavaScript or Ruby or Lua?


Let's go over those:

- Objective C: not a competitor as it doesn't do multi-platform, which I assume will be PHP's main angle.

- Javascript: weird OO model (compared to PHP's traditional OO), much smaller set of API's, typically tied to a web UI (PHP would probably wrap around native UI API's). Along with C# I consider this the strongest contender, but I can see why people would prefer PHP.

- Ruby, lua: does anyone actually use those on mobile? I'm sure they have their qualities, but those are really niche languages (on mobile). To me these are not serious competitors.


given that the whole point of Lua is that its easy to embed and run everywhere, I can guarantee that someone is using it on mobile somewhere.


re: Lua. http://www.coronalabs.com/products/corona-sdk/

There's RubyMotion for iOS, and some JRuby->Android thing I haven't looked at in a while.

BTW, what about PHP's OO is traditional? Certainly not traditional like Smalltalk. JavaScript s probably better thought of as prototype-based, not OOP.


Lua is very popular with iOS game developers.


Lua is very popular with most game developers.


There is a Lua mobile game framework as well (which is why I popped Lua into that ad hoc list).


I'd love to see you write a detailed case study defense of PhP...even though I realize it's kind of a raw deal to be expected to mount a formal defense for your own profession, especially given how much it gets trolled. But from the non-PHP fan's perspective, PHP persists because it has a strong foothold, not because it is clearly a more secure and enjoyable language.

It doesn't help that PHP's ubiquity has attracted its fair share of bad programmers. Maybe not more than other languages, but the human mind, when lacking available data, will make judgments based on absolute count (I.e. I know more terrible PhP programmers than I know terrible Go coders) rather than by ratio.

I started with PHP and did not enjoy the syntax, though I doubt I would be in web dev had PHP's stack on Dreamhost made it easy to make my first interactive apps. But I could never say that its conventions are conducive to good coding habits...but I have no place to judge, as I was a bad coder when I learned PhP and I may have been just as bad were I to start out with Python.


> PHP persists because it has a strong foothold, not because it is clearly a more secure and enjoyable language.

It is still immensely satisfying to write in any text editor <?php echo (2 + 2); ?> and then see 4 on your screen. And then to wrap that in HTML and really get going. No compiling, no libraries to include, that's it. After writing code in Java and C (12 years ago), that is a breath of fresh air, and that's what got developers of my generation interested in PHP.

Do you have more options today? Absolutely. Python and Ruby were extremely obscure back then. No longer. You have Node.JS and of course, good templating libraries for all of the above.

But PHP is a templating language at heart and it's still the easiest to embed into HTML and see immediate results. That's pure joy.

Funny part? None of my production PHP code touches HTML or any client side stuff in any way. It just pumps data from the database to the client-side JavaScript.

And it's still immensely enjoyable. Why? Because PHP is aimed at the lowest common denominator. It has to work for that dude in India and it has to work for the 50 year old guy who just decided to switch careers. Which means the base language has to be dead simple. And it is. It's pretty much C with a few web-centric functions thrown in. That simplicity is enjoyable.


I'm sure it's all fun and enjoyment while you're writing the code; but what about going back 2-3 months later, or worse, hiring additional developers on the project? How enjoyable is it to have reams of inline server script across multiple pages with no clear structure or intent?


Thanks for the answer. I agree with the ease part. And not touching the HTML, if that's how the app is arranged, is also good...I think my worst memories involved maintaining PHP that I (not knowing better) just threw into HTML when it seemed right.


>there are a wide range of top quality frameworks and libraries written for it

Exactly. It makes it a great first language too, since it's interpreted right off the bat for a LAMP stack.


You are indeed being trolled. Through the years I have learned to avoid PHP haters all along. While they are wasting their time trying to prove they are better, you are probably getting things done or just enjoying your day because you have already finished.


The reality of it is that it doesn't matter. People have their reasons for making their particular choices, neither of which are good or bad, or are worthy of avoiding or seeking out. I disliked PHP enough to move my career a different way; so fucking what?

As such, you're basically wasting your own time trying to prove PHP haters are worse off.


You had a valid point right up to your last sentence where you just had to take a dig at PHP devs.


Do I need to apologize for pointing out PHP's obvious flaws and that anyone who doesn't need to use PHP for hosting reasons or for library/framework reasons probably isn't using it?

I use PHP to develop for the web every day. Thus far, the friction of PHP being a bad language hasn't outweighed the utility of it being easy, though as time goes on that utility is worth less and less.


You should apologize for insinuating a person's choice of a programming language is a reflection of their intelligence.

I'm sure you're perfectly capable of writing marvelous code in PHP or any other language.


Most PHP programmers aren't choosing PHP from a toolbox of 5-10 languages that they know really well. They're choosing PHP from a toolbox of one language that they kind of know.


I've written my own programming language and VM, and I mostly use php for web development because it's quick, easy and gets the job done. Your theory that php developers are lazy and stupid is just nuts. You can write bad code in any language if you want to.

I think you've perhaps gotten into the trap of assuming that if a programmer doesn't use the latest cool language (Ruby, Coffeescript, etc.) they are dumb.


The comment you're replying to didn't assert that most PHP developers are lazy and stupid, but rather asserted that most PHP programmers are using PHP because it's the first "web" language they were introduced to and they haven't really learned anything else.

And that's okay. But I'd strongly assert that "PHP is quick, easy and gets the job done" does not support the assertion "PHP is a well-designed language." From what I've seen, Laravel is as high-quality an MVC framework as anything you could find in another language. But if it's a truism that terrific coders can produce terrific code in any programming language -- and I think it is -- then "there is terrific code in PHP" is not a defense of PHP's language design.


> From what I've seen, Laravel is as high-quality an MVC framework as anything you could find in another language.

No, it's not. You should maybe replace Laravel with Symfony 2.


"Most NodeJS programmers aren't choosing NodeJS from a toolbox of 5-10 technologies that they know really well. They're choosing NodeJS from a list of hipster approved technologies that they can brag about to their friends."

See, I can make ridiculous statements about things I don't know anything about too!

(note: I no next to nothing about NodeJS - I enjoy javascript as a language but haven't had a chance to actually use NodeJS beyond a couple tutorials)


thats completely not true. I've worked professionally with both C# & Java (at enterprise level) but my current job uses primarily PHP for development - i feel very comfortable with it and i'm more efficient in it than doing the same web development in eiher of the two languages.

I also touched ruby and python but I don't consider them part of my knowledge since I didn't really use them professionally and thats why I don't want to include them in my statement above.


Can we take a look at the data you analyzed to come to that conclusion?


He has none - he's spouting an unfounded view about a technology that he has no idea about.


debacle stated upthread that he uses PHP daily.


> Thus far, the friction of PHP being a bad language hasn't outweighed the utility of it being easy, though as time goes on that utility is worth less and less.

But he uses it only because it's easy? Sounds like the very kind of developer he's trying to mock.


The developers he(?) is mocking use PHP because it's the only tool they know. He, supposedly, uses PHP because he has decided it's ease of use (and deployability) make it better than the other tools he knows for the projects he's working on. I don't think this is hard to figure out from what he's written here.


You should apologize for insinuating a person's choice of a programming language is a reflection of their intelligence.

That's not what I got from the comment (though, as an aside, I do think that there is a correlation between programming smarts and language/framework choice, adjusted for circumstances.)

It sounded to me that people pick PHP for assorted reasons, one being the surrounding support environment (cheap hosting, ease of slapping together a works-ok-right-now site, ease of finding replacement devs when needed). Another reason for choosing PHP, though, is because you don't have to have serious coding chops to make practical use of it.

OTOH, mobile dev requires at least some serious coding chops, and does not have the equivalent support environment for PHP. And if you have some decent coding chops you are likely to want to use a better-designed language than PHP.


"I do think that there is a correlation between programming smarts and language/framework choice, adjusted for circumstances."

Please, explain this in further detail. List out which languages are "smarter" and why. Please provide empirical evidence to back up this thesis and explain the methodology followed to gather and interpret the data.

Otherwise, stop saying ridiculous things that you can't back up.

In addition, please explain what about PHP makes it unsuitable for the mobile platform when clearly Java does just fine there. I'll need more then a link to the "fractal of bad design" blog post. I'm honestly curious why people continue to talk about PHP's bad design without really explaining what makes their chosen replacement better.


Please, explain this in further detail. List out which languages are "smarter" and why. Please provide empirical evidence to back up this thesis and explain the methodology followed to gather and interpret the data. Otherwise, stop saying ridiculous things that you can't back up.

Please, get over yourself. I expressed an opinion. I wrote "I do think that ..." It's obviously anecdotal, based on personal and professional experience. YMMV and all that. Stop with the pretentious "back up this thesis" crap.

I'm honestly curious why people continue to talk about PHP's bad design without really explaining what makes their chosen replacement better.

I guess it's like porn. You know it when you see it.

I'd choose Ruby over PHP for Web dev any chance I could. I doubt I have the resources to prove to you why this makes sense. Such is life.

I did a few years of PHP work, then learned Ruby, and never looked back. What can I say. As far as a can tell the range of available libraries for each language is about equivalent. I can use JRuby and use any Java lib as well. Deploying and hosting Ruby or JRuby is quite easy for me. While Ruby is not flawless I am personally convinced is less sucky than PHP. Opinions may differ; it matters not to me.

If your experience is the the contrary, go forth and be happy in your choices.

I have a feeling I should link to some pg essay at this point, but I'm too tired to go find one. Besides, those who care will likely have already read it, and those who don't, won't.


I'm not being pretentious. I'm demanding that before you spout off about the intelligence of a group of people, you back it up with a reason for why you think that way. Otherwise your comment/opinion is utterly without value and shouldn't have been posted at all.


Your two sentences sort of contradict each other.


Which two, and in what way? I had to re-write my initial comment a few times because I realized I wasn't getting my point across properly.


I do mobile and PHP almost alternatively, and I don't know where it puts me in you definition. PHP is ugly, but ugliness is far from the first thing to care about when choosing a language.

Mobile is hard, but good (PHP) server side devs are not cheap or somewhat less valuable either.


> PHP's killer app is the LAMP stack and $5 hosting.

$5? Try $0, how many ISPs provided 20~100MB of hosting with PHP and a MySQL instance to any of their client for no additional charge? Around here, pretty much all of them did.

Hell, just look at things like that: http://www.000webhost.com/ PHP, MySQL, 1.5GB space and 100GB/months bandwidth for $0. Want Ruby? Python? Perl? It'll be $5.


Mobile dev being too hard for PHP devs is a naive idea. I think php is kind of a historic language, not many people would choose to use it if they weren't forced. There are obviously a lot of bad design decisions that went into the language. I think for those reasons, it won't catch on for mobile devs. Many of them had to tolerate php at some point and understand why there is no good reason to go back.


Opinions aside, it's still true that native apps can do things that things generated by PHP fundamentally can not.

Examples include spawn true threads, truly use multiple cores with no "global interpreter locks" of any sort other than those explicitly coded in the native app, get at hardware accelerators on a platform, etc.


Why is mobile harder?


Different screen sizes, different capabilities of machines, more of an eye on performance, and persistent apps mean actually thinking about memory management.

Unless Zend's idea is "bring localhost to your mobile phone," there are going to be a lot of hurdles to adoption.


The web has always had different screen sizes and very different capabilities of machines. Heck, having to code for IE6 should trump any difficulties faced in mobile.


<rant>

The link intrigued me that PHP was coming to mobile but the only sentence in the entire thing that spoke to that was "But, he hinted to me, PHP and Zend will be providing client-side app-enabling tools." The rest of the article is just filler about the history of PHP.

I mean really, this is the definition click bate: a bunch of filler and one tiny smidgen of information.

</rant>

Personally, while I'm not a huge fan of PHP it is one of the most useful languages I've learned so I think that mobile PHP is pretty exciting.


The accessibility is a huge selling point, but also (and often overlooked) is the non-prescriptivist nature of PHP. For so many jobs (and yes, even in enterprise) you just need to get the project done and out there. It doesn't have to conform to perfect OO standards and doesn't have to follow certain architectural specifications. PHP is great for that.

When you need to take it to the next level and establish a really good and efficient standard, there are extremely well-done frameworks to assist you. But when you just need to get something done, sometimes PHP's "do it anyway you can" nature is it's biggest feature.

It will be interesting to see what mobile play Gutmans et. al. have. If they can bring that same "let's just get it done" mentality it may have a chance. Interested to see how it goes down.


It's hard to write "do it any way you can" code when you're dealing with a GUI object model. PHP works because all you're doing is writing to stdout.


Your junior-level knowledge of web development is coming out in your overly negative and anti-PHP ranting today. The end result of any backend web service is quite simply "writing to stdout". That's how HTTP works. How exactly does the transport mechanism have any bearing on the platform?

Let's not forget web development today consists of a substantial amount of both back-end and front-code, the latter of which operates in a fashion much like GUI object model.


But the "just writing to stdout" aspect is much closer to the surface in PHP than in, say, Django/Python, where your code's last interaction with a web request is returning an object from a view. IMHO, that's one of the cool things about PHP.

But that aspect of PHP probably won't translate to GUI programming. I don't know if it has any other features that will make GUIs similarly easy. The fact that web front ends operate like OO GUIs doesn't really help your point (if you're arguing that PHP is well-suited for GUIs), since those aren't written in PHP now.


> Your junior-level knowledge of web development

Lets not make personal attacks here, okay?


You mean like this one?

> PHP is the core web language because PHP devs (for the most part) are cheap, replaceable parts.


Your top-level comment's last statement was, in a way, a personal attack on every PHP developer on here.



I've used PHP-GTK, and it's not bad, and I don't want to rain on your parade, but there's a reason this list is empty:

http://gtk.php.net/apps/


In other news, the world's largest manufacturer of hammers has announced a new model accepting hex-bit screwdriver tips in the end of its handle.


What PHP needs is the ability to run websockets natively without extra setup. Right in a mod_php or PHP-FPM. None of the current platforms have this right. You always have to run extra web servers in place of Apache or Nginx. Yes, this is also a thing that Apache, and Nginx have to figure out. Running node.js or Go web servers is too immature.


It'd be far easier to fix any problems you have with node.js than to extend PHP to make this practical.


If you're afraid of immature technologies, why use websockets to begin with?


Good question. I see this more or less like chicken-egg situation. Right now it seems that client side is quite well maturing. Client side is the easier part of websockets. PHP's whole model is 'shared nothing', that's why it fits so poorly with websockets. 'Real-time' two-way communication with the server and the clients is getting more and more common in web apps, and even web sites. I'm not sure how the server side of the websockets are going to be solved. If PHP gets it right, it will probably have great future ahead. These days we need to revert to dual solution, main system behind Apache or Nginx, and websockets with for example custom node.js servers. It is far from optimal.


I'm skeptical that PHP is the "web's most popular programming language", and feel it serves no other purpose in the title than to be inflammatory.

From the article: "Wikipedia says 75 percent of websites use PHP."

From wikipedia: "PHP is used as the server-side programming language on 75% of all Web sites"

However, that's not what its source says.

From wikipedia's source[1]: "PHP is used by 78.1% of all the websites whose server-side programming language we know." And I'd be willing to bet that PHP (and the runner-up, ASP.net) are easy to identify considering the pages end with particular extension (which isn't the case with other technologies).

The article gives no other proof save an unverified quote from Zend that states that PHP runs 35% of web requests. It even gives evidence to support the conclusion that PHP's popularity is declining.

[1] http://w3techs.com/technologies/overview/programming_languag...


This article is perfect example of PR Speak passed on as news.

in the article head, it says "PHP, the web’s most popular programming language, is coming to mobile" but then nowhere in articles author mentions about this except in the end where it says "Coming soon"!

WTH?


It's a press release (well really a comment made to the press) used as a nice link-bait filler news article. Drew Curtis of Fark.com fame wrote a great book with this and more examples of news industry behavior that is even more true in the link-bait world.

http://www.amazon.com/Its-Not-News-Fark-Media/dp/1592403662/


Malaria, the world's most popular disease.


For an article whose title is about PHP moving to mobile, it's quite disappointing that they literally spent only 3 sentences on it... at the end. And didn't even say anything worth reporting. Link bait.


I think this might be the angriest, most uncivil HN discussion I've seen so far.


Is this your first PHP thread? Pretty much all of them turn into a "ha! ha! you use php!" and those of us who use it to build things justifying our decisions.


No, there are a few others recently, and at least a technical discussion might actually break out.


Coming from the .NET world, the single biggest problem I have seen with PHP developers is their lack of life cycle concept understanding. This will probably prove to be the most challenging part when PHP developers start to engage with singletons, IoC etc. For example any .NET developer would laugh/cry with this: http://www.slideshare.net/go_oh/singletons-in-php-why-they-a...


Interestingly, that's why a lot of my colleagues and I dropped .Net (and Java) like a bad habit... Singleton, IOC, Dependency injection, GoF hell.

NOT that PHP is a good alternative; Only different perspectives on the same issues.


Heads are exploding all over Hacker News.


PHP's core strength is that it is a DSL for serving websites. While it can be used for other things, I see zero benefit in bringing it to mobile.


Also, the philosophy of PHP is a batteries-included approach of bundling everything so you rarely need an external library. Both of these things seem fundamentally at odds with mobile development, but who knows, maybe they can chisel something out.


Why is this on front page? It is a total fluff piece with no real value.

"But, he hinted to me, PHP and Zend will be providing client-side app-enabling tools."

There are already bunch of client-side app-enabling tools thousands of devs are using with PHP already. Holy shit .. but .. Zend is coming up with some awesome batshit secret new sauce for client-side that will work with PHP! Mind = Blown!

</rant>


PHP article yet the 'nice' image at the top seems to be OSX booting in verbose mode.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: