Lost in Portland, and Thinking

Posted by Eric Sat, 19 May 2007 23:05:00 GMT

Did I say I was tired yesterday? That wasn’t tired, this is tired. I’m currently training for the marathon, and today I was scheduled for a 13 mile run. Sadly marathon training does not wait for RailsConf so I was up at five this morning, viewing the fair city of Portland. Say what you will about running, but it’s a great way to see a new city.

It’s also a great way to get lost. I used the great website at USA track and field where people post their runs in order to find a place to go and promptly wrote down a street name incorrectly. I ended up wandering around Portland’s lovely Willamette river, which fortunately provides a great landmark for a poor lost tourist. This led to running, and running, and running…and finally a Runners High.

Runners High is a phenomenon cause by your brain releasing endorphins, as a defense mechanism against the way your body feels. When I run my brain feels extremely active, and jumps from topic to topic making associations, breaking down problems, etc. It’s not unheard of for me to fix a bug I’d been struggling with while on a run, in a sudden burst of insight. Today, when I wasn’t wondering where the hell I was, I started thinking about quite a few things one of which is related to the new IDE’s being developed and the barrier to entry on Rails. Bear with me because this is a little out there, and I haven’t quite figured out how to articulate the concepts.

Right now Ruby and Rails are still strange and unusual things to most developers. When introduced to the language they want an IDE, and upon hearing there is no visual debugger or that they have to use Textmate, Eclipse or god-forbid emacs they turn away. They stick with Java or C++ and wizards and comfortable development, and will wait until they need to use Ruby.

Then one day their boss hears about Rails. They tell the developer, ‘you should be using this!’ and so he goes and he gets an IDE, real slick one with lot’s of bells and whistles. He goes to generate a model - only he doesn’t use script/generate. He uses a wizard, he sees he can add his methods and data members right there, so he does. Test? What test? Then he goes to the controller and has his controller manipulate the data all day, and develops a view in a WYSIWYG editor. He spends all day in the debugger, and his methods get bigger and bigger. Of course that’s no big deal, because he uses cold folding to hide their size. Then testers write Test::Unit code to test his code, and he’s done, because developers don’t test. Meanwhile we’ve all left Ruby because, “so much of the code is crap.” Haven’t we done this cycle before?

Chad Fowler described us as arrogant in the introduction, and clearly if you look above we are. I say we because nobody reading this had a problem with my rant, so you’re just as arrogant as I am. Caught you. We think we’re smarter than everybody else don’t we? Actually I don’t and most of you probably don’t either. I just know that there is a right and wrong way to do things, and so does Rails. That’s why it’s so opinionated. An attendee, Jack Canty, put it better than I can by saying “Rails is opinionated, and this takes away those opinions.”

So how do we fix it? Well let me steal some of Micah’s DSL thunder by using an analogy I thought of while running. It’s morning, and you want a coffee. So you go to a certain ubiquitous chain and say, “I’d like a big coffee please,” only said ubiquitous chain doesn’t have big. They have Tall, Grande and Venti. If you do this there will be a noticeable pause while the guy behind the counter takes a second to think about what you just said. He’s not a moron, take off his green smock and he knows what a big coffee is, but he’s got to translate it. What’s big - is it grande? Venti? That’s because you’re not speaking his language. You eventually do get your coffee, because he can figure out what you mean, but it takes just a little bit longer. While you wait in line you hear other people say, “I’ll have a grande half-caf no-foam latte,” and the guy behind the counter immediately repeats it. Eventually you learn the language they speak, and you get your coffee just a little bit faster. You’ve adapted to the idioms of the coffee shop, and you’ve been rewarded for it.

So what the heck does that have to do with code? I kind of gave it away by using the phrase idioms, didn’t I? Well let’s say you’re a C++ programmer and you start on Ruby. You don’t write Unit Tests, which despite what we sometimes think most developers do NOT do, and you sit down to iterate through an array. So you write:

index = 0
while index < array.length do
  puts index
end

Much like ordering a big coffee at the Green Angel, that will work, but it’s completely incorrect. It’s not speaking Ruby even if it’s in the Ruby language, and unfortunately I believe that if we do not work hard to enforce and teach the best practices of the Rails and Ruby ways, we will witness this kind of thing propagated. I’ve done the C++ without test thing and lived in the debugger, and it drove me nuts. Unfortunately many developers don’t think anything is wrong with that. If they did they’d be here already. That’s what programming is to them. The good news is that we are the early adopters, and when they come around they will adapt to our rules but only if we make them. Remember what I said about the pause at Starbucks? Well the code above won’t pause. Ruby will execute it just as nicely as anything else, and maybe it shouldn’t, I’m not sure. What I do know is that the IDE’s now being created should not be catering to the developer that wants to do the things the way they’ve always done them. Instead of opening ‘choices’ up and making things ‘easier’, our IDEs should enforce the opinions of Rails. You see the late adopters aren’t lazy, or stupid, they’re just being rewarded improperly. If it’s easy to make a model without tests, they’ll make one, even if they are hurt by it later on. They’ll even stay until 1 AM to debug it, and their boss will think ‘gosh this Rails thing isn’t so great after all, thank God my programmers are so dedicated.’ Fortunately we control this. There’s a reason the IDE makers are here, and that’s because they know that late adopters ask the early adopters what they use. Tell the IDE makers that you want an IDE that does not allow bad habits. I want an IDE that is integrated with subversion, but I also want it to yell at me if I have untested code, and run ZenTest. If it gives me a wizard the first question it should ask is “what is the name of the test?.” Instead of code folding to hide bad code, it should identify refactoring opportunities. Finally, I’m not sure I even want a debugger. Debugging sucks, and it’s a crutch. I can test behavior rather than step through it and look at it. I realize people do want debuggers, I just worry for the day when Rails code can’t be properly understood without stepping through it.

