3 ms·
> Why would I choose PHP when starting a greenfield project? Ease? I have not professionally used php since php4, and last set it up in php5.x. Last night I
by lelanthran 5y ago
> Why would I choose PHP when starting a greenfield project?
Ease? I have not professionally used php since php4, and last set it up in php5.x.
Last night I wanted to send some data to an http server, a small payload of json, that would be saved into a DB and queried later. Took me all of 5m to realise that my php test script that receives the file can be copied over to my el-cheapo webhost account unchanged and work fine.
No extra "database" modules to download, then install on a host I've no shell access to, sending email worked out the box, etc.
Php reduces the friction. I remember trying to use Python for something (with Django, I think) in 2011 and it was absolute hell to get deployed onto my webhost; fingers burned, I won't touch it again.
Php is basically batteries included, and works everywhere. I'm sure the Python, Node or Ruby alternatives are elegant, and neat, etc ... but if I wanted that, it means the project is expected to be large-ish, and for anything more than a few thousand lines of code I'm switching to a compiled language.
- xigoi 5y agoIf you use CGI, you can have it just as easy with any language.