Cosmic Class.new
Reading the sources of test/spec inspired me to write a whole post about Class.new on the FiveRuns weblog. Unintentionally, I ended up channelling the style of Err The Blog in writing that post. Now, Chris Wanswrath has posted a little ditty, test/spec/mini, that uses Class.new.
The “Circle Of Class.new” is complete, we can all go back to our normal lives. Also, Class.new totally has a man on your boat.
Teamwork anti-pattern: the edge case
Edge Cases are the Root of all Evil:
"I've learned over the years that Edge Cases are not meant to be normal rationale or a casual reminder of some odd circumstance that you've neglected. Rather, they usually represent an attempt by someone else to gain, show or exert power in a situation. I'll explain."
After reading this, I immediately realized the Edge Case is definitely an anti-pattern of teamwork. I’ve observed, suffered and inflicted this particular tactic countless times in the past.
Tackling this one is three-pronged:
- Recognize it. When someone points out an edge-case, quickly try to establish with the rest of the team whether this occurrence is as rare as you think it is or whether its truly important.
- Neutralize it. If it really is a corner case, mark it as such and get back to making actual progress.
- Bury it. Should you throw something out there and find its really an edge case, let it go. Don’t be that guy.
“But Adam”, you say. “It would be really embarrassing if we omitted a condition for the Blurbleflaster Case!” Well, I couldn’t even find the Blurbleflaster Case in Wikipedia! So, if someone finds that we’ve omitted it, then they get the prize; it won’t be the end of the world. We should probably implement that whole social network thing first anyway.
I Like Rails 2
Tonight I gave a presentation on Rails 2 at Dallas.rb. Within, I note some of my favorite new things in Rails 2. Some things small, some things large.
If you weren’t there, I should probably explain a couple of the slides. I think Rails 2 is, despite its whole-numberness, an evolutionary release. It makes the Rails “language” smoother around the edges. Granted, its still somewhat blob-esque, but its getter rounder. I dig it.
Besides that, I think Active Resource, or ARes as they call it in the biz, is going to prove useful mostly behind the firewall in your datacenter. As you build more and more applications, you’ll find you need to use resources across multiple apps. This is exactly where ARes shines – providing a common user service, for example.
You can download I Like Rails 2 it if you missed it or, for some reason I can’t even fathom, aren’t even in Dallas.
Getting ahead on Git
Git. Soon, you’ll be using it, too. The definition of “soon” probably varies widely depending on what kind of person you are. But, no better time than now to start getting acquainted with the idea.
- If you're currently a Subversion user, and who isn't, then try the Git tutorial for Subversion users (Ed. now 404).
- There's a Peepcode screencast on using Git(Ed. now 404).
- Git is pretty deeply hacker stuff and the default
gitkUI is uglier than sin. However, Chris Wanswrath and Tom Preston-Werner are adding some beauty to the equation with github.
Finally, what I really wanted to do here was publicly commend Dr. Nic Williams for his adept use at Star Wars metaphor and humanization of Grand Moff Tarkin in his post on using Git to manage the new Rails TextMate bundle (Ed. now 404). Well done, sir. I owe you a frosty one.
Ed. revised Feb 15, 2025. URLs updated or noted as 404, copy left intact. What a time-capsule!
What good could come from MicroYahoo?
Microsoft Proposes Acquisition of Yahoo! for $31 per Share:
REDMOND, Wash., Feb. 1 -- Microsoft Corp. today announced that it has made a proposal to the Yahoo! Inc. Board of Directors to acquire all the outstanding shares of Yahoo! common stock for per share consideration of $31 representing a total equity value of approximately $44.6 billion.
So everyone’s probably gonna spill ink on this one. Understandably – in Flickr, Upcoming and del.icio.us you’ve got three of the most trusted and loved sites out in their respective communities. In addition, there’s a lot of respected people, both in web development and open source, at Yahoo. Joining Microsoft, an organization with minimal respect in the web development and open source communities, would reduce those people’s cred right out of the gate.
Were this bid successful, here’s what I hope would happen. Microsoft uses it as an opportunity to rebuild organizationally. Bury the hatchet with open source and open up the development of Internet Explorer. Yahoo continues building apps like Flickr and del.icio.us like they always have. A rewrite on .NET technologies isn’t imposed like it was on Hotmail. In the end, Microsoft becomes an organization where closed source, proprietary development can flourish with open source, standards-based processes.
This is wild guessing on my part. That said, if you look at Microsoft, its clear they are having major execution problems. Xbox is the only group that is widely successful and even they have hardware problems. All the other groups are missing timelines and customer/developer expectations. Just like Yahoo was before they picked up Flickr, del.icio.us, Upcoming, etc.
If Yahoo can make acquisitions to rebuild their culture, perhaps Microsoft can too.
Ed. revised Feb 15, 2025. Turns out this didn’t happen, but my predictions did reify with the Microsoft acquisition of GitHub. Also, it’s hard to remember the moment when Yahoo was ascendant! Take care what you wish for?
Whither Prototype or jQuery
The fact and fiction of why I choose Prototype over jQuery
FACT: I like Prototype better. It fits the way I program perfectly. I like prototypes, I like programming in a somewhat functional style. I don’t think of things in a DOM-centric way. I’m OK with having client-side state.
FICTION: jQuery is the “emo” framework. Apparently it (was) the “new wave” framework. Either way, I will always hold it against John Resig that he chose Devo hats as the logo.
FACT: jQuery is a fine framework if you think in terms of the DOM or don’t do much back-end programming.
FICTION: To become proficient at Prototype, you have to punch the first jQuery user you see every day. I have never punched a jQuery user. Attempts to verbally duck punch them have met with minimal success.
FACT: Dollar functions are sexy. Clearly one of the best abuses of a programming language grammar, ever.
FICTION: You can’t write unobtrusive JS with Prototype. I wrote a tutorial for Advanced Rails Recipes on how to do that with Dan Webb’s lovely LowPro library.
FACT: We can all agree, YUI is really unpleasant to look at. ENOUGH.with.the.fourteen.dots.before.I.can.do.something.useful!
FICTION: Sam Stephenson is an artificial intelligence akin to GLaDOS. I’ve met Sam twice. He did not attempt to coerce me into an incinerator.
Now that we’ve got the record straight, I’ll leave you with a comparison. To my jaded, biased and stubborn eyes, trying to use jQuery feels limiting. But I think that’s particular to my experience and preference. No doubt, if jQuery were a musical instrument, it’d be akin to Stevie Ray Vaughn’s guitar “First Wife”: suited to its user, iconic and specifically built to its purpose. If you were to try and play a Beethoven piano sonata on First Wife, it just wouldn’t come out right. However, your basic baby grand piano is equally suited to Beethoven or B. B. King. So in my tortured metaphor, Prototype is a piano – harder to play well, but more rewarding once you do.
Ed. revised Feb 15, 2025. I left everything intact, to remind myself where my writing/thinking was when I was 29. š«
Magnetic Ink
Processing might force one to use for loops, but this bit of generative art is beautiful. The music ain’t too shabby either.
The good news about a long writers strike
Apparently, some think that the WGA strike could continue well into 2009, affecting movies as well as TV. No Writers, No Movies? Strike May Hit '09 Films:
Also moved to the back burner are "Nine," the musical based on the Fellini film "8 1/2 "; "Angels & Demons," the second installment in the "Da Vinci Code" franchise; Michael Bay's "Transformers 2"; and 20th Century Fox's remake of the 1966 film "Fantastic Voyage."
So, really, only half of the possible outcomes are bad. ZING! Take that, Michael Bay and Dan Brown!
Overcoming "browser tab seventy-three"
So now that NetNewsWire (NNW) is free, everyone should go download it and enjoy the love. It was the first app I ever bought for Mac, and it would seem I will only have to pay for it once. Hearty shout-outs to Brent!
That said, any experienced NNW user knows that information overload is easy to get yourself into and hard to elude once you’re wrapped in its grasp. The very manly Merlin Mann brought us Inbox Zero and I knew I needed to strive for Feeds Zero, in addition to browser-tab zero, Twitter-zero, etc. Unfortunately, Feeds Zero can lead to dozens of open browser tabs in NNW. Fortunately, NNW is better than any other WebKit app I’ve seen at dealing with this.
But now I’ve got a ton of browser tabs in NNW holding down my soul. A contemporary, first-world problem. In trying to keep up with feeds, one spawns many dozens of browser windows. Lots of stuff to read. But, the sheer mass of 100+ tabs is considerable friction holding you back from, you know, acquiring all that information.
Here’s my current situation:
I get myself into it pretty frequently. I bet you do too. Here’s how I get through it.
Work from both ends
In NNW, Cmd-Shift-Left and Cmd-Shift-Right move you up and down the vertical tab bar. Sometimes what I see in the first several tabs just isn’t appealing at the moment, though I can easily convince myself that my future self will find it intriguing. So I just turn around and head the other way. I might find something I like in that direction.
In fact, if you just finished some un-bolding, the newest, freshest links will end up closer to the Cmd-Shift-Right side of the list. In theory, your current self found that intriguing enough that you could actually start reading it now. ;)
Just close the tab
As I’ve alluded, sometimes your past self just has poor taste. Your former self pulled up some article that you know, really, you’re only barely interested in reading. Or maybe you just felt guilty not reading it, but you still wanted to unbold it.
Look, sometimes your Attention Bush needs trimming. Cmd-W is your friend, people. It makes the pain go away, no matter what app you’re in.
Export to HTML, process outside of NNW
Recently, I’ve found the first two tricks weren’t helping me. My tab list just grew and grew. The guilt became intolerable. So I rebooted. Kinda.
Tab->Export Tabs in NNW is my new best friend. I used it to export all my tabs to an HTML file. Then I sorted the list in TextMate, so as to collect everything by author, rather than over time. I’ve been pulling a few links off this list every now and then. Once they’re in my real web browser, I remove them from the list.
A couple days in, I’m already a fourth of the way through the list. And I’ve been able to guiltlessly tackle my feeds. Happy.
Know what you're up against
I have an AppleScript that tells me how many tabs I have open in NNW. It’s vital for telling me whether I should focus on “feed zero” or “tab zero”. You can see the window it displays the count in the screenshot above. Here’s the code of the script:
tell application "NetNewsWire"
set theCount to ((number of tabs) - 1) as string
display dialog theCount & " open tabs" buttons {"OK"} default button 1
end tell
Stick it in ~/Library/Application Support/NetNewsWire/Scripts and it will appear in the Script Menu for NNW. I like to use the Keyboard Preferences pane to bind the script to Control-Cmd-C for quick use.
So. I’ve given you some chisels that you can use to work down that attention boulder you’ve made for yourself. Just remember that the goal is to acquire new and fascinating information and still get stuff done. Keeping those attention sails well trimmed is the best way to avoid hundreds of NNW browser tabs.
Wheaties for programmers
Reflections of an Interface Designer:
If you want remarkable results, feed a good programmer a diet of good design.
Kevin’s right on here. I’ve been eating up design lately. But even before that, seeing some really great design, even if its not code, inspires me to get off my butt and write more, better software.
The barbarism of the for loop
I’ve been reading Programming Erlang and also casually looking into Haskell. So yesterday when I tinkered with Processing just a little bit, code like this just looks barbaric:
for(int i=0; i<width; i++) {
doSomething(i);
}
Compare to Erlang:
% Closer to Java and PHP. Nearly, but not quite, tolerable
lists:foreach(DoSomething, lists:seq(1, 50)).
% More Ruby/Lisp like. I can dig it.
lists:map(DoSomething, lists:seq(1, 50)).
% List Comprehensions FTW
[doSomething(I) || I <- lists:seq(1, 50)].
I mean, really. If you’re writing for loops in 2008, don’t pass go, don’t collect $200. Or even 200 Euro.
The caveat is if you’re implementing a language or compiler. Then I’ll forgive you. But if you could work that out by 2009 or so, we’d all thank you.
Bookstacks, photography and Star Wars
My bookshelf used to make me sad. So I finally dumped everything out and put things back in sane order. Of course, the magic of a cleanly organized bookshelf is all on Flickr. If you enjoy perusing book-stacks, you should have a lot of fun here. Even if you don’t, I made sure to include lots of fun notes to make it worth your time to give them a look see.
Next, we’ve got Courtney’s nice work with her new digital SLR. She’s learning quickly, but already taking great photos:
Finally, you may recall the Honda Civic del Sol that was converted to look like a fighter from Star Wars. Well, Courtney and I came across a del Sol with a similar paint job last night, though not so much with the body mods. Wonderfully nerdy and indulgent.
To the person who drives this car, I salute you!
Making sense of the world
I’ve noticed that when I’m walking about, sort of thinking idly, I find myself asking “How?” How was that building constructed? Why is that sewer there, and not somewhere else? OK, I guess that one is really a why question. So I suppose the underlying curiosity is really about the mechanism of the world.
Sure, you can’t reduce the world to a mechanism, a machine. It’s full of humans, so you can’t really make any kind of useful predictions. But there are definitely systems in place and some are more influential than others. Some of those systems, while not predictable machines, do display tendencies and trends. Learning them is one of the little intellectual side-journeys I’ve been immersing myself in lately.
If you want to play along, here’s what I’m into at the moment:
- Economics (probably macroeconomics in particular)
- Cognitive science
- Linguistics
For the former, I encourage you to listen to The Economist Podcast (iTunes) and read the weekly edition when you get the opportunity. They also seem to have moved away from using a pay-wall, so check out the articles on The Economist website as well.
If you’re wondering why on earth economics might be interesting, then check out Neal Stephenson’s Baroque Cycle. I never thought I’d wish I understood macroeconomics and financial instruments so that I could figure out what’s going on in a book by a cyberpunk author. But then I read the Baroque Cycle and I did. Its no coincidence the last of the cycle is titled The System of the World and here I am, seeking a system that illuminates the world.
For cognitive science and linguistics, I’m still just getting started. I read Introducing Linguistics this summer and its great. It seems its part of a series where they match a subject matter expert with a graphic designer. The result is easily read but highly informative. Its very much in the same style as Kathy Sierra.
If you’re ahead of me here and know a good bit on any of these subjects, feel free to drop some suggestions on what I should read next!
I want to look at your workspace
Briefly: I enjoy looking at the workspaces of others. One of the uniquely great things about going to conferences is shoulder-surfing other people to see how they work. So when I figure out how I can do that from the comfort of home, I get a little excited.
OK, I admit it. I have the tendencies of a “workflow voyeur”. And you can too!
Ed. there are still lots of ways to look upon other folks workspaces. Basically none of the below are still around though. š¤·š»āāļø
Start with a recent discovery, Office Snapshots. Proceed to check out Garrett Murray’s new desk setup, or even his old setup. Rinse and repeat with the Unclutterer Flickr Group. In no time flat, you too can ogle and lust after the workspaces of others.
Here’s an obscenely out-of-date snap of my desktop at home:
Like the sky or the horizon?
Is your knowledge as a programmer tall like they sky or broad like the horizon?
Greg Knauss says the programmer is like the sky, the manager is like the horizon. From Wide vs. Deep:
So here's my theory: Managers must work shallow and wide, while programmers must work narrow and deep. People who are naturally tuned to one particular method of work will not only enjoy their jobs a lot more, but be better at them. I'm a deep guy, I should be doing deep work.
I didn't say it was a particularly insightful theory.
Counter-point: your must prune your knowledge so that it is deep and broad. I spoke to this in my OSCON presentation The Holistic Programmer. From my description:
The Holistic Programmer is about how programmers should take a global view on the stack of abstractions in which they work and also in the spectrum of communications between people and machines.
Therein, I talk of my approach to problem solving. My method is largely predicated on knowing a little bit about a whole lot. I usually frame a problem pretty quickly and get on to making the first attempt at solving it. I might get lucky and actually frame the problem correctly. If I don’t, at least now I’ve got an idea of what the problem really is and I can take another, more informed stab. So on this, Greg Knauss and I disagree.
My main point is that programmers need to take a holistic approach these days, knowing things above and below them in the application or system stack in which they are expert. This is the deep part that Greg mentions. Its not enough to just speak Rails, Django, Linux or Flash. You have to understand the bits that are higher level and the bits that are lower level than what you are working on. Otherwise you’re looking at an incomplete picture.
There’s a notion going around of the “specializing generalists” or some such. I think it’s a great way to go. Given the rapid rate of change in software development, you have to stay nimble. The ability to quickly adapt to new technologies and approaches separates the mediocre programmers from the great programmers.
Epic songs, pick a favorite
Prepare to be polled.
For the purposes of this survey, we’ll take an “epic song” as one with musically distinct beginnings and ends. Said song shall not be a grouping of songs, like on Abbey Road or Born to Run. In other words, it’s only one song on the track listing. Here’s some of the best epic songs that popped into my head:
- "Bohemian Rhapsody"
- "Hey Jude"
- "Stairway to Heaven"
- "November Rain"
Your mission is to choose one of the above, or write in with your own favorite. If you write in, please do try and provide a link so that we can listen in.
Now, get those opinions flowing. Here, I’ll start. “Bohemian Rhapsody” takes the cake.
The rise of the micro-app
A few weeks ago, Dan Cederholm, of Simple Bits fame, launched Foamee. Foamee lets you track to whom you owe beers. The twist? You manage your beer debt via Twitter. Its a small little app. It only does one thing. Its got a fantastic entry-point. In other words, its really cool.
Erik Kastner reminded me of his app Band Named this week. It finally clicked why its cool this time. Games like Guitar Hero III and Rock Band want you to name your ethereal band. Band Named is a great place to post ideas for said names. The neat thing about Erik’s app is that you can sign in via OpenID (+1) and then fetch your avatar from Flickr or Twitter (FTW). The entry of new band names is easy. And its fun!
I hope this turns into a trend-buzz-meme thing. The world needs more apps that aim to just help you out now and then, not ones that want to become your task management, knowledge capture workflow mega-gizmo-jobby. Better yet, apps that are loosely coupled via infrastructure you’re already using (Flickr, Twitter, OpenID, etc.) taste great.
Plus, these little efforts needn’t result in all-pain, no gain. Dan probably can’t support himself on it, but I bet any money made from Foamee merch will come in handy. Likewise, there are lots of things you could do with something like Band Named, though I don’t know if Erik’s going to take it that direction.
So, call to action: hatch up some idea. Make sure its a little crazy. If pitching it to a VC would get you laughed out of the room, you’re on the right track. If you think the commenters on TechCrunch would skewer you, you’re getting even warmer. Think Uncov would just laugh and point? You’ve probably hit the jackpot. Now: go out, build the sucker and figure out how to have fun with it.
I’ll leave you with this: its all about getting to the point where you’re making dough and having fun.
Anthropomorphized Gems
I couldn’t make it to RubyConf this year. Big frownie face. But, I’m not letting that stop me from imposing my sense of humor on the world. I present to you this year’s helping of absurdity, “Anthropomorphized Gems”!
This is a little tribute to the gems I frequently use and enjoy. Thanks to the authors of the featured Gems and to all those who have released a Gem of any sort. Ruby has gone from a great language with a so-so library to a great language with a great library in relatively short order. Those making their Gems available deserve applause for making that happen.
Administrivia
- In HD, where available! This is my first foray into uploading video in HD. It takes a while, but the results are pretty nice to look at. On the other hand, none of my G4s seem to handle HD that well.
- I’m trying Vimeo even though I can’t really make heads or tails of their TOS. If you can read TOS-ese, let me know if it allows them to sell my stuff to NBC, Fox, etc. without me getting a penny. That would be unfortunate.
- For the record, I did go eat pizza after I finished putting this together.







