4 ms·
Hey, the PHP creator included a selfie! (Full disclosure: I write PHP on a daily basis, and reject the opinion that it should be avoided for various reasons, b
by oneeyedpigeon 11y ago
Hey, the PHP creator included a selfie!
(Full disclosure: I write PHP on a daily basis, and reject the opinion that it should be avoided for various reasons, but I recognise the stereotype (that it's not a very 'good' language) enough to derive humour from it - consider it sort of self-deprecating)
- i336_ 11y agoIn all fairness, it's what I switched from VB to. My current position is that HHVM's existence means that PHP is a serious contender and kicking it out the window is probably not the greatest of ideas. The fact that it doesn't have good console interaction support out of the box kind of killed it for me though. Once my computer setup's stable (this 1024x768 laptop screen isn't that great for dev work :p) I'm going to be looking at some other languages. I don't mind PHP overall, and 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. (To continue the console argument, though, it's entirely possible that php[-cli] might not be installed, only the Apache module, which is annoying.) Similarly, if I was to build a major "community-oriented" project which I wanted to succeed... I might actually write it in PHP because it's such a simple language to work with and learn (at least it was in my case). My personal goal is to keep it a "minority" language, though. Going forward, if I write for my own purposes I want to try and use other things, and if I had to use PHP internally somewhere I wouldn't be that impressed. :p
- toothbrush 11y agoFriends 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.
- jordanlev 11y agoYeah, it seems that most of the anti-PHP bias is from programmers building things that they deploy themselves. But for sites that are built by non-programmers (e.g. web designers... there are a ton out there building CMS-based sites, they dabble in programming but don't get too deep), the fact that it easily deploys on most shared hosts can't be beat.
- 542458 11y agoI'm with you there - you can pry PHP out of my cold, dead hands. You just can't beat it IMHO for getting small systems up and running quickly. Lots of available libraries and code, and it's either preinstalled or trivial to install on almost everything these days.
- odbol 11y agoAren't the preinstalled versions insecure by default?