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

PHP is for webdev. That's it. Go outside the bounds of that and it loses its magic. On its own it's great for spitting out a webpage. It's a scripting and templating language in one, which is kind of cool.

That said, outside of that to make PHP work on bigger projects you end up with a lot of structure and ceremony that make PHP suck, not quite as much as Java, but it's not amazing.

Thiings like testing and testability aren't much fun in PHP. For a long time package management was a joke.

PHP is for webdev. That's it.



I can't agree with that. Personally I happen to use PHP not for web development, but almost exclusively for system administration and monitoring (I'm not a web developer). It's very comfortable using PHP in these areas, as:

- PHP and many of the PHP extensions are packaged for about every major OS and architecture

- a lot of functionality is already shipped with the interpreter (so no additional stuff necessary)

- it's very easy to deploy We've tried a number of options, especially in the monitoring area, but PHP eventually seemed to be the most suitable for the job.


Deployment is "easy" because you just copy a bunch of files, right? Reproducible deployment takes a little more effort, but it's well worth it when the time comes to upgrade a server, or a pipe bursts on top of your existing one.

Python has your other advantages, quite a lot of existing monitoring software, and is a far more pleasant language to program in.


Well, you could just copy a bunch of files, if that's all you need to do. But ideally you'd use a tool like Fabric to do your copying/moving, symlinking, server config changes, etc.

We use Python for a number of things too (and yes, I like the language a lot). The only trouble I have with Python in this context is actually cross platform support. It's a bit harder to get packages for the latest and greatest versions of modules and the interpreter if you have to deploy to e.g. Solaris 9 systems, unless you create them yourself. Theoretically it should have the same advantages, yes.


I'm curious: how is testing/testability in PHP different to make it less fun than other languages?


It's not. PHPUnit and dependency injection make it dead easy to mock objects and make testing stupid easy.




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

Search: