Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PHP is addictive.

You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.

And it will work on all servers and on all operating systems.

Millions are made by average developers developing themes and plugins for wordpress.

Hard to beat all that.

#drama is for queens :)



> You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.

You can. But I shudder to imagine one file containing everything you just said. Also, I'm skeptical about the security claim. I'm not talking about PHP-specific vulnerabilities here. Rather, the developer of such an app might be pretty naive, and might build in his own vulnerabilities.

> And it will work on all servers and on all operating systems.

The same is true of most mainstream languages. Ruby, Python, Java, and Node are probably the big competitors in the web dev space. All of them can run on Windows.


You can. But I shudder to imagine one file containing everything you just said.

Look on my works ye mighty and despair (i know I have): https://gist.github.com/kennethrapp/0ebbd15b509d8f18b095


As someone who's had to deploy PHP apps to various servers on various operating systems, I can guarantee you that your third line is absolutely not the case. You can deploy much code to many servers on some operating systems, but it's far from universal.


It's only universally deployable if the developers knew what they were doing.

The same can be said of any language, it just happens that PHP makes it a bit easier than the others.


The problem is that cheap hosts will often not support newer best practice libraries like PDO. So apps that are widely deployable tend to end up as a jungle of mysql_query().


Is this really still the case?

Granted, it's been a while since I went shopping for hosts, but I thought these days more and more hosts (even cheap ones) at least support 5.3+ if not 5.4. PHP got a huge swath of improvements in these releases so I'd imagine these were more well supported. I mean we're in the middle of 2013 for crying out loud.

I also see more and more cheap VPSes popping up and these may be a more attractive alternative (for novice admins/developers, I think these are still a bit too intimidating).

The biggest hurdle is still the lack of quality tutorials that use PDO for complex projects. You still see a whole bunch of older examples out there that still use mysql_query() and the like and not many that do "A-Z of Building a blog with PDO" or similar.

The power of quality free tutorials shouldn't be underestimated.


It varies, but it's often server configuration as much as language version. You'll still find servers with magic_quotes enabled and a bunch of features disabled.

VPS is a better alternative, but at that point it's just as easy to use something other than PHP.


Ouch. So it's still the wild west out there.

I hope there will come a time for some standardization for web hosts where minimum versions for software packages and sane defaults are enforced. I agree, anyone deploying on VPS really don't have shared host bounds any more.


>You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.

And it's very, very difficult to do that properly, because PHP seems to go out of its way to make all of those things (APIs, DB management, security, functioning) difficult.

>And it will work on all servers and on all operating systems.

Except for UNIX, where function X does Y instead of Z, which it does on Windows. Usually, except in PHP 5.5 and above.

WARNING! If php.ini variable A is set to B, then the above does not apply and instead behaviour C takes effect.


PHP's PDO is extremely easy to work with. Seriously, it's like 5 lines of code to connect to a database and retrieve information. Is that really all that difficult?

Security? DB-wise, use PDO and named parameters. It's passing in an array. Sessions? For private servers, using file-based is fine. For shared or for scaling, use DB/memcache.

APIs? It's dead easy to implement a RESTful interface. Interacting with remote APIs is nothing more than some curl commands, or your tool of choice.

Explain to me what's so difficult here?

Having a language behave slightly differently between different operating systems is ... expected? Maybe? I'm not sure, I never use PHP on Windows. Why would I?


Common Lisp is addictive.

You can create a whole web app in one CL file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.

And it will work on all servers and on all operating systems.

Also hard to beat that.


Just need to find a CL developer for hire...


> fully functional

FTFY


CL people are not very tolerant of functional nazis. (Probably because functional nazis are usually static type system junkies who scoff at macros and incomplete-impure-but-working solutions to problems which are often associated with CL.)


Indeed. I've found PHP simply allows me to get things done and consequentially it put a lot of food on my table.

There are only two kinds of languages: the ones people complain about and the ones nobody uses - Bjarne Stroustrup


> You can create whole web app in one PHP file from scratch and it will have everything including API and DB management layer and be secure and fully functioning.

> Millions are made by average developers developing themes and plugins for wordpress.

Yep, and thanks to people actually believing in that, php is also keeping the security industry alive and well.


I've been clean for four years now


About 2 years for me. Keeping strong.




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

Search: