Archive for September, 2007

Of Sivers, CDBaby, Rails and PHP

A couple days ago Derek Sivers of CDBaby (disclosure: I’m a big fan of the site, though perhaps not the current design) wrote an O’Reilly article titled ‘7 reasons I switched back to PHP after 2 years on Rails’ about how he spent two years trying to rebuild his site in Ruby on Rails before switching back to his tried-and-true PHP to finish the job. If you’re a developer give it a read, it’s well worth it. Unfortunately the article has also stirred up a hornet’s nest of comments and criticisms, many from respectable blogerati and quite a few in response to the comments received both on the O’Reilly article and on the Slashdot post.

To preserve my sanity and faith in humanity I don’t read Slashdot comments - those I leave for fools and masochists - but I did decide to go back and re-read the original article and then the subsequent comments. I gotta say: I’m really disappointed in the tech community in general. You’d think someone just walked up to them and said “Damn, your kid is stupid and ugly, and that’s his good side” by the way we’ve reacted. I just don’t get it.

After re-reading the article I was struck with a number of thoughts that just wouldn’t leave, first and foremost: why wasn’t Rails suitable? As a Rails developer when a really smart, successful developer comes along, spends two years trying to work with my (currently) favourite framework and finds a problem with it, I sure as hell want to know what those problems were because chances are they found limitations and edge cases I haven’t even begun to explore yet and some day they might bite me on the ass. I want this guy to write more articles about his project; about the Rails aspect, the PHP aspect, the failures, the successes. How many other projects of this magnitude can claim to have been developed in two competitive platforms like this?

Caveat: I’ve been a PHP developer for years before I was a Rails developer and I really like PHP, warts and all. I really like Ruby too, but I don’t yet profess to know it nearly as well as I do PHP. I’ve only built three production sites in Rails so far so my experience is still limited.

I also wondered: Rails of two years ago (before my time) strikes me as an perhaps an immature platform from what I know of it, primarily usable only by those intimately familiar with it and for a specific types of applications. Derek clearly knew this because he hired Jeremy Kemper so how does the Rails of yore stack up against the Rails of today? Does Jeremy still think the barriers would be there?

I wondered: how did Derek reduce the PHP codebase by so much? It’s not magic, he clearly knows what he’s doing and understood his system to an impressive level (he reduced by a factor of 8). I want technical details about his optimizations.

I wondered: where does a guy find the balls to scrap two years of work and start all over from scratch? As the client he clearly had the authority to do so but man, how many of us can say we’d step up and do that instead of continuing to try and shoe-horn our “solution” just a little bit longer. There’s some lessons in the thought processes and decisions that went into that choice, I’d like to hear them.

Even a second time through I was having fun with this article.

But then I got to the comments. So much venom levied against a guy who basically said “Huh, a Torx wrench doesn’t work as well as my trusty Phillips screwdriver for this project, guess I’ll use the Phillips.” Are we developers really so fragile that we can’t stand the thought of someone doing something that isn’t our way? Are we really so arrogant as to think our experience the only one worth having?

Comments like this are just pathetic, they shame us all:

Useless post without a concrete illustration.

Looks like you among many out there had a poor team. Poor development environment where you were working on several projects at once and putting priorities in wrong order among several projects. I will have to say being stuck in one mental framework can be hard to overcome, especially when learning to code in a new and cleaner manner as per Ruby on Rails. But you actually could have coded so much more faster had you stuck to your guns and not given up, or not, since you prioritized among so many projects.

Why didn’t you hire a Rails core member? Who is Jeremy Kemper? I have been programming in Ruby for 4 years now and I have never heard of him.

(I wanted to not comment on the comments but this one take the cake. Not only did this poster obviously not read the article - the answer is only in the second paragraph - his gross arrogance and incredible lack of knoweldge and Google-fu would immediately make him a “never hire” for me. Aaron, Google up a clue.)

Reading your reason #6, I see that you totally don’t get what rails is. And thats pretty sad as a resumee after 2 years.

Oh and I just checked out your site. What an ugly P.O.S! 2 years and you can’t build craigslist for CD’s using rails. Jesus.

Etc. etc. etc.

We’re developers. We build things. We create from nothing the beautiful things that the rest of the world uses, uses without ever thinking about how those things were built. Only we care about the creation process but I think in this case we’ve lost sight of where we developers end and our tools and processes begin. We are not our tools, we’re the sum of our output. To become emotionally attached to a tool or methodology is to limit ourselves in a terrible way. They’re just lines of code, collections of bytes, arrangements of magnetic dust on metal platters. Geez.

