It's just a tool

Previously: [Part 1][programming1], [Part 2][programming2], [Part 3][programming3], and [Part 4][programming4].

I received an interesting question the other day from a recruiter:

> Would you be open to moving away from PHP?

My answer:

First, by analogy. I’m a photographer, most of the cameras I own are manufactured by Nikon. This is like asking if I’m open to using a Canon.

I happen to be very adept with using a Nikon. However, I don’t think [the photons bouncing around care much what logo sits on front of the camera][camera purchasing] they are in. I’d be a poor photographer if what I did was care about the brand of camera I carry instead of the picture I am taking.

PHP is designed to solve one problem: the web problem. It solves it very well—as evidenced by marketshare and its continuing durability. At nearly all other stuff, PHP happens to suck at.

However it (the web problem) [isn’t that difficult] of a problem (having been solved repeatedly by languages such as Ruby, Python, C, C++, Java, Javascript, etc.). The real difficult parts are invariably outside the “web problem.” (Example: Twitter’s web problem was solved in Ruby using Rails, but their real problems were not web problems and of those problems, the most prominent was solved in Scala.)

I happen to be very adept at PHP. That pretty much means knowing that there is a better tool than to use PHP to solve the problem at hand at hand, and using that instead of PHP: MySQL, Apache, memcached, MongoDB, CouchDB, Scala, Erlang, Puppet, CruiseControl, AWS, etc.—none of which, to my knowledge anyway, written in PHP.

I’d be a poor programmer indeed if I thought that the problems I solved cared much the language I was adept in.

I’m not a poor programmer.

The Short answer: “Yes. Depends on the problem and the existing environment.”

(Recruiter was amused by my answer because he was owns a Canon. I suggested we “get on either side of the street and start making threatening dance moves at each other like [the Jets and the Sharks][west side story].”)

Another question I got:

> Which do you think is better [some programming language] or [another programming language]?

My answer:

They’re just tools. That’s like asking a handyman which they think is better: a hammer or a screwdriver.

(That elicited a laugh.)

Using a programming language is simply [a choice][making choices]. There are many things that go into making a correct choice that are far beyond what language one prefers for a problem that happens to be not that hard to solve in the first place.

[programming1]: http://terrychay.com/article/learning-programming.shtml “Learning Programming Part 1: 5 million”
[programming2]: http://terrychay.com/article/learning-frameworks.shtml “Learning Programming Part 2: Programming Frameworks”
[programming3]: http://terrychay.com/article/learning-programming-part-3-c-cplusplus-superiority.shtml “Learning Programming Part 3: C/C++ superiority”
[programming4]: http://terrychay.com/article/programming-is-hard.shtml “Learning Programming Part 4: “Programming is Hard””
[camera purchasing]: http://terrychay.com/article/camera-purchasing-aphorisms.shtml “Camera purchasing advice”
: http://terrychay.com/article/is-ruby-the-dog-and-php-the-dogfood.shtml “Is Ruby the dog and PHP the dogfood?”
[making choices]: http://terrychay.com/article/simple-prescriptions-and-making-choices.shtml “Simple prescriptions and making choices”
[west side story]: http://en.wikipedia.org/wiki/West_Side_Story “West Side Story—Wikipedia”

PhotoAdvent

Last year, I decided to do a fun project with me and 25 of my closest friends called PhotoAdvent. It was a shameless copy of PHPAdvent, but wherever you see “PHP” you replace it with “Photo” — I even swiped (with permission) their theme from the previous year (delta writing it by hand because apparently they don’t use WordPress to do PHPAdvent and I have to support the mothership.)

In any case, this year I contributed an article. Let me tell you it was work convincing the curators at PHPAdvent to accept my submission. But after an intense lobbying campaign with the other two editors, we finally posted it.

PETS: Reflections of the Internal | PhotoAdvent

Four out of five Scrooges agree, this is worth reading.

So read it or die! And when you are done, you better tweet it or share it on Facebook, or I will get Gibson to CUT YOU! (No, I do not declaw my kittehs.)