Tell the IDE developers that you want an IDE that helps create good code, not easy code. If they don’t do that, then when developers ask you what you use say emacs. If the developer still turns away, we probably aren’t losing much.

Day Three at Rails

Posted by Eric Sat, 19 May 2007 12:01:00 GMT

Well it’s day three and I’m exhausted. As you may have noticed I posted at 3 AM last night, and getting up at 8 AM wasn’t foremost on my list of “things to do today.” I did it anyway and I’m enjoying a talk on Rails helpers at the moment. While my posting last night was late I actually wrote it much earlier in the day so naturally some things happened after I wrote the post, and not all of them involved beverages that should not be consumed by those that are under 21.

Last night’s keynotes said a lot about the Rails community, and almost nothing about Rails ironically enough. The first was Avi Bryant who challenged us to make Ruby as good as Smalltalk. Avi is clearly a bright guy and an energetic speaker, and his opinions are essentially the opposite of the ‘Rails’. While I certainly wouldn’t say I agree with everything he said, the challenge to make Ruby and thereby Rails as fast as Smalltalk is one that we as a community should certainly consider.

The other was Ze Frank. He probably needs no introduction to much of the web, but he didn’t say the words “Ruby” or “Rails” once. He did nearly make us wet ourselves with laughter. I’m going to have to spend some time at www.zefrank.com.

I mentioned that they said a lot about us, as a community, and to illustrate this I want you to think of an ASP conference, put on by Microsoft. Do you think they’d invite somebody from the Rails community to come in and tell them their framework bites? No, of course not. Large corporate-backed frameworks do not accept challenges. They spend their time trying to sell you things to debug their already perfect technology. We, as a group, invite people to challenge us because it requires us to think about and defend our own position. If we’re wrong, we admit we’re wrong. If we’re right than that position must be defensible. We all came from different backgrounds, and came to Rails because we continually challenged our assumptions. Let’s continue to do so.

What Ze Frank as a keynote said about us is simple, we’re fun. I’m sure you’ve been to a big corporate event where a few suits tell some in-jokes or make a skit that’s supposed to be funny, but it’s not because nobody can actually say anything that might upset the big honchos. This is a group that has no problem with keynote speakers dropping an F-bomb, and I haven’t seen a single tie. Man it’s refreshing.

Had a lot of fun meeting a bunch of you last night. Looking forward to that today too.

Day Two at RailsConf

Posted by Eric Sat, 19 May 2007 03:09:00 GMT

Hello again from RailsConf. I’ve gone through five presentations. I don’t have any enormous revelations, and no good pictures yet, but I do have some observations. I’ll do this Larry King style.

…Uncle Bob and Jim Weirich are great public speakers. I’ve seen Uncle Bob do most of the CleanCode talk before, and I’ll go again at Agile 2007…Went for a run yesterday, Portland is quite pretty…Everyone I’ve met here has been unfailingly interesting, with nobody trying to ‘network’ just meet people like normal human beings…Spider Man 3 was mildly disappointing …If you get a chance to download the slides from Spam I Have Known, do so. Hugely entertaining…If you add videos to your presentation it’s fun, but not as much fun as genuine enthusiasm about your topic.

Okay I can’t do that for very long, how did Larry do it for 20 years? The highlights from today would have to be three things:

  • Keynote. The tone here is very different from your typical stuffy conference, and it’s great. Chad Fowler playing the ukulele, DHH referring to ‘unicorns’, I doubt you see these at a Windows Vista conference. Well you probably do, but it’s forced and trite. There’s a genuine enthusiasm here, because what we have here are 1600 developers who are all passionate craftsman who would do this for free. To any potential customers: That last part was a joke. We like to be paid. Speaking of paying, Dave Thomas gave a talk (which Gilberto attended) on Rails for charity, and that charity is still open at:

http://pragmaticstudio.com/dontate

Charity good, give some.

  • Clean Code. Uncle Bob is a “friend of the program” as they say in college and rather closely related to my boss, so my opinion is biased admittedly, but his speech today was packed and as always well received. If you want to see what he talked about hold the apple or ctrl key and click http://www.objectmentor.com. That will open the site in a new window, so you don’t go away.

  • Spam I have known. The presentations I saw the rest of the day were up/and/down. Nothing was bad exactly, and I know these people put a lot of effort into them so I won’t name names, but there wasn’t much memorable. I was beginning to think I’d have to make up something to blog today, until seeing Jim Weirich’s presentation on spam. Ruse has a really nice algorithm for detecting spam which has quite a few features but it centers around an idea so obvious you’ll wish you’d thought of it, the Tarpit. Spammers routinely defeat sites with one thing - feedback! They attack a site trying different things until they figure out why they were rejected. A Tarpit takes spam and doesn’t give them an error message, it puts it in the Tarpit. They think that their spam was successful, so they don’t change the spam. I think I’m going to grab it and try it for my personal wiki, which has never been replaced since I left the evils of corporate America.

Older posts: 1 2