3 ms·
Friends don't let friends use PHP. > since it's so widespread if I want a small script that'll almost certainly run "in most places" I'm likely to turn to PHP
by toothbrush 11y ago
Friends don't let friends use PHP.
> since it's so widespread if I want a small script that'll almost certainly run "in most places" I'm likely to turn to PHP
I'm curious about this though—isn't sh literally required by the POSIX standard? How is PHP more ubiquitous than sh? I certainly don't have PHP installed.
- i336_ 11y agoGood point. A "small script" might not necessarily be very simple - it might only have 5-10 lines, but those lines might involve parsing HTML, connecting to a remote host somewhere, running a one-time listening server, nontrivially processing a set of files... any number of different tasks. sh is good for job execution, piping and redirection, and task management, and it launches processes like sed, grep, and awk to handle text processing. Beyond that, simple, one-time HTML parsing can be done with sed and grep, but it doesn't work very well (and I'd never use it in production), I can't really easily connect to a server without netcat or socat (or, in a pinch, bash's exec operator, which is slow in practice - I wrote an IRC bot in bash, its CPU usage skyrocketed easily), or for more complex tasks involving HTTP requests, curl or wget. It's ultimately impossible to know whether someone has Python, Perl, Tcl, Haskell, Ruby, Node.js, or even PHP installed, and able to run console scripts... but only a language like one of these comes with a base library competent enough to include functionality to achieve all the goals I noted above.