Oh yeah…Happy Holidays!

Notes from Checklist Manifesto

In Montreal this summer, while making idle conversation, Paul asked me if I had read anything interesting. Here was my answer…

Five years ago, I met D. Richard Hipp because my friends were thinking of bundling a database he wrote into PHP. Since that time, besides being in the PHP core and thus about 40% of the web servers on the planet, SQLite is in every smartphone, in software such as Firefox, platforms such as Adobe AIR, and operating systems such as Apple Mac OS X. It is used by Oracle and Bloomberg.

I was curious how the unassuming man I met took the new-found fame of his pet software project. This is why, despite my hatred for all things database—they’re boring and talks about them are probably what it feels like to sit through a course on actuarial accounting—I popped into his talk at OSCON.

I was glad I did. It was about, of all things, checklists.

My brother and father are much more responsible than my mom and me. One things that separates them from us was in their methodical use of checklists. Watching his talk reminded me how important they are, how they can be used for so much more than I considered, and how thankful I was that I finally made a packing checklist before going to Portland (and Montreal). 🙂

Read the article, and, if that interests you, buy the book.

With a little imagination, a checklist will change your life.Continue reading my notes from the book after the jump

Learning Programming Part 4: "Programming is Hard"

Previously: Part 1, Part 2, and Part 3.

Programming, it turns out, is hard.
Eloquent Javascript (and typical)

A few months ago, a girl expressed to me her frustrations about, in particular, the attitude expressed many engineers on her attempts to learn to programming.

“They act like learning programming is hard. They imply that if you haven’t been programming since you were seven, there’s no hope for you,” she explained.

I opined, “If someone can learn to program when they are seven, then it must not be that difficult.”

Think of all the things you couldn’t do when you were seven—programming is less difficult than all of those.

Super Tuesday

When I first moved to San Francisco, the PHP meetup group hadn’t had a meeting in a year. That was before [Touge][touge] took it up, and, along with [Mariano][mariano], does the hard work of actually scheduling people to come shoot the shit.

Apparently, it’s time for my shit to be shot.

[Tomorrow, I’m giving a talk][talk] at [SFPHP][sfphp] on [DevOps][devops] for PHP developers. I’ve giving this talk before as the [closing keynote][lineman phpcomcon] at [PHP Community Conference][phpcomcon] and [to sysadmins][lineman oscon] at OSCON.

> **Living without Your Linemen: The Programmer Becomes System Operator in the Cloud**
>
> If a website architect is the quarterback, then site operations is the offensive line—overworked, under-appreciated, and only noticed when it fails. They make you look good. However, four years ago cloud computing networks like Amazon Web Services and Slicehost have appeared. While deficiencies in frameworks in other languages have forced those worlds to adopt Infrastructure-as-a-Service, the PHP world—with it’s ultra-cheap shared-hosting (on one end) and tradition of dominance on some of the most trafficked websites (on the other)—has been slow to move. But as the technology continues to disrupt, modern web engineers will be expected to use their programming skills to not only build, but also provision and maintain fast, scalable websites.
>
> The efficiencies of a web-based language and experience in scalable website architecture offer a unique opportunity for programmers to transfer their skills when wearing a sysop hat. Not to mention some of the best libraries for programming them are written in PHP! When going from a small pet project to a go-live site, maybe we can learn to live without our linemen.

Trust me, you’ll like it.

[Please come][talk]!

Also, If you are an American citizen, go vote! 🙂

[talk]: http://www.sfphp.org/events/33726032/ “Living without Your Linemen: The Programmer Becomes System Operator in the Cloud—SFPHP”
[sfphp]: http://www.sfphp.org/ “The SF PHP Meetup Group—SFPHP”
[mariano]: http://twitter.com/marianopeterson
[touge]: http://www.grepmymind.com/ “Grep My Mind”
[devops]: http://en.wikipedia.org/wiki/DevOps “DevOps—Wikipedia”
[lineman oscon]: http://www.slideshare.net/tychay/2011-07-lineman-opsoscon “2011 07 Living without your Linemen—OSCON”
[lineman phpcomcon]: http://www.slideshare.net/tychay/living-without-linemen “Living Without Linemen—PHP Community Conference 2011”
[phpcomcon]: http://phpcon.org/ “PHP Community Cpnference”

