3 ms·
i've taken to writing some console-oriented tools in PHP for projects (and sometimes just my own stuff). It hit me years ago that it was pretty easy to do stu
by mgkimsal 8y ago
i've taken to writing some console-oriented tools in PHP for projects (and sometimes just my own stuff). It hit me years ago that it was pretty easy to do stuff like db connections, decent filehandling, etc as one-off scripting vs bash. Sure, perl/ruby/python are there, but if you're already using PHP for a main project, extending cli stuff out in to PHP as well is handy (handier than bash, by comparison).
PHP can scale up or down, but some tools are harder to 'scale down' - by that I mean be able to be used for short one-off things (cli tools, etc). I'm not saying it can't be done, but people don't often write smaller supporting tools (quick text preprocessing before an import, for example) in Java, even when their main projects are in Java. Of course, IME, and YMMV.