Hacker News new | ask | show | jobs
by dribnet 4641 days ago
This was an interesting talk. My own interpretation was that PHP's strengths were claimed to be:

1) State => because endpoints have no persistent state

2) Concurrency => because there is no concurrency model

3) Transparency => (1) + (2) + fast reload = easy to understand

These combined give the language nice programmer "ergonomics" (Keith's terminology). It also limits the collateral damage any particular change to the codebase can have which allows Facebook to more confidently deploy multiple times a week.

2 comments

I think PHP's strength is that the default way of how sessions work makes you intuitively build shared-nothing architectures that parallellize easily and have session data that is hard to corrupt. Sessions are locked at the beginning of the request, and the changes are committed atomically at the end of the request. The next request by the same user is blocked until the session is unlocked. This means that any error causes a rollback to the last known valid session state, and that it is basically impossible to have concurrency bugs (though obviously a PHP server can handle more than one request at a time if they're coming from muliple user sessions). A PHP app that gets an error will typically recover just by pressing F5, whereas in other platforms often you have to log out to throw away corrupted session data. I had little appreciation for this myself until the PHP app I work on reached the point where it had both a large codebase and a large userbase.

Remember also that a large part of the reason why facebook won over its competitors (friendster and myspace) was technology. Both myspace and friendster had trouble scaling up their featureset at the same time as their userbase, whereas facebook pulled it off relatively well. It's hard to know without inside knowledge whether PHP had anything to do with that, but it obviously didn't prevent facebook from winning.

Indeed, there's something to be said about shared-nothing. Lua takes the cake in that since it can be so easily fit into so many nooks and crannies.