This guy scrapped his original site to rebuild it from scratch on a hunch it might go better. When that failed he didn’t get religion and scream and cry, rend his hair, curse the gods. He scrapped it and found a better way. And then he built it.

That, ladies and gentlemen, is the essence of a real developer.

Comments Off

chris on September 25th 2007 in /dev/rails, /dev/random

Parallels 3 Build 5160 is Sweet Indeed

Parallels logo A couple of days ago Parallels put out an update to their Parallels Desktop for Mac VM (build 5160) and I’m truly impressed. To say this version is faster to launch would be an understatement - it is amazingly faster. “Holy crap that was fast!” faster.

This is also the first version where I’ve felt Coherence (the ability to run Windows app “out of Windows” as though they’re in the Mac OS) was stable and fast enough to really use:


Coherence

It’s also a bit freakish to see Windows apps seamlessly integrated into Exposé but I certainly do love the way it relegates Windows to “just another Mac app” status.

I haven’t yet turned sound back on to see if the kernel panic bug that plagued earlier versions is still around. I use Parallels almost daily and in hindsight perhaps that bug was a feature - a completely silent WinXP is not a bad thing. Even if the bug is fixed I think sound will be staying off in the future.

I’m inherently suspicious of the “Mirrored Desktop” and “Map Mac folders” feature which allow the mapping of specified Mac folders to drive letters in Windows (ie: “Movies” mapped to “M:” for playback in Windows). IMO one of the main reasons to use Parallels is to abstract Windows away from the scary real world into it’s own safe sandbox where viruses and trojans and worms and script kiddies can all run rampant without worry. The seamless integration of my Mac files with Windows in any way makes me nervous - it brings the worry back. None of that for me.

If you’ve been waiting to move to Parallels I think this is the version. I am well impressed indeed.

No Comments »

chris on September 14th 2007 in /dev/random

Reloading dispatch.fcgi

Rails development is usually done using dispatch.cgi so changes are readily apparent. However dispatch.cgi is painfully slow for a production environment so it only makes sense to use dispatch.fcgi. You can check which you’re using by looking into your /public/.htaccess file. In this case I’m running dispatch.cgi and .fcgi is commented out:

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
#RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Problem is dispatch.fcgi won’t immediately recognize changes made to content. In order to force a flush of all dispatch.fcgi instances we could kill all the processes but this seems better to me:

[chris@enki ticklist]$ touch public/dispatch.fcgi

No Comments »

chris on September 11th 2007 in /dev/rails

Oh But It Can. And So, So Well Too

Giles Bowkett has written a post that's generated much interest and controversy and hand-wringing and chest-thumping, which isn't bad for a post that's only three paragraphs long. I even weigh in with "Is Simplicity Really That Simple?" becaus it touches on a thought-path near and dear to me at the moment.

But the post itself is not why I write this, oh no. I write this because of a comment the ever-clever Anonymous left on Giles' blog, a comment which sums up my other post linked above so incredibly perfectly:

Anonymous said...

Visual Basic:
  1. public class VotingMachine {
  2.  
  3. public static var candiateNames:Array;
  4. public static var candiateVotes:Array;
  5. public static var candidateButtons:Array;
  6.  
  7. public function VotingMachine():void {
  8.  
  9. candiateNames = ["Bush", "Kerry", "Hilter", "Ghandi"]
  10. candiateButtons = []
  11. candiateVotes = []
  12.  
  13. for (var a in candidateNames) {
  14.     candidateButtons.push(new Button(candidateName[a]))
  15.     candidateButtons[a].addEventListener(MouseEvent.CLICK, addVote)
  16.     candiateVotes.push = new int()
  17. }
  18. }
  19. private function addVote(e:Event):void {
  20. var index:int = candiateNames.indexOf(e.target)
  21. if (index != -1) candidateVotes[index] += 1
  22. else throw new Error("You have made up a candidate")
  23. }
  24. }

<-- it can't go wrong.

Oh but it can Anonymous, it so very can, can't it?

(If only someone would develop some sort of software thingy that would allow you to check your code for errors before posting it for all the world to see. I bet that guy would be a millionaire...)

1 Comment »

chris on September 5th 2007 in /dev/random