Nothing else either company does is worth a split-second of anyone's time.
Let's move on.
Saturday, May 24, 2008
Microsoft/Yahoo Shouldn't Matter To Anyone But Flickr Users
Thursday, May 22, 2008
Wednesday, May 21, 2008
Summon Monsters? Open The Door? Heal? Or Die?
It's the name of a Murakami book and exhibit, but it's also the question taunting online journalism.
Jason Calcanis thinks newspapers will die; newspapers themselves are trying to heal; and Adrian Holovaty wants to open the door.
But Digg, Reddit, and Hacker News have all chosen summoning monsters - specifically, trolls.
Here's my comment on a Hacker News thread about sites HN users want to see banned from HN:
I wish I was kidding. I'm absolutely serious. My life would absolutely be better if I never saw my own blog on Hacker News. I read Hacker News to discover new stuff I can benefit from reading. Nothing I've already posted is ever going to be a new discovery to me, by definition, and the comments my posts get on Hacker News are distracting and infuriating. Those comments are always new stuff, but they're very rarely new stuff I can benefit from reading. Once in a while I learn something or discover a new perspective, but these comments more usually just send me into episodes of Tourette's Syndrome.
Here's a small thread where I responded to critics on Hacker News:
I didn't really get anything out of posting that, or reading the comments that prompted it. The entire incident had no value at all, and probably shortened my life by at least a few seconds (anger and hostility have profoundly negative health effects). Many people have noticed this sort of thing, and it's pretty much inherent to the structure of blog commenting in general.
A funny thing about these sites is that they know about this problem. Hacker News is very concerned about not turning into the next Reddit; Reddit was created as a better Digg; and Digg's corporate mission statement is "at least we're not Slashdot." None of them seem to realize that the order from least to most horrible is identical to the order from youngest to oldest, or that every one of them was good once and isn't any longer. There's an entirely consistent and predictable theme here: devolution, and people who are surprised when it happens. It should be obvious, when it happens this consistently, that the decay isn't incidental; it's inherent. If it happens every time, for every site of this nature, it isn't coincidence.
Another thing which happens every time for every site of this nature is me telling sloppy thinkers to go to hell. People on Reddit and Hacker News think of me as a jerk, but there's a simple explanation for that: on Reddit and Hacker News, I am a jerk. This doesn't bother me much. There's a homeless couple who think of me as a saint, because I bought them a huge meal at Taco Bell. At that Taco Bell, on that day, for those people, I was a saint. Everyone has the capacity to be a jerk or a saint, so the smart thing to do is find contexts which maximize your saint potential and minimize your jerk potential. Obviously for me, neither Reddit nor Hacker News qualifies as such a context.
Unfortunately I spend more time at Hacker News than I do at Taco Bell. I go back to these sites anyway (albeit reluctantly, and with decreasing frequency), because, if you're willing to filter them dilligently, they provide a valuable and interesting stream of new information - but with terrible side effects. The side effects occur predictably in every variant of this approach to aggregating streams of news, because these Web apps are a terrible, terrible way of aggregating such streams.
Capturing the aggregate information about what a given community considers interesting is very useful; but it's insane to conflate what the community finds useful in aggregate with what each member of the community will personally find useful. Unfortunately, very many sites have made precisely this insane mistake - practically everyone except del.icio.us, in fact. Consequently we have a whole genre of sites with very predictable signal/noise decay.
This happens because the kind of filtering that a social networking approach to news gives you has some serious flaws. I'm mainly ranting about the Hordes Of Moronic Imbeciles Expressing Their Opinions About You Problem, but two other problems to consider are the Tim Bray Problem and the Cory Doctorow Problem. These guys are each more interesting to the developer community than they are to me, which puts them on my radar way more often than they should be, and in either case this causes a problem.
The Tim Bray Problem is that the developer community pays a lot of attention to Tim Bray, but I have never derived any use at all from any information connected to Tim Bray in any way, and after exposure to a lot of such information, I'm becoming very confident that nothing Tim Bray says about anything will ever make any difference to me one way or the other.
This man's hat is literally the only interesting thing about him at all. (It's a fedora.)
As aggravating as the Tim Bray problem is, it's easy to fix. You could solve it with a regular expression.
The Cory Doctorow Problem is related, but much thornier. The Cory Doctorow problem is that the developer community also pays a lot of attention to Cory Doctorow, like Tim Bray, and virtually everything Cory Doctorow says is absolutely useless in my opinion, again like Tim Bray, but unlike Tim Bray, Cory Doctorow occasionally delivers insight that is absolutely crucial and nothing short of brilliant.
Cory Doctorow's a lot like blog comments in general, in that extracting the signal from the noise nearly requires an element of masochism in your personality. His sparkling moments of genius, essential and unmissable though they are, elude you completely unless you're willing, for their sake, to sacrifice a lot of time to filtering out his gigantic standard daily quota of incredible time-wasting silliness.
Unlike Tim Bray, Cory Doctorow often annoys me. The Cory Doctorow Problem is worse for me than the Tim Bray Problem, because Tim Bray is a glass of water when I'm not thirsty, and Cory Doctorow is a winning lottery ticket buried under a hundred thousand yipping chihuahuas who all need to pee. I could really use that lottery ticket, but I really don't want to deal with those chihuahuas.
Both these problems present major obstacles to getting real value out of social networking news sites, but the worst obstacle of all is the system of upmodding and downmodding comments. Your search for news becomes derailed into a video game - anything which involves computers and scoring points ultimately becomes a video game - and as video games go, it isn't a lot of fun. It sure as hell isn't Tetris.
Worse yet, it's almost ubiquitous. If you're highly vulnerable to distraction, this game will steal your time. We should all know that it's an incompetent social networking strategy because it comes from Slashdot originally - a site which specializes in crashing innocent servers so that nerds have an excuse to swear at each other - but despite this horrible pedigree, it's a very popular approach. Every site which uses this approach inevitably ends up hated by former users, so it's kind of weird that the approach is so popular, but there's an easy explanation. The ultimate reason, of course, is a mistaken belief - specifically, the idea that user numbers are a better metric for Web app success than usefulness. This implies that anything which generates more traffic is inherently better. But purely for the sake of argument, let's abandon this 1997 mentality and ask ourselves how useful a site like Reddit or Hacker News can ever really be.
When you build a system where you get points for the number of people who agree with you, you are building a popularity contest for ideas. However, your popularity contest for ideas will not be dominated by the people with the best ideas, but the people with the most time to spend on your web site. Votes appear to be free, like contribution is with Wikipedia, but in reality you have to register to vote, and you have to be there frequently for your votes to make much difference. So the votes aren't really free - they cost time. If you do the math, it's actually quite obvious that if your popularity contest for ideas inherently, by its structure, favors people who waste their own time, then your contest will produce winners which are actually losers. The most popular ideas will not be the best ideas, since the people who have the best ideas, and the ability to recognize them, also have better things to do and better places to be.
Even if you didn't know about the long tail, you'd look for the best ideas on Hacker News (for example) not in its top 10 but in its bottom 1000, because any reasonable person would expect this effect - that people who waste their own time have, in effect, more votes than people who value it - to elevate bad but popular ideas and irretrievably sink independent thinking. And you would be right. TechCrunch is frequently in HN's top ten. Meanwhile, I just decided to test this theory, so I went to the absolute bottom of the Hacker News list of stories, and I found out Malcolm Gladwell's got a new book on the way.
The flawed design assumptions of sites in the Hacker News genre inherently attract trolls and inherently reward those trolls for polluting our minds with their groupthink. This is why racism and sexism do so well on those horrible sites. It's also why I want my blog banned from Hacker News. I'm not even kidding. 
It's not coincidence. It's a fundamental design flaw. Building a site like Hacker News and then trying to keep it from being overrun with losers and nimrods is like coating your kitchen floor in powdered sugar and then trying to keep it clear of ants and earwigs. People are asking themselves how to save Hacker News, and they need to realize there is only one technology which can save Hacker News, and that is the time machine.
However, although this obviously aggravates me, I know what Nietzsche said about it: battle not with monsters, lest ye become a monster. I don't always remember this rule, but I observe it when I can. Railing against the madness of it all and getting my blog banned from Hacker News would accomplish a lot less for me than just putting down the Hacker News crackpipe and becoming one of those lovely people with a cool calm head and better things to do.
But there's an important caveat: just because people have things to do doesn't mean they can't learn things from the rest of the world. People with too much self-respect for negativity magnets still need a good way to get their news. I want to throw out the bathwater, not the baby.
I've come up with what I believe is a powerful solution, but unfortunately I don't currently have time to implement it. This may change in future. If so, I'll start it as a business. If not, I'll start it as an open-source project and spend time evangelizing it. One way or another, I'm going to introduce my fix to the world, because people shouldn't have to choose between flame wars and autistic mode.
Autistic mode, of course, comes from Ghost In The Shell, and there's no surer sign of fundamental brokenness in the systems geeks use to share information with each other than the fact that more geeks know about Cory Doctorow's dull, shallow, lazy, unimaginative, self-serving, and unbearably self-absorbed Down And Out In The Magic Kingdom than have seen the anime TV series version of Ghost In The Shell - true-school hard sci-fi cyberpunk which is infinitely superior to both movie versions, and on a level with the original manga.
Cory Doctorow has some great moments, but if you say "science fiction" to somebody, and they think Cory Doctorow before they think Masamune Shirow, that means our information-sharing systems are polluted with bullshit, and I for one am tired of it.
Update:
Update 2:
I can't believe I didn't see this coming:
I don't have a problem with Tim Bray - I have a Tim Bray Problem. I don't always choose my words as carefully as I'd like, but as far as these specific words are concerned, I intend them very precisely. Likewise, even though I obviously have a bee in my bonnet about Doctorow's Magic Kingdom book, I expect to like Little Brother when I finally get the time to read it. It's not even slightly personal.
Update 3:
If you've been on the Internet for a while you probably recognize a number of tactics in this post as blatant trolling.
The core argument I'm making here is that fundamental design flaws in sites like Hacker News make them extremely vulnerable to trolling.
Logically, therefore, if my argument is correct, you would expect this piece of trolling to do well on Hacker News.
It was in the top 10 yesterday. It's still in the top 10 today. Quod erat demonstrandum.
My experience with blog posts which address flaws in social software that encourages unhealthy interaction patterns between its users is that these blog posts are often interpreted as personal attacks and rarely as serious analysis. But consider the serious analysis. The flaws are two: one, the voting/registration systems reward trolls and bury great information; two, the commenting systems turn discussion into a video game. If you pay attention to these two flaws, you don't even need me to describe my secret planned technological solution, because it's already obvious.
Sunday, May 18, 2008
Archaeopteryx: The Ambient Evil Robot Army
Many years ago - nearly ten by now, I'm guessing - I helped some people start a DJ crew organized around ambient music. The crew was called the Ambient Mafia. The crew's still going strong, but I left it long ago, and when I tried to rejoin, they refused to let me back in.
This stings, but it could sting worse. At the very least, I'm in good company. Billy Idol said that after he started the band Generation X he had to kick out the singer, because the singer was a twat. But the thing is, Billy Idol was the singer. I admire Billy Idol's dedication to principle, so dedicated to the good of the group that he was willing to fire even himself, and I have to say my experience with the Ambient Mafia was kind of the same thing, sorta.
Billy Idol, after leaving Generation X, moved to Los Angeles and, if the media reports are true, had sex with every single model or actress in the entire city. So far I've made it to Los Angeles. I'm working on the other part.
Apparently it requires leather underpants.
Musicians and drama go hand in hand. Every single incarnation of the Sisters of Mercy has ended in a legal battle - two with Andrew Eldritch vs. everybody else in the band, and one with Andrew Eldritch vs. the record company. (He wins every time.) Guns N Roses hated each other; Tribe Called Quest hated each other; Fleetwood Mac hated each other.
Fleetwood Mac is a great example, actually. They didn't just hate each other. They also loved each other, married each other, divorced each other, and had affairs with each other behind each other's backs. Episodes in the band's history include on-stage alcoholic breakdowns, a guitarist who left to get a magazine and disappeared for a week to be finally discovered in a Christian hippie commune, and a singer who took too much LSD, turned schizophrenic, and tried to then donate all the band's money to charity.
All this is just the tip of the iceberg. Fleetwood Mac wasn't really a band. They were a soap opera that occasionally spun off chart-topping, Grammy-winning albums as a side effect. At one point, their manager got so fed up with all the drama that he claimed legal ownership of the name and sent out a bunch of random musicians who'd never met the actual band to earn money playing under the name, while the real band busied itself with running its soap opera, which by that time was a full-time job. This "fake Mac" threatened to replace the real one, but it didn't get very far, because the roadies figured out what was going on and hid their guitars.
Long story short, when it comes to my record as a performer or a producer, my future in music doesn't look great; but when it comes to my record of drama, things look pretty good. Histrionics and soap operas seem to have some kind of very strong statistical correlation with musical success, and I've already gotten myself banned from a group I started, so that seems like a very good omen. But the weird thing about not being allowed back into the Ambient Mafia is that - although I get the feeling that a few former friends now harbor this image of me as somebody evil - I know for a fact that more than one of the people in that crew also seem to consider me a genius. I even think there's some crossover there.
That's right - crossover. There are people who think I'm evil, people who think I'm a genius, and people who fall into both categories simultaneously. You don't need a Venn diagram to figure out what that means, but as a rule of thumb, I never pass up the chance to make a good Venn diagram.
That more vivid, yellowy-greeny crossover zone is where you find people who think Giles is an evil genius.
Which demands an answer to the question - what does an evil genius do, when set against the Mafia? There can be only one answer. He retreats to his island fortress and builds an army of evil robots. Logically then, when an evil genius is set against the Ambient Mafia, he retreats to his island fortress and builds an army of ambient evil robots.
And I hate to say this, because it lends enormous credence to the image of me as an evil genius, but this is exactly what I've done. Here's the hour-long ambient robot DJ MP3 to prove it (88MB). Archaeopteryx can now create ambient music running indefinitely, with enough rhythmic and melodic content to remain interesting, or at least interesting enough for ambient music - which functions as environmental backdrop, rather than as a focus of attention, making it wonderful low-hanging fruit for algorithmic composition - so my army of ambient evil robots may in fact be ready to take on the Ambient Mafia.
Actually, though, I'm not quite the evil genius I could be. My thirst for revenge isn't quite up to par. Instead of pitting my robots against their human counterparts, I'm going to skip all that and take my (software) robots to Burning Man instead. First of all, my robots have been working hard, so I figure they deserve a vacation. Second, fighting the real Mafia's a big deal, so fighting the Ambient Mafia might be a big deal too. I could have to work hard. I might even lose. On the other hand, racking up good karma while my robots sing to hippies is easy.
Saturday, May 17, 2008
Archaeopteryx: Links
Because nothing says "a wild and crazy guy" like a list of links posted at 9:23pm on a Saturday.
Circle of fifths
Structure implies multiplicity
WiiToMidi
NOR_/D
Water and lasers MIDI controller
Friday, May 16, 2008
Two Flaws With "Time Off From Programming"
Rob Walling has gone from developer to manager and back again more than once. He also used to play guitar really well, practicing daily for hours, and has since grown rusty. He says returning to programming is very different from returning to playing guitar:
not playing the guitar for 4 years means you lose muscle memory and a few songs, but leaving programming for 4 years is like a death sentence to your technical knowledge. Not because you’ll forget what an if statement is, but because programming languages move so quickly that 4 years could include 2 or 3 new versions of your language.
My experience, however, is the opposite, and I can tell you exactly why.
Rob left programming to become a manager and then came back to it, and each time faced a learning curve to get his programming skills back up to speed. I left programming to become a starving artist, and although I also faced a similar learning curve upon my return, what I lost in technical knowledge I gained in perspective. One thing I spent a lot of time on was developing the ability to draw accurately and realistically, and when you do that, you train your mind to observe very precisely, and to throw away inaccurate observations.![]()
After that period, the code I wrote upon returning was more compact and more powerful. The things I built were more inventive, more original, and more worth building in the first place.
It's no surprise that a programmer who took a programming hiatus as a manager says he suffered as a result, and a programmer who took time off to draw says he improved. Ultimately these are very subjective reports, and without side-by-side comparison of code over time, we'd be hard-pressed to make any claims of scientific objectivity here. We're basically saying, "My vacation was fun," and "My vacation wasn't." If we're going to be scientific about it, the most we can say is that time off as a manager affects your opinion of your programming skill poorly, and time off as an artist affects your opinion of your programming skill well.
I have another point also. I'm not disputing that time off affects your memory of particular APIs. But those APIs change so quickly that trying to hold onto an API is like trying to tell somebody that because you love their smile at a particular moment, they should never change their expression. You might as well try to bottle the wind. The APIs change rapidly for a reason, and you don't really need to catch up on all the changes - just the latest ones.
There's a very, very big flaw in Rob's statement here:
4 years could include 2 or 3 new versions of your language.
Consider how different this sentence would be if Rob wasn't assuming that you use one language, you choose that language, you settle on that language, and four years later, even though you haven't written any code in it over the past four years, that language is still your language.
4 years could include 2 or 3 new languages you might use.
Suddenly it sounds like fun!
All you have to do make it fun is decide that languages are toys to play with, not treadmills to run on.
If you want time off from programming to be good for your programming skill, choose a way to spend that time off which will be good for you in general; and if you trap yourself in any particular language, confusing your choice of a tool with your choice of a spouse or a religion, the loss of flexibility you subsequently experience may have nothing to do with any time off you may take.
Time away from programming is very, very healthy, and you should definitely take it now and again.
Thursday, May 15, 2008
Tuesday, May 13, 2008
Artistic Visionary, Or Insane Genius?
Want to be an insane genius?
If you want people to call you an insane genius, it's easy to achieve. Take things that they believe are impossible, and explain in detail how and why anybody can do them.
If you'd prefer people called you an artistic visionary, however, just skip the explanations and do those things.
Friday, May 9, 2008
A Face For Stephen Hawking (Giles Bowkett Remix)
A Face For Richie Hawtin
Ruby-Processing creator Jeremy Ashkenas cooked up a programmatic multimedia piece called "A Face For Stephen Hawking," which generated starfield-like graphics in response to spoken word. After he saw my GoRuCo presentation on Archaeopteryx, he e-mailed me and told me his code works well for music too. Turns out this was very true. So I made a few changes, enough to give it my own spin, and pitted it against a Richie Hawtin mix mp3.
By the way, Ruby-Processing allows you to distribute pre-packaged apps for which the code remains editable. I had wanted to learn Objective-C up until I discovered this; now I just want to write a GUI library for Ruby-Processing. Like RubyCocoa, Ruby-Processing involves a lot of Ruby which looks like another language, but Ruby-Processing seems to do this with less work than RubyCocoa (specifically, without what appears to be a compiler, and with more idiomatic Ruby). Shoes gives you "write once, run anywhere," but it's nowhere near as Apple-friendly.
It's Ruby-Processing FTW here, in a very big way. If Ruby-Processing had a powerful GUI library, I think a lot of people would be very happy to use it to package and distribute applications that had nothing to do with Processing's visualization sweet spot. Prepackaging GUI apps with editable code might be able to give you the best of both worlds - the income of commercial software and the collaboration of open source. You could charge money for consumer apps and still allow consumers to edit the apps, or even give the code away to programmers but charge regular people for the app itself.
I know Ruby programmers who are very skeptical of JRuby for its sheer Javaness, but trust me, there's a win here:
The win is that Ruby-Processing has made Java's "write once, run anywhere" promise actually true. The irony, of course, is that Java couldn't deliver on "write once, run anywhere" until Ruby came to the JVM.
Thursday, May 8, 2008
Because Creating jQuery Wasn't Enough
John Resig implemented the Processing visualization language, and its entire 2D drawing API, IN FUCKING JAVASCRIPT USING THE FUCKING CANVAS TAG.
I'M NOT KIDDING.
Ahem.
Sorry.
What I mean is, John Resig implemented the Processing visualization language, and its entire 2D drawing API, in JavaScript, using the <canvas> tag.
Thereafter, no doubt, he wired his heart to a car battery, not to keep himself alive, but just for the hell of it.
Twitter's "Scaling Problems"

