Official response to Brendan Eich supporting prop-8

There was a programmer named Eich
Who’s language Greg started to like
And if rumors are true
He’d like Greg too
Unless Greg was married to Mike

Here’s a link to the original article for context

If your software matters, you will get your priorities in order.

S*** my computer never says

After reading Chris Smith’s article, “If your software matters, you will write it in C++”, and reading the comments I feel compelled to put in my own two cents on the whole thought process going on here. The title of the article is something that Don Syme (creator of F#) roughly said to the author. I don’t think that  Chris really believes Don is right about that but even when he explains the many nuances to choosing a language he only talks about the developer and his/her computer, leaving out what I think is the first priority, the end user.

When people say that you have to write in c/c++ because its faster, they’re really missing the point in a way that is detrimental to the quality of the software they are creating.  The viewpoint that is being taken here is that of the computer. But the computer should really be the last party that you’re trying to optimize for, so lets get our priorities straight.

  1. Consumer – This may be a human or a machine. Each has different needs to make the speed of consumption as fast as possible.
  2. Developer – the software has to get done in a reasonable amount of time so the way its created should be in a way that the developer can achieve some efficiency. We also need to improve and maintain the code-base so that should be taken into consideration as well.
  3. Computer – It has no feelings, it wont complain, it cant choose to run a different program if it doesn’t like yours. So why are we so obsessed with cutting down the number of instructions it has to run??

In consumer facing software the most important speed metric is how fast people can do what they’re trying to do with the software. The speed of a function frankly doesn’t matter if its buried in a menu where no one will ever find it. In this case “If your software really matters you’ll work hard to refine the UI”

In heavy transactional software the concurrency of the processes is what matters most. You can have the fastest function ever but it wont matter to the end user (be that human or machine) if transactions pile up in a queue waiting to be processed. Furthermore if the recipient is a computer who cares about the speed of the function if the format of the data returned takes a lot of time to parse.

The only arena where processing speed is really the most valuable optimization is in computationally heavy apps, games, mathematical applications etc… so to say that if your software matters, you will write it in C++, is to say that only computationally heavy apps really matter. I think we can all agree that that’s not the case.

I just want to finish up by saying I have the largest amount of respect for both Don and Chris. My opinions here really mean nothing compared to what they have to say on the topic. I just feel that as developers we often spend large amounts of time arguing about the things that matter the least. Every once in a while its good to come out from behind the screen and see our software from a different viewpoint.

Etsy code as craft with Rasmus Lerdorf

Went to Etsy code as craft Thursday evening and saw an excellent talk by Rasmus Lerdorf, creator of PHP. He talked about the origins of PHP, how it came to be what it is and what new features are on the horizon. I have to admit, at first I wasn’t expecting much but his talk was really a pleasant surprise.

Rasmus explains how PHP started out as a templating system which continued getting more and more tacked onto it as the users need to create more rich web experiences. He attributes the success of PHP to its ease of use with Apache and its accessibility to computer scientists as well as “weekend warriors”. When asked whether the language was a suitable choice for large scale applications he happily pointed out that Yahoo and Facebook are done in mostly PHP and that that was really the only argument he needed.

Some of the technical highlights of the talk were the introduction of closures in PHP 5.3 and traits in the upcoming 5.4 release. Another interesting feature of 5.4 was improved integration with nginx (hint hint.. probably going to make the switch soon)

One of the main takeaways in my opinion was that he emphasized how PHP should handle a request and complete it as quickly as possible. He maintained that doing background processes like image resizing should be done asynchronously with gearman. Keeping a request open too long wasted memory, slowed down the user and made it difficult to scale.

Rasmus claimed that in the numerous startups that he has consulted, their pain points for scaling usually had to do with a framework or ORM taking too much time and memory. After the talk I asked him about what he would like to see in a PHP framework. He responded that he would like to see more introspection in frameworks and modular loading to keep the processes light. The main problem according to him was how much gets loaded because the framework has no idea what environment it is deployed in. As far as ORMs go he said they were great for getting a product up quickly but its difficult to tell when you need to move to a custom API wrapped over your database.

All and all the talk was excellent and Rasmus is a real character. I would highly encourage you to check out the video below.

Continue reading

Dr. HashBang or: How I learned to Stop Worrying and love client side routing

What is a “#!” (HashBang) and what does it do?

The CulpritWe’ve all seen it once or twice, hiding out in your URL sometimes without the trailing “!”. The # (fragment-identifier or hash for short) is traditionally used for click-able navigation up or down a long page (think of the “back to top” link). It signals to the browser that

the link refers to content on the same page so there’s no need for a server request. In fact, if you write a URL with a hash into the browsers URL bar it wont even send the part of the URL after the “#” to the server its requesting. So..

Continue reading