Most programmers are really Macgruber

Friend: I dunno why people need to make my life difficult with all this canned shit.

Me: Because programmers don’t know what they are doing—it’s simply about the right tool for the right job. If they found a letter opener, they think it’s fucking Excalibur. To them, the one shit framework/library/application/programming language/development environment they know is a fucking Swiss knife and they think they’re god-damn MacGuyver.

OSCON 2011

There is some irony that the two years I take a hiatus from OSCON are the two years it’s in my backyard. When I try to start speaking again, they’re back in Portland.

I’m going to be at OSCON this week giving two talks:

– [Living without Your Linemen: The Programmer Becomes System Operator in the Cloud](http://www.oscon.com/oscon2011/public/schedule/detail/18893). It’s about why you should get your shit together and pay attention to all this cloud hooplah
– [Tales of Virality](http://www.oscon.com/oscon2011/public/schedule/detail/18892). It should be a fun little talk about viral marketing (from an engineering perspective).

I’ve given these before, but one of them was a keynote (so had a different style), and other was at a private event. Unfortunately (for me) they didn’t put these talks in the PHP track as I asked. One was put in the Operations track and the other was put in the Business track. Quel désastre! I’ll try to make it worth your time, if you plan on attending. So please come see them!

If not, say hi anyway, I don’t bite, and I can hold of my alcohol down (mostly). I usually sober up before 5pm (when I’m giving these talks). 🙂

PHP Community Conference Closing Keynote

I submitted a couple talks for [PHP Community Conference](http://phpcon.org/) last month, of which one was accepted.

Unfortunately, it was the one I hadn’t prepared at all. The title was “living without your linemen” and was supposed to be about cloud services. A bit later, they asked if I could make it the closing keynote for the conference. This allowed me to write it from scratch and actually finish the talk (which I did about 30 minutes before I had to present it).

I’m told that they’ll eventually have a video archive of the talk at [OpenEvent.tv](http://openevent.tv/), but in the meantime, I audio-recorded it and synced it to the slides on slideshare. (Apologies for the sound quality being poor, I recorded it from my Mac Book Air).

Continue reading about PHP Community Conference after the jump.

My beef with Quora

Last year back when Quora was beta, someone pointed this Quora entry out. I explained why this guy was mistaken and let it lie. But, since a friend sent it to me recently, I guess people are actually using Quora (or something) and this deserves a response

The page being discussed is part of a larger article I wrote (and never finished) here. In the page linked, there are almost none of my opinions, but rather a summary of what was provided by Haiping during a briefing at Facebook. The outline of the page is as follows:

  • PHP has some inherent advantages as a programming language for web development.
  • PHP has some disadvantages (for Facebook). The biggest are:
    1. High CPU
    2. High Memory usage
    3. PHP components are not easy to integrate from outside
    4. Extensions writing is not the same as PHP coding
  • There were multiple attempts at Facebook to migrate from PHP but they failed: Mainly because an re-architecture team cannot keep up with the new code that is being written by the rest of Facebook—mostly writing new PHP code. The year before the presentation alone had 4 attempts at internal migrations
  • Improving the PHP core was done at Facebook and, in fact, received a lot of mileage, but this was not felt to be sustainable vs. HipHop solution.

Continue reading about my beef with Quora after the jump

Largest Ruby on Rails app?

Seen in a brochure at PayPal X:

LinkedIn uses Joyent infrastructure to run the largest Ruby on Rails app with over 2 billion monthly pageviews.

  • I thought LinkedIn was Java, when did they switch to Rails?
  • 2 billion monthly? When I left my last company, our (PHP) app was doing over 7 billion monthly, and wasn’t even in the top 10 PHP applications out there. Surely there are Rails apps bigger than that.