There are Rails apps that get a lot more traffic than Twitter. I worked on one of them.
People like to say that Twitter's downtime issues indicate a Rails scaling problem. But if that were the case, sites which receive more traffic would have more downtime. In reality, they have less.
It's therefore very likely that Twitter's downtime issues come from some other source than its use of Rails.
Going further, it's irresponsible to speak of Twitter having a scaling problem. Twitter has an issue with frequent downtime. This may indicate a scaling problem; it may indicate some other problem instead. Without working at Twitter, you'd be hard-pressed to say with any degree of accuracy.
Wednesday, May 7, 2008
Ranjit Bhatnagar; Monome; Doc Ock v0.2; Type
Quick links:
Monome comes to Los Angeles
Freaky robot art music
Minor improvements to Doc Ock
Typography Movie:
Tuesday, May 6, 2008
When It Happens, Remember That You Read It Here First
The joyless insanity of the 1950s largely created the joyful insanity of the 1960s (and the darker sides to it as well).
This didn't happen in the UK, however, because over there, the 50s were never like the American 50s. The 1960s in England were correspondingly not about youthful rebellion, but more simply, the joy of abundance, as decades of postwar food rationing came to an end.
In the UK today, however, the video surveillance is joyless insanity of the purest kind.
The American 1960s were a freak occurence, a perfect storm of many factors, but something similar, though lesser, is probably on the way for England. I can't prove it, but I feel totally sure of it. Joyless insanity led to a generation with utter disregard for existing social norms, and consequently to widespread, dramatic social change; this will probably happen again, in a different place. It has the feel of natural consequence to it.
Clay Shirky described this recently, although he mistakenly assumed it has to happen at the speed of centuries. (In his model gin was the joyless insanity, and all of industrial society's fundamental institutions the social change.)
Monday, May 5, 2008
Archaeopteryx: Automagic DJ Proof-Of-Concept
In my GoRuCo presentation I told people that Archaeopteryx woud soon control DJ software, specifically Ableton Live. I got it working in a proof-of-concept form last night.
I basically just hooked up the crossfader to a random number generator, but you know what they say, the journey of a thousand miles starts with a single step.
Build Rails Apps Which Build Rails Apps For You
Programmatically Generate Enterprise Integration APIs
Many sites, including my current project, use Omniture for page tracking and analytics. In practical terms, this means somebody has to build JavaScript identifying each page in Omniture's terms, which can involve a mind-numbing amount of repetitive, beauraucratic code.
If you take a look, you'll see that many of these variables have identical values, and few of them have semantically significant names. Nobody who's worked in technology for any length of time will be surprised to learn that this combination resulted in tedious, tangled code on the Rails side, specifically in the helpers, or that the Rails helpers which generated this JavaScript from within various Rails apps all operated more or less independently, without a great deal of co-ordination, leading to an inevitable maintenance nightmare.
The temptation here is to complain, read Slashdot, and put Dilbert cartoons on your cubicle wall. But it doesn't have to be that way. There's a saying among actors: "there are no small parts, just small actors." Any time an actor complains he or she has a small part in any given production, that's the correct answer and the only answer. Maybe there's an equivalent for programmers: "there are no boring programs, just boring programmers."
One way to make a boring problem interesting is to solve it forever, and in every way, simultaneously. But if you want to solve something forever, the first step is to solve it once. Therefore the place to start is with a simple solution, and then find a way to generalize that solution.
Our existing Omniture code did not have the virtue of simplicity. The first step was to find a way to make it simple. This was easy, because I've read the Gang of Four and I know my design patterns.
As an aside, I think the Rails community's scorn for the enterprise is pretty fair, but what seems much less fair is its scorn for design patterns. A partisan attitude to programming languages often involves a knee-jerk tribalism. Design patterns are bad. Why? Because Java programmers like them. This passes for logic in the more ghetto sectors of the Rails metropolis.
The simplest possible solution to this problem is the Data Object, which is simply an object representing data. (It's funny how many books you need to read before you start to program in the simplest way possible.) Instead of generating all this stuff inside the template, first you put it in an object:
And then you have a much smaller block of code to deal with in the template:
Your preparation in the controller is tiny as well:
(The send and respond_to? stuff is in there because different pages for Omniture need to report different variables.)
This was a massive improvement over the old system - the code is easier to use and easier to maintain. (The only confusing bit which remains, the stuff in the template, could easily turn into a helper with some quick refactoring.) So, the first half of the mission - build something simple which works - is accomplished. Now for the second part: generalizing to every application this company has.
That's where VisiJax comes in.
The next step was to build a simple spreadsheet editor in Rails with Scriptaculous. This took a couple days, and I open-sourced it, mainly so anybody curious could follow along with the code. (Side note, I was pressed for time; otherwise, this would have been a great excuse to explore jQuery, which Yehuda Katz completely sold me on with his presentation at the Philadelphia Emerging Tech for the Enterprise conference.)
Anyway, I built a spreadsheet editor to match the pre-existing workflow. In this situation, the mapping of variables to values comes to the programmer from the business analytics team, and it comes in the form of an MS Excel spreadsheet. The concept of objects mapping to page types is actually implicit in the spreadsheet format:
The easiest way to build an elegant interface is to build an interface that doesn't appear to be an interface at all, which means the easiest interface to turn a spreadsheet into a code is an interface where you appear to just turn a spreadsheet into another spreadsheet.
At this point we have a consistent pattern of code which our data should result in, and a simple interface to capture it. Hopefully it's obvious where this is going: the last and final step was an ERB template and code to use it.

Running this code against the spreadsheet in your Rails app's DB will produce objects that look like this:
(One detail I didn't go into: the system knows to capture variables identified $like_this$ in the spreadsheet and turn them into options hash retrieval in the initialize methods.)
So there you have it - a complete workflow and a robust solution all in one. You get a spreadsheet from the business analytics team, you copy it into your code generator Rails app's spreadsheet, running on your local machine, and you plug the files that Rails app generates into the server-side Rails app you're developing. Then you edit a few controllers, maybe write a few helper methods, and you're good to go.
You might wonder why, if I'm storing all this information in a database anyway, I didn't just make one Omniture control app to sit on a server and operate as a Web service, rather than building a code generator to run on developers' local machines. The answer's in the economics. Centralizing the information in a Web service makes it expensive to change; many things would be dependent on such a system and the overall effect would reduce flexibility. Dropping it on a developers' local machine means the app becomes a throwaway app, and if it needs to change later, it can. The reasons were economic from another perspective as well: working with the separate corporate team in charge of servers adds some overhead, while creating a DB in MySQL on your local box is a two-minute task. You always get more leverage when you make essential operations cheap.
In fact, this kind of organizational overhead is a motivator in the design of the user interface as well, and in the choice of code generation as a strategy. Previously, for a programmer to implement Omniture integration on this company's various web apps, the developer had to understand Omniture integration. However, although understanding is generally a valuable thing, in this context it's a serious waste of time and money. Omniture integration is highly specialized knowledge. It doesn't extrapolate or generalize to anything else Rails developers do; due to its proprietary nature, it can change unpredictably; and it may or may not be useful in future for the types of jobs Rails developers want to have. For many developers, there's zero value in understanding this information, and there's actually a similar downside to the corporation as a whole for the Rails developers to attempt to understand this information, since any developer who does so will come to their own slightly distinct conclusions about it, which means they'll clutter the code base with countless variations on the same basic semantics.
More simply, the Rails devs just don't need to know about Omniture. The only thing they need to know is what variables should have which values in the JavaScript for Omniture which their Rails apps generate. The business analytics team prepares spreadsheets defining their Omniture implementations, but then needs to have meetings to explain these spreadsheets to people. Given that the whole process of attempting to understand the spreadsheet is purely wasted effort, both from the perspective of the individual developer and from the perspective of the corporation as a whole, a process which simply takes a spreadsheet as input and produces viable code as output delivers the required result while introducing regularity to the process and simultaneously removing monotony.
Code generation gives you terrific advantages in productivity. Meetings waste everyone's time, so streamlining corporate processes makes life smoother for everyone. Mind-numbing repetition is for computers to handle, and when a corporation gives you mind-numbingly repetitive programming tasks, the correct response is not just to do those tasks, but also to write a program to do those tasks for you, so that nobody will ever have to do those tasks by hand ever again, even if those tasks are in fact programming tasks. This is what metaprogramming really means.
Why write programs when you can write programmers?
Sunday, May 4, 2008
Archaeopteryx: Techno/IDM Wind Chimes
The audio was done with Reason, driven by Archaeopteryx. The video is just video I shot with my camera. I had a pair of sketches lying around which I hadn't been able to record. For some reason my audio recorder couldn't play nice with the threading/timing stuff in Archaeopteryx. So to record the audio, I had to use Snapz Pro X and pretend to be making a video, then throw away the video content in the file. I figured if I was going to all that trouble, I might as well make an actual video.
Unfortunately the Vimeo.com upload process ate the last 20 seconds of audio for some reason.
The vocal sample is Buffy from Buffy the Vampire Slayer saying "looks like Giles has some schooling to do," but in reality, this isn't me schooling anyone, this is just a sketch. The two existing sketches I built this from were perpetual music generators - one made perpetual randomized techno, the other perpetual drum and bass which had both dynamic and hard-coded components.
Obviously this wind chimes thing is kind of simplistic, and far from a killer app. The exciting part is that I hit my target use case for Burning Man months ahead of schedule. My goal was to get Archaeopteryx to dynamically generate infinite streams of ambient/IDM stuff by the time of Burning Man, and it's definitely there. Ironically I might not get it to Burning Man, though, because the logistics of setting up a computer out there are kind of a pain in the butt.
Specifically, solar power may or may not cost thousands of dollars. The reports vary widely. The obvious alternative - a noisy, stinky gas generator - would kind of undermine the soothing aspects of the ambient music, what with all the noising and the stinking going on.
Still, there are plenty of reports of successful computer usage at Burning Man, and plenty of reports of successful solar power up there as well. I know it's been done and I know it can be done, I just haven't figured out how to do it.
Either way, though, I've got reasons to be stoked. I've met the bare-minimum use case months ahead of schedule; that's good news on any project, and especially good news on a part-time project targeting potentially impossible use cases.
Saturday, May 3, 2008
Friday, May 2, 2008
Automatic Call Generating For Misbehaving Congress-Beasts
Web 2.0 creates very interesting new phenomena in politics. There's more of this on the way.
Thursday, May 1, 2008
GoRuCo Pictures
After speaking at a gazillion conferences, I finally got the bright idea to take pictures with people.
Me hanging out with Tom Mornini:
Me and Toby DiPasquale throwing the vi gang sign:
(I look completely insane in that one. Too much wine, maybe, I don't know.)
Me and Chris Wanstrath throwing the horns:
Zed Shaw giving me the finger:
(I told him real programmers think Factor is for pussies. Turns out he likes Factor. Who knew?)
Utility Belt: v1.1.0 Released

This version of Utility Belt features a system by Markus Prinz for choosing which gadgets in the belt to equip. We're pushing the metaphor a little but the practical result is you can choose to use only a few elements of Utility Belt, or all of them, or somewhere in between, and that means you can A) customize your IRB much more than before, and B) incorporate Utility Belt gadgets into other systems you create. I've frequently used Utility Belt's hash math in other places, now it's just a matter ofrequire 'rubygems'
require 'utility_belt'
UtilityBelt.equip(:hash_math)
So go ahead and make with the gem update fu.
VisiJax: Simple Rails Spreadsheet App
Here's a video of VisiJax in action:
It's an incredibly simple app - all you can do with it is create tables and edit them. Columns are called "page types" and rows are called "variables." This is because I created this as the front end to a code generator concerned with page types and variables. Only after actually building it did I realize that I'd created a general-purpose table editor which might be useful for general spreadsheet applications. It's not a staggering work of genius by any means, but if you needed to build arbitrary spreadsheet-like apps, it's essentially scaffolding for those types of projects.
So, I named it after VisiCalc, the Apple II app which was the first spreadsheet, and put it up on GitHub. The name is kind of a misnomer, though, as VisiJax just stores data, without executing formulas. (Adding formulas to VisiJax would be pretty trivial, though, and an interesting way to cut your teeth if you're new to Rails.)



















