Britt’s Second Try lapsing back into irrelevance any day now

Flickr View All » Logo FailIMG_0019.JPGIMG_0018.JPGIMG_0017.JPGUncle Jackie telling a storyIMG_0015.JPGIMG_0013.JPGIMG_0012.JPG

Code in the open

The text of this post is taken form the README of my newest project on GitHub test-tube.

Description

After reading a couple of blog posts about coding in the open and using public scrutiny to motivate yourself  I decided to try an experiment. I’ll not only use GitHub to post the code openly, but also to solicit feedback on how to architect (I hate the a-word but can’t think of a better one.) the project and get ideas for potential features. (Mostly likely no one will ever see this but I’m writing it anyway.)

A brief history:

I started thinking about this project because once upon a time the people who sat across from me were web developers. They mostly produced HTML, CSS and Javascript that was actually seen by customers. I was working on applications that communicated server to server and didn’t have to have a pretty face. Frequently people, usually folks with manager in their job title, would come over and say, “Can you do X?” or “Could you just change Y?”. The justification was always “I feel like blah blah…” or “The customers will want mreh…”

Just overhearing these conversations was annoying. Everyone was trying to guess what the customer wanted (or more likely inject what they liked and wanted believing that everyone else thinks like them). I decided, should I ever write code that sees the light of day, I never under any circumstances wanted to be stuck in this conversation. It’s not an original idea by a long shot. Many successful companies test the living hell out of every aspect of their experience. A few years ago I went to see the (then) director of Netflix user interface (UI) team give a talk about UI design. Netflix has a great UI and I was hoping find out what the secret sauce was. He had nothing. I learned nothing about designing good UI that night, the only thing I did learn was that they never made strong decisions about the UI. They just narrowed it down to a few possibilities and threw up for testing.

So this all boils down to: When building a web app how can I test absolutely EVERYTHING? Not just bits of the UI, but search algorithms, AJAX interactions … everything. That’s the purpose of this project.

If this seems like an interesting problem please get in touch. Message me on GitHub, leave a comment, create a fork, whatever. Any all code and/or decisions are up for debate and review.

A few details:

  • I have chosen to try and integrate with the Google Analytics and Site Optimizer tools. Google Analytics works well and hosting your own data collection, analysis and reporting seems like complexity to be avoided if possible.
  • I’m thinking about having both MERB and Rails versions for anything web app specific. I like MERB and was originally thinking of just making this project a MERB slice and some helpers but since I’ve decided to try and elicit community input, Rails just has a much bigger following. Also, it really shouldn’t be that hard to do both. They’re quite similar in many ways.

Proposed Features

  • View helpers for including Google Analytics JavaScript code. (There are a lot of other projects out there that do this already. I’ll probably just extend one of them since I haven’t seen one that has helper methods for the full JavaScript tracking API.)
  • View helpers for Google Site Optimizer.
  • Application is aware of tests in progress. (Haven’t fully thought through how this might be achieved since Google doesn’t provide an API…)
  • Routing based on running tests so that A/B tests can be served from the same URLs.
  • Anything else you might suggest…

Synopsis

The only thing that has been implemented so far is a module to support routing based to different controller methods using the same URI. I actual do this by having a mutable method that can route the call to a Proc based on a discriminator Proc that identifies if the call is requesting a particular test case. You might say, “Gee, that just sounds like a complicated case statement.” It sort of is. The main reason that I wrote it that way was to experiment with metaprogramming, and figure out how to write specs for metaprogramming code that verified it and clearly expressed its behavior. All those folks writing blog posts saying “Monkey patching is evil because it’s hard to [debug|test].” You’re wrong.

After all this if you’re interested head on over to GitHub.


Cloudcon East

This weekend I gave a talk about HiveDB at Cloudcon East, a little cloud computing conference in Philadelphia.  Here are the presentation slides.

Cloudcon East Presentation
View SlideShare presentation or Upload your own. (tags: hivedb cloud)

Mis-replies

twitter mis-replies

Mis-replies

Originally uploaded by br7tt

I get so many @replies that clearly aren’t for me. Who are all the other Britts on Twitter? I don’t think any of these people are talking to me.


My favorite new Firefox feature

…discontinuous selections. Just hold CTRL (Command on Mac) and select multiple blocks of text.

found at MozillaLinks.org


Just use it and you’ll see

Yesterday a colleague and I gave an informal tech talk about JQuery. (It’s kind of funny that I gave talk about a JavaScript library since I haven’t written anything that’s even seen browser in over year, at least at work.) We ran through a couple of different bits of demo code: showed off the cool CSS-style selectors, showed how to use its AJAX functions, and finally wrote an accordion control in just a few lines. Having tried to write JavaScript to do this circa 2000, I thought this last one was particularly impressive.

Then another co-worker chimed in “I like Prototype. Why not just use Prototype?” (paraphrased). I replied with, “JQuery’s a lot smaller so it reduces page load time. Plus look at the syntax. Its great. Really, its like writing LISP.” It’s not a very convincing argument. Honestly I don’t have a great argument, it’s mostly just qualia. He’s right prototype does all of the same things and works just fine. Now I haven’t spent a lot of time thinking about the relative merits of Prototype vs. JQuery. Maybe if I did I could better articulate my preference. My best counter-argument is, “Try it. Build something non-trivial with it and you’ll feel the difference.”

I run into this problem when trying to explain to people why they should do Test Driven Development (TDD) as well. You can present them studies showing that it doesn’t take that much more time and reduces bugs. But they say, “Well that’s what we have an QA department for.” and “You can’t catch all the bugs a good QA tester can because you can’t implement every scenario.” To which I respond “TDD is a design methodology not a verification methodology.” Even so, I still often get “Well I just don’t think it will work for me.” This may be a bit different than my previous example. These folks may just be resistant to facts. However, information from a study or some such is pretty distant so it’s understandable that it doesn’t sway people. Again, I think personal experience makes a much stronger argument. The thing that really made TDD click for me was when I committed to try it for a week as an experiment. Just doing it and experiencing a “Man, programming is easy.” moment made a better argument than anything anyone could say.

What I’m really wondering is how do you get people to do their own experiment? How do you get them to just try it?


I wish our site looked that good…

Recently Scott Chacon released git-scm.com. While its not the official Git web site, its a great example of how to do a project website right. Everything I want to know about Git is right there on the front page. I can download Git and get started is right just by reading that one page. Also, it looks good and has a cute little monster.

The front page answers my most immediate questions.

1. What the hell is it?
2. Where can I get it?
3. How do I use it?
4. Now that I’m started, where can I learn more?

I wish the HiveDB website did so well.

We answer the “What is HiveDB?” question and have a movie showing what its like to use it, but the nuts and bolts of how to get started are below the fold and honestly even the explanation of what it is a little to fluffy for me. [I wrote it...and I created and maintain the rest of the site.] Granted, a distributed database system is a bit of different beast than a command-line tool, but I think its possible to fit all of the necessary info to get started on the front page.


Procrastination and JavaScript

I started this attempt at a blog a few weeks ago with a post declaring that I wanted to write more.  It has been almost a month and still nothing yet.  I’ve been putting together a post about customizing Hadoop so that it can read from a data source other than the Hadoop File System (HDFS).  However, I keep pushing it to the side so that I can actually build an application that uses Hadoop but doesn’t read from the HDFS. So, from today forward I’m going to commit myself to writing at least one post everyday (probably just weekdays). A lot of it will probably be normal self-indulgent blog turds, but at least it will be something and hopefully writing will get easier.

I’m going to start with a little piece of javascript I wrote.

A lot of the times when I’m googling for technical information the first page of results is dominated by results that are essentially noise. So, I find myself adding -site:whatever.com to a lot of searches. Being lazy I automated it with a little bit of JavaScript. Just copy the text below, paste it into a bookmark, and substitute in the domains that are cluttering your search results. When you click the bookmark it will add the text to exclude those sites from your search results.

Expanded for readability

Without line breaks for easy pasting into a bookmark

or if you’re truly hardcore…


git clone git://gist.github.com/4159.git

Hello world!

I have decided that I want to write more.  I want to write all the time, to engage in giant Yegge-ian bouts of written diarrhea so that I become more comfortable with the act of writing and it stops being such a painful chore.  So, I installed Wordpress on my web hosting account again, added some plugins and got the style just-so.  Of course after doing all that, now I have to leave before I’ve even completed the first post. Now I have this wonderful little garden with nothing in it yet.

Magic Garden
the photos is Magic Garden by Randy Son of Robert