Wednesday, December 28, 2011

JavaScript Is Not A Language

Recently people presented arguments for and against using CoffeeScript. I felt the argument against was pointless and obviously wrong, but I couldn't figure out why, and I thought the counterargument for was kind of toothless and irrelevant. I've figured out the real issue.

The real argument for CoffeeScript is that JavaScript is not really a language.

Years ago I read something which explained, in my opinion, why Lisp has never achieved the mainstream adoption its passionate advocates believe it deserves. Lisp projects experience a degree of balkanization because everything is left wide open; you can use more than one object-oriented paradigm (potentially even at the same time), you write your own this, you write your own that, you write your own everything.

At Canada on Rails in 2006, somebody asked DHH why Rails didn't have a to-do list generator, and he said it was the wrong level of abstraction; to-do lists are always application-specific enough that any generator worth a damn would be as complicated as Rails itself, and probably as many lines of code. It's not something you can solve at that level of generality.

Lisp fails to recognize this, and rather than being a language, it is an abstract syntax tree manipulation system. An abstract syntax tree manipulation system is something every language needs and is built on, but it is not a language, any more than a skeleton is a person. Programmers who say Lisp is better than any other programming language are really saying that they prefer manipulating the abstract syntax tree directly vs. using somebody else's user interface for the same task, which is all a programming language ultimately is.

JavaScript is a Lisp with hideous syntax. Not surprisingly, it sees similar balkanization. Consider writing modular code. Do you use CommonJS, require.js, or something else? The question is idiotic; it should be answered at the language level. Do you choose which modular code-sharing system to support when you sit down to write your module? If you have three different solutions for writing modular code, you can't write modular code.

I use CoffeeScript for the same reason I use Ruby. Manipulating the abstract syntax tree directly is way more fun, but insufficiently pragmatic.

Update: I realize this blog post gets a bit idiotic with regard to technical details, and I've seen some Lisp fanatics ranting about what appear to be many entirely legitimate objections to the "JavaScript is a Lisp" meme, but I think my basic point here is pretty much dead on. Writing CoffeeScript just feels like using a language in a way that writing JavaScript just doesn't -- and I was doing drag-and-drop widgets before even Prototype existed.

Monday, December 26, 2011

Happy Holidays And All That

Wednesday, December 14, 2011

Comedian Louis CK Abandons Traditional Entertainment Industry Business Model, Makes Bucketloads

The experiment was: if I put out a brand new standup special at a drastically low price ($5) and make it as easy as possible to buy, download and enjoy, free of any restrictions, will everyone just go and steal it? Will they pay for it? And how much money can be made by an individual in this manner?

...this was a premium video production, shot with six cameras over two performances at the Beacon Theater, which is a high-priced elite Manhattan venue. I directed this video myself and the production of the video cost around $170,000.

The development of the website, which needed to be a very robust, reliable and carefully constructed website, was around $32,000...

The show went on sale at noon on Saturday, December 10th. 12 hours later, we had over 50,000 purchases and had earned $250,000, breaking even on the cost of production and website. As of Today, we've sold over 110,000 copies for a total of over $500,000. Minus some money for PayPal charges etc, I have a profit around $200,000 (after taxes $75.58). This is less than I would have been paid by a large company to simply perform the show and let them sell it to you, but they would have charged you about $20 for the video. They would have given you an encrypted and regionally restricted video of limited value, and they would have owned your private information for their own use. They would have withheld international availability indefinitely.

(PS: when he says

I want to thank Caspar and Giles at Version Industries, who created the website.

that is in fact a different Giles.)

Tuesday, December 13, 2011

Pixels Made Of Flammable Gas

via gizmodo. project originates with the Danish MIT

Seriously Awesome Live Drumming D&B

And this is just a tech demo! The drummer here is Michael Shack, who's working on the Netsky tour.

Sunday, December 11, 2011

CNN LED Ticker Tape Hacked?

Here in Los Angeles, CNN has a skyscraper -- I think it's their headquarters -- in Hollywood, at Sunset and Cahuenga. The ground floor showcases several big TVs running CNN, as well as a big LED "ticker tape" display running a constant stream of headlines and short, one-sentence stories.

I went by there yesterday on my way home from somewhere and saw the following two messages:

"GOP proves they do not care about consumers"

"It's sometimes a good idea to turn off the television if the news pushes your blood pressure beyond acceptable levels."

Either CNN got hacked in LA last night, or they've made a major change in editorial direction.

Wednesday, December 7, 2011

Firefox Vibrator API

I learned from HTML5 Weekly that Firefox has a new Vibrator API.

Tuesday, December 6, 2011

Fuck Yeah, Browser Sticky Pads

The Post-It Note will always be, for me, an icon of the "why didn't I think of that?" kind of brilliance that (like Rails) represents something which everybody needed -- and which anybody could have created -- a long, long time before the inventor actually made it happen. Thus, this product is noteworthy (heh) not just because if you know what it's for, you want one, guaranteed, but also because this is a Post-It Note type "why didn't I think of that?" product made out of actual Post-It Notes, making it a recursive Post-It Note.

Go, UI Stencils, go!

Monday, December 5, 2011

Why Is CSS Not Object-Oriented?

There's a brilliant but unreadable book called Pro CSS And HTML Design Patterns which attempts to analyze CSS and HTML and isolate design patterns, like the OOP classic. It fails and it succeeds. The author does identify commonalities and unifying principles within CSS, but these don't really qualify as "design patterns" as they don't have cohesive characteristics or nameable identities. In OO design, it's easy to understand what the Singleton pattern represents -- it's a single thing, instead of one of many. Nothing so comprehensible exists in this book.

I highly recommend this book, but as a mountain to climb, not as a silver bullet. The attempt to treat CSS and HTML like object-oriented software fails, because the DOM is just one massive object whose design cannot be changed, and CSS is not object-oriented at all. It is an incredibly coarse, brittle query language combined with an unimaginably complex set of decorating notations. Object-oriented CSS would be awesome, but faces tough questions. Which is the fundamental unit of CSS: a rule? a cohesive visual element on the page? the DOM tree a rule applies to?

CSS maps a tree of style rules to a tree of DOM objects. These mappings falter and frustrate, because mapping a tree to another tree is no task for human minds -- it's the whole reason compilers were invented -- but they also represent a tremendous improvement over the pre-CSS model, wherein a tag conveyed both styling and semantics.

This suggests an evolution, in which CSS compilers should ultimately exist, and indeed, some already do -- e.g., Front Page and Dreamweaver -- but they suck beyond belief, and the open source avenues to this destination are still very young.

Kyle Neath created a cool project called KSS which addresses the confusion CSS always creates. It's a simple and powerful system for documenting CSS. I think it's a step in the right direction, like Sass, but I also think that the world will be a much better place when we finally get CSS compilers built for grownups -- by which I mean people who could write the output code themselves, but have better things to do, like the intended user base for Rails generators or CoffeeScript.

KSS uses cohesive visual elements on the page as its idea of the fundamental unit of CSS:

You should document a rule declaration when the rule can accurately describe a visual UI element in the styleguide. Each element should have one documentation block describing that particular UI element's various states.

That sounds very object-oriented to me. The end result looks like this:

In keeping with this philosophy, KSS allows you to document an implicit object hierarchy with your section numbering:

KSS documentation is hierarchical in nature — any documentation blocks at [any point within the] styleguide hierarchy apply to the documentation blocks [beneath] that level. This means that documentation for 2.1 applies to documentation for 2.1.3.

For instance, you can cover "Buttons" in section 2.1, "Login Buttons" in section 2.1.1, and "Navigation Buttons" in section 2.1.2.

I plan to retrofit an old project with KSS in the next few days, firstly to get a better feel for it and secondly because I'm very curious if it helps me uncover an implicit object hierarchy which is already there in the code. I'll blog about it some more if I find out anything interesting.

Saturday, December 3, 2011

Four Books On Drumming

I got four books on drumming which I'm pretty excited about: two on fundamental skills and techniques, two on the specific types of music I'm most interested in. Stick Control seems to be a time-honored classic on snare drum rudiments, and Mastering The Tables Of Time had a terrific review:

the buzz is strong inside drum circles that this book is the "Stick Control" of the future, so I took the plunge and indeed, it was a revelation!

Meanwhile, Jungle/Drum & Bass For The Acoustic Drum Set addresses the specific rhythms of my favorite form of electronic music, and The Breakbeat Bible aims at a comprehensive overview of breakbeats, including hip-hop, soul, drum & bass, acid breaks, and even a chapter on dubstep. Both these books falter a little bit -- one of them calls Goldie "DJ Goldie" and the other calls him "Goldi" -- but both feature transcriptions of real, credible work from people like Caspa, Rusko, PFM and Origin Unknown.

Friday, December 2, 2011

Tech-Trance Track: Shifting Bells

I tweeted this when I first created it, on September 1st of this year, but I want to blog a few notes about it. A book by Mark Butler prompted me to put together an experiment in shifting grooves back and forth across the beat. The rest of the track formed around that experiment.

To explain, Butler's book (among others) explains how the juxtaposition of groove and meter forms a major element in techno. (In the precise sense of the term.) Say you have the same rhythm, which mechanically repeats a hundred times, but in some repetitions lands ahead of the beat, in some repetitions lands behind the beat, and in very few repetitions actually lands on the beat. Some techno works by taking repetitive elements like that, stacking them in layers, and then moving them back and forth across the beat at various speeds, so that although every groove repeats with inhuman mechanical precision, the aggregate groove composed of all the stacked layers never repeats itself exactly and the variations therein give the machine sounds an ultimately human feel.

Butler is a professor of music theory and his book's pretty deep. In this track, I actually only use that approach for one part, because I after I got started, I kind of got distracted and made something else out of it. I didn't achieve the textured forest of metric juxtapositions Butler describes in his book, but I like the way it sounds anyway. If you listen to the bells, they shift throughout the track both in terms of their texture and in terms of their timing.

Wednesday, November 30, 2011

Ruby DMX

This code can probably control this device over this wire.

Disco Invasion

via create digital motion

Monday, November 21, 2011

Exciting Control Surfaces via Create Digital Music



Imitation Is The Sincerest Form Of Flattery

This sure looks mighty familiar:

...because I created it first:

I created it in 2009. It got a mention on Mashable.

If you feel so inclined, please comment on the thread at Hacker News.

Sunday, November 20, 2011

Icelandic 99% Internet Revolution Exaggerated

The post I linked to a few days ago concerning Iceland's "jail the bankers" hero status contained numerous errors.

Saturday, November 19, 2011

Shepard Fairey Remixes His Own "Hope" Poster

Take The UC Davis Police Customer Satisfaction Survey!

Iceland Prosecutes Bankers, Drafts New Constitution On Internet, News Media Ignores Whole Thing

Update: Icelandic publication cites numerous errors in the story I linked to here.

Americans may remember that at the start of the 2008 financial crisis, Iceland literally went bankrupt. The reasons were mentioned only in passing, and since then, this little-known member of the European Union fell back into oblivion...

Five years of a pure neo-liberal regime had made Iceland, (population 320 thousand, no army), one of the richest countries in the world. In 2003 all the country’s banks were privatized... In 2003 Iceland’s debt was equal to 200 times its GNP, but in 2007, it was 900 percent. The 2008 world financial crisis was the coup de grace. The three main Icelandic banks, Landbanki, Kapthing and Glitnir, went belly up and were nationalized, while the Kroner lost 85% of its value with respect to the Euro. At the end of the year Iceland declared bankruptcy...

Protests and riots continued, eventually forcing the government to resign. Elections were brought forward to April 2009, resulting in a left-wing coalition which condemned the neoliberal economic system, but immediately gave in to its demands that Iceland pay off a total of three and a half million Euros. This required each Icelandic citizen to pay 100 Euros a month (or about $130) for fifteen years, at 5.5% interest, to pay off a debt incurred by private parties vis a vis other private parties. It was the straw that broke the reindeer’s back.

What happened next was extraordinary. The belief that citizens had to pay for the mistakes of a financial monopoly, that an entire nation must be taxed to pay off private debts was shattered... The Head of State, Olafur Ragnar Grimsson, refused to ratify the law that would have made Iceland’s citizens responsible for its bankers’ debts, and accepted calls for a referendum...

As Grimsson said: “We were told that if we refused the international community’s conditions, we would become the Cuba of the North. But if we had accepted, we would have become the Haiti of the North.”

In the March 2010 referendum, 93% voted against repayment of the debt... With the support of a furious citizenry, the government launched civil and penal investigations into those responsible for the financial crisis. Interpol put out an international arrest warrant for the ex-president of Kaupthing, Sigurdur Einarsson, as the other bankers implicated in the crash fled the country...

But Icelanders didn’t stop there: they decided to draft a new constitution that would free the country from the exaggerated power of international finance and virtual money... This document was not the work of a handful of politicians, but was written on the internet. The constituent’s meetings are streamed on-line, and citizens can send their comments and suggestions, witnessing the document as it takes shape.

Friday, November 18, 2011

Thought Experiment: Live Drumming Happycore

Here's a musical experiment which simply should not ever happen, and my plan for making it happen.

Happycore (aka UK hardcore) is a rave music subgenre which takes the cheesiest sounds of original late 80s / early 90s rave music and amps it up to around 200 beats per minute. It sounds like this:

It is easily the least respected form of music on earth.

What would it take to perform happycore live, using a digital drumset? This song would make a great example:

The first thing you need to do is reverse the usual layout of kick and snare. Digital drums allow you to connect any sample to any drum trigger. Here's a cheesy explanation from the 1980s, when the technology was first invented:

I think it's the technology which powered the synth sounds at the climax of this incredible classic drum solo by Neal Peart of Rush:

And I know it's the tech which enabled Rick Allen, drummer for Def Leppard, to remap a ton of drum sounds to various pedals after he lost his entire left arm in a street racing accident.

Allen sat down with some engineers and started to design a drum set to assist Allen's drumming... he could still play some drum rhythms with one hand, using his left foot (typically for hi-hat pedals in common drumsets), to play the snare drum... they designed an electronic kit Allen could play using only one arm.

As you can see, it worked out just fine:

Anyway, context over. Back to the thought experiment. Again, this is the song to copy, in live-drumming format:

I've chosen this song because it has no lyrics, only a vocal sample, which means recreating the samples would be a lot less work; and because, even for happycore, this is a track with no artistic merit at all. (You could argue that it's an ironic satire on the raver stereotype, but it'd be an uphill battle.) But taking the artistic aspect out of the equation makes it really easy to approach this as a purely technical exercise. Happycore might be cheesy and awful, but performing it live with MIDI drums is a real technical challenge, especially for a dude who just bought his drums maybe a week or two ago.

Step one, as I said, is to switch the usual mapping, where a kick pedal powers the bass drum (also known as a kick drum, for obvious reasons) and you hit the snare with your right hand. It's just easier the other way around, especially for me, as I'm working with a cheap drum kit which would probably fall over, or fall apart, if I hit the kick pedal four to the floor at 200 beats per minute.

Step two is to actually make an unusual "bass drum" sample. I think the bassline in this song only ever plays one note, and always plays it right after the bass drum. So you make your "bass drum" sample by actually recording a bass drum and a bass note which occurs an instant after the drum. You could throw the open hi-hat on top of that bass note for the same reason.

For the other drum sounds, you have two options. Your first option is to simply place samples on the other drums. You could put the main melody on a tom, the pad on a crash cymbal, etc., and go from there. The tricky part there is you'd have to get your drumming timing exactly right, because working with melodic elements as samples means cutting them up in very precise lengths.

Your other option is to cheat a little and set the non-percussion elements up in Ableton Live as loops, and then go into Ableton's MIDI mapping. Find out the MIDI note and channel for the bass drum sample on the actual snare drum, or at least, on the digital drum which is set up in the snare drum's traditional position. That is to say, figure out which MIDI note gets triggered, on which MIDI channel, when you hit the snare "drum." On my crappy V-Drums Lite setup, that's channel 10 and note 38. Then set Ableton Live to receive tap tempo on that MIDI channel and note number. (This is trivial to do; Ableton permits nearly any MIDI signal to control nearly any element of its interface.) Now every time you hit the snare to trigger the bass drum, you're also triggering tap tempo, which will keep your Ableton loops in synch with your drumming.

I should emphasize that this is a thought experiment, and I can't guarantee it's going to happen.

(Update: OK actually when I say happycore has no artistic merit at all, I'm kinda being a hipster dickhead. There's singing and melodies and substantial production skills involved.)

Thursday, November 17, 2011

Robot Journalism Will Be Here Very Soon

Now that cellphone cameras have turned every protester with a Twitter account or a YouTube channel into a potential multimedia journalist, police officers in several American cities appear to be having trouble distinguishing between activists and reporters.


All of which makes it a good time to report that a Polish firm called RoboKopter scored something of a coup last week when it demonstrated that its miniature flying drone was capable of recording spectacular aerial views of a chaotic protest in Warsaw.

I've been expecting this for a while. It's going to be an incredible pain in the ass here in Los Angeles, where paparazzi are a serious problem (frequent reckless driving in order to get pictures, etc). Kind of awesome in some other ways, though. The NYPD closed airspace above Occupy Wall Street, preventing news helicopters from capturing any footage; this was actually illegal, or at least improper, as NYPD has no airspace jurisdiction.

However, the real criticism should be reserved for journalists who complied with an invalid "order," specifically CBS. You have to wonder if that would have played out differently if any news organization with an interest in a story could get its hands on a thousand-dollar (or less) helicopter/camera robot. But you won't have to wonder long, because it's only a few years away.

Occupy Wall Street: Projected Light Graffiti

via jay smooth

HN Comment Thread Worth Reading

Well, worth skimming, at least. In response to a blog post on aysnchronous Web UIs by the creator of Spine and, years ago, Juggernaut. (Just as Spine is basically an alternate implementation of Backbone, Juggernaut was basically an alternate implementation of the Comet solution which DHH showed at Canada on Rails in 2006 but did not open source.)

Backbone creator Jeremy Ashkenas made the most worthwhile comment in my opinion:

Nice post. I'd like to briefly respond to the bit about the difference between Spine, which generates pseudo-GUIDs for models created on the client, later overwriting them if the server responds with a real id; and Backbone, which has a "cid" (client ID) for every model regardless of the canonical server ID.

The reason why Backbone provides a persistent client id for the duration of every application session is so that if you need to reference model ids in your generated HTML, you always have something to hang your hat on. If I have '<article data-cid="c530">' ... I can always look up that article, regardless of if the Ajax request to create it on the server has finished or not. With Spine's approach: '<article data-id="D6FD9261-A603-43F7-A1B2-5879E8C7926B">' ... I'm not sure if that id is a real one, or if it's temporary, and can't be used to communicate with the server.

Optimistically (asynchronously, in Alex's terms) doing client-side model logic is tricky enough in the first place, without having to worry about creating an association based off a model's temporary id. I think that having a clear line between a client-only ID and the model's canonical ID is a nice distinction to have.

Favorite links include a Spine on Rails demo video which has some nice convenience advantages over anything I've seen with Backbone (although I think Backbone is the way to go generally) and a set of pros and cons for Backbone which is insightful despite being slightly out of date.

Roland V-Drums (Lite) Triggering Korg iElectribe on iPad 2 via Alesis IO|Dock

Simple Demo

The Setup

Wednesday, November 16, 2011

Using Reason Fixes Roland V-Drums Lite Crappy Kick Pedal

Just a quick note, I picked up the cheapest Roland V-Drums unit out there. I want a fancier option and can afford it, but I have a kind of harsh rule about musical instruments, which is that you get the cheapest thing that can possibly work and upgrade only if you actually make good music with it. This is probably perverse of me, and has certainly had some nasty consequences with the V-Drums. The kick pedal is crappy beyond words and frequently makes the entire drum set shake, which results in misfires, but the whole reason I'm blogging about it at all is because the solution is easy. You use Reason for your drum sounds instead of the Roland "brain," which is pretty crappy. Just plug a MIDI cable into it and you're good. In Reason, it's really easy to set a velocity minimum on an individual sample in the NN-XT sampler. The purpose of this is velocity windows, and you'll use this if you want to play a different snare sample when you hit the drum hard versus when you hit the drum softly. (It's really an if, not a when.) But what's cool is the kick pedal misfires all occur at low velocity, so just set your kick sample velocity floor a little higher than normal, and you're good to go.

(Velocity windows are also a useful way to train yourself to accurately modulate how hard you hit the drum. Assign completely different sounds to the top end of the velocity range and the bottom. Then do triplets and make sure you get the high end sound on the 1 and the low end sound on the 2 and the 3.)

Tuesday, November 15, 2011

Beats And Peaces

The other day, a lot of people passed around The Entrepreneurial Generation, a New York Times story on entrepreneurialism as youth culture, but I had a hard time reading it. It starts out reasonably enough:

Ever since I moved three years ago to Portland, Ore., that hotbed of all things hipster, I’ve been trying to get a handle on today’s youth culture. The style is easy enough to describe — the skinny pants, the retro hats, the wall-to-wall tattoos. But style is superficial. The question is, what’s underneath? What idea of life? What stance with respect to the world?

But it all goes to shit as early as the fourth paragraph:

The punks were all about rage, their social program nihilistic anarchy. “Get pissed,” Johnny Rotten sang. “Destroy.” Hip-hop, punk’s younger brother, was all about rage and nihilism, too, at least until it turned to a vision of individual aggrandizement.

I couldn't disagree more.

Consider the book Bomb The Suburbs.

An angry, nihilistic title if you ever saw one, right? Except "bomb" means "paint" in graffiti parlance, the author, Upski, is a graffiti artist, and the main argument of his book is that artists in the city should expand their artistic purview into new cultural environments to prevent the de facto re-segregation of America. This is a book which blurs the line between hippie and hip-hop as well as De La Soul or Digable Planets did.

In Bomb The Suburbs, Upski tells how his friends from the toughest neighborhoods in Chicago feared a neighborhood even tougher, one he'd never even heard of. He asked his toughest friends about it, bone fide gun-toting thugs, and they told him not to go there ever, because it was a scary place, even to them. But he said to them, look, here I am, a white kid from the suburbs, hanging out in one of the most dangerous neighborhoods in Chicago, and all my suburb friends and family told me to never come here. So he ignores the advice of his tough-guy friends and goes to this legendary neighborhood, and finds the entire place given over to wilderness. He sees deer, and long grass grown tall enough to hide them, where buildings and sidewalks used to be, with the Chicago skyline visible all around in 360 degree panaroma. It's a stark moment of beauty and irony in a cheap self-published book which also contains throwaway remarks about the sheer number of people Upski met who told him that hip-hop had saved their lives.

Feast your eyes on the rage and nihilism on display here:

This is KRS-ONE telling the story of how using visualization helped him lift himself from homeless man to world-famous rapper.

"Right back here, in 1980, I was homeless. I was sleeping right here. You don't realize how real this show is to me right now... While everybody else was down on Flatbush Avenue... people were walking around here aimless, nothing to do. I was over at the Brooklyn Public Library, right there... I'm not saying this for any credit to me. I'm trying to tell the young ones here tonight, and some of the adults: every night before you go to sleep, see your future. See your future. Take five minutes before you go to sleep... I used to be in that band shell right there, me and a couple other guys, sleeping... I used to say, one day, we gonna rock this park... This is so crazy, because I'm in my dreams right now. You can't even imagine what I'm going through up here. Follow your purpose, even if it seems impossible. If you know what your purpose is, you know what the universe's purpose is for you. What seems impossible to everyone else will be possible be for you."

To quote the NYT article again:

Hip-hop, punk’s younger brother, was all about rage and nihilism, too, at least until it turned to a vision of individual aggrandizement.

I give the guy credit for remarking on the historical link between hip-hop and punk. That link is tiny, but interesting and often overlooked. Other than that, though, the man has no idea what he's talking about. Check out these lyrics from Jay-Z, written at a time when he absolutely had no need for more fame or glory in the world of hip-hop:

I do this for my culture
To show them what a nigga looks like
When a nigga in a Rollster

A "Rollster" is a Rolls-Royce. The video shows pictures of smiling black children when he says these words. A translation:

I do this for my people
Including, for instance, these children I am showing you right now
To show them what a black person looks like
When a black person's in a Rolls-Royce

Rage, nihilism, and personal aggrandizement? Really? Nothing else in the equation there?

The Entrepreneurial Generation gets even worse in the next paragraph:

As for the slackers of the late ’80s and early ’90s (Generation X, grunge music, the fiction of David Foster Wallace), their affect ran to apathy and angst, a sense of aimlessness and pointlessness. Whatever. That they had no social vision was precisely what their social vision was: a defensive withdrawal from all commitment as inherently phony.

Reminds me of some hip-hop, namely "Sure Shot" by the Beastie Boys:

You say I'm twenty-something and I should be slacking
But I'm working harder than ever and you can call it macking

That was Mike D calling bullshit on the "slacker" meme when it was current. How something like that even survived to 2011 is a mystery, but I think you get my point. Anybody who sets out to investigate something they call "youth culture" by skipping past Jay-Z with some brisk, dismissive condescension, but approaching David Foster Wallace as gospel, is not going to be a reliable source of information. Our unreliable source of information shares with us that he used to teach at Yale, which is a great school but also the same place which graduated George W. Bush -- making it an unreliable source of graduates -- and proceeds to pontificate:

Today’s ideal social form is not the commune or the movement or even the individual creator as such; it’s the small business. Every artistic or moral aspiration -- music, food, good works, what have you -- is expressed in those terms...

Forty years ago, even 20 years ago, a young person’s first thought, or even second or third thought, was certainly not to start a business. That was selling out — an idea that has rather tellingly disappeared from our vocabulary. Where did it come from, this change? Less Reaganism, as a former student suggested to me, than Clintonism — the heroic age of dot-com entrepreneurship that emerged during the Millennials’ childhood and youth. Add a distrust of large organizations, including government, as well as the sense, a legacy of the last decade, that it’s every man for himself.

Because this isn’t only them. The small business is the idealized social form of our time. Our culture hero is not the artist or reformer, not the saint or scientist, but the entrepreneur. (Think of Steve Jobs, our new deity.) Autonomy, adventure, imagination: entrepreneurship comprehends all this and more for us. The characteristic art form of our age may be the business plan.

Let's get this straight. Occupy Wall Street is happening right now in New York. The authorities decided to shut it down at 2am on a Monday night with no press allowed anywhere near the event. And The New York Times brings us an article about how the only thing that young people think is cool any more is starting a business, how they all distrust the government, and how they all feel that it's every man for himself.


Our Yale professor rambles on:

unlike those of previous youth cultures, the hipster ethos contains no element of rebellion, rejection or dissent


Tear gas at Occupy Oakland.

There's something to this article, in that entrepreneurship can be a very positive force, and it is at least accurate that young people respect entrepreneurs today more than young people did in the 1960s. Other than that, however, the stink of horseshit on this one is so strong it could incinerate every last little hair in your nostrils from six miles away.

One assumption this guy never exposes to analysis: only one youth culture exists at a time. But before we question that one, let's get to the more basic assumption: youth cultures exist. What the fuck is a youth culture? Does anybody, besides magazine writers, seriously believe that Nirvana led a generation anywhere, or spoke for every person of a certain age range, whether black or white, gay or straight, conservative or liberal, rich or poor? The unfathomable diversity and complexity of a group made up of every single American born from X Year to Y Year, from the woods of Maine to the deserts of Arizona, is a lot to pin on the shoulders of a reasonably good band that made one strong album. I suspect the term "youth culture" is a myth journalists tell us about the Sixties, a phrase cooked up in the aftermath of that hectic decade to explain away its strident politics, because everything I can recall people using the term "youth culture" to describe was, in my opinion, a subculture organized around music and fashion, not age group. When I was a raver, one of my DJ friends was forty years old. In 2011, hippies still exist.

And they are gooooooooood-looking.

Thursday, November 10, 2011

Why I Can't Rant About Hacker News As Much As I Used To

The other day I disappointed myself by writing about some bullshit I read on Hacker News. Then I disappointed Peter Cooper by tweeting that I had ranted about bullshit I read on Hacker News. Apparently Peter had hoped for a rant about BS on HN in general, and felt let down when he discovered a rant which only addressed what was, in perspective, only one tiny sliver out of the vast range of available bullshit on Hacker News to rant about.

My heart goes out to Peter. The disappointment was undoubtedly shattering. I imagine it must have been like being invited to tour the universe and seeing only one single meteor. So I would truly be thrilled if I could now present a gigantic, frothing rant about all the inanity and uselessness on Hacker News, but I can't. I just don't have it in me.

Today I saw an artwork on eBay. I own a version of this artwork, and the asking price was $30,000. I checked into it and saw it had sold at auction at Christie's of London for £16,000, and I became very excited until I realized that the artwork on auction, both at Christie's and on eBay, was actually a much rarer edition of the artwork I own, which meant that the artwork I actually own is not worth $30,000, and probably not even close to it. However, I take it as a good sign for my art investment skills, especially since I had a similar experience a couple years ago, when a piece I had nearly bought for $350 five years earlier reached a going price of $18,000.

Why is this relevant? Because if I had bought the rarer edition of the artwork I saw today, or the $350 piece back when it was $350, I would have seen an absolutely incredible profit, better percentage-wise than most Y Combinator companies; and buying art is frankly a more interesting way to earn that profit than what most Y Combinator companies do; and nothing on Hacker News would have taught me a thing about it.

In 2010 I launched a bunch of mini-business experiments, mostly for the hell of it, and rapidly became an independent entrepreneur. Although these businesses later faltered, and I had to return to coding for hire, all that horseshit on Hacker News about how incredibly difficult it is to launch a successful business proved utterly false. In fact, the only reason my businesses petered out is that they were so absurdly easy that I got cocky, and bored, and went off to a California doctor to get a medical marijuana card. Then I lost track of time, and then I was like, "oh crap, I guess I have to work again."

The lesson here: a good content business will succeed unless you get stoned and stay stoned for weeks. Did you need Hacker News to figure that out? I admit to feeling like a complete idiot about it, but it wouldn't get any upvotes, and it wouldn't prompt any comments, because it's obvious as fuck.

Another thing which is obvious as fuck is that there are a lot of ways to make money on the Internet that don't require struggling, or being nervous, or pitching to venture capitalists, or hoping that Paul Graham will like you enough to give you some money, or even learning anything new or cutting-edge or otherwise geek-glamorous. Like any other magazine, there's a whole identity that Hacker News caters to and indeed sells. Hacker News, and the majority of its audience, is more concerned with defining, reinforcing, and most of all selling that identity than it is with any topic which is actually relevant to entrepreneurs on the Internet.

Consider the recent debate about swearing, which I am embarrassed to admit I weighed in on. This is basically GQ for Silicon Valley; let's have a lengthy discussion on etiquette in the greater tech community. It reminds me of a scene in the terrific, lunatic action comic Cowboy Ninja Viking, where the title character -- who suffers from an unusually badass case of multiple personality disorder -- asks a friend for a favor, offering his undying gratitude in return, and his friend asks, in reference to said aforementioned undying gratitude: "Can I fuck that?" and then asks for a girl's phone number instead.

You can't have sexual intercourse with an abstract concept, and in the same way, nobody's ever going to make a fucking penny arguing over whether or not some dude swears too much, too little, or just the right amount, like Goldilocks And The Three Fucking Bears, because there's no money there. It's just horseshit. It has no useful purpose at all -- unless you're in need of an identity, and you want to buy what Hacker News is selling. In that case, you might want to read about etiquette, just like you would in GQ or Esquire or Cosmofuckingpolitan. "How should I talk? What clothes should I wear?"

But even then, it's a stretch, because the person who raised the issue, Scott Hanselman, is a guy who works for a huge corporation, has a conventional-minded cubicle farm audience, promotes languages which are mediocre at best, and has fuck all to do with entrepreneurship, startups, or cutting-edge technology. If Hacker News were about what Hacker News claims to be about, Scott Fucking Hanselman would never even read it. He wouldn't even know it exists.

The identity Hacker News sells is at best only relevant to part of my life, because I'm also an actor and a musician. My dream in terms of acting technique is to be able to treat identity like a set of clothes. I'm also a pretty damn well-trained hypnotist, and from time to time I even think of starting up a hypnosis business. This is relevant A) because the hypnotist perspective on identity is that identity is a construct you can rebuild at any time and B) because it's a completely valid alternate route to financial independence. Because I believe in doing my homework, I've read The Millionaire Next Door, and I know that all of the material goals of the VC startup entrepreneur can be reached much more reliably owning a simple, conventional business. I've also read Dan Kennedy, so I know how to launch an information business from scratch.

So Hacker News is only useful for me insofar as it gives me useful information about new technology and building a business, but I can only use it as a source of information on either of those topics with the help of serious automated filtering. My Hacker Newspaper mashup is much faster and more legible than the real HN site. It obscures HN's frequently inane comment threads, automatically shitcans any and all links to TechCrunch or Zed Shaw, and prioritizes links typographically, which makes it a nice power tool for highly opinionated scanning. I also use dotjs for a secondary level of legibility fixes for the rare occasions when I do read a Hacker News comment thread. Even with all that customization, Hacker News really makes me work for the very few, very rare fantastic reads that it does occasionally yield up.

I get much, much better tech news from Twitter, and as for entrepreneurial info, Hacker News is about making money and being an entrepreneur in the same way that Ayn Rand's novels are about making money and being an entrepreneur -- in the sense that they both use that outward subject matter to launch almost entirely unrelated discussions. Nobody who plans to build a real business with real profit potential ever needs to give a fuck at any point in their lives, ever, about whether Google is going to win its "war" with Facebook, or vice versa, or Apple's "war" with Android, or whichever other imaginary game of "my dad could beat up your dad" these idiots happen to be playing on any particular day. You have to be pretty blind to psychology not to see what's going on with all these very young guys on Hacker News. They're fresh out of college -- a few of them are still in high school -- and they want VC funding and Paul Graham's attention because they think success is all about winning the approval of an older male mentor who's got more wealth and prestige.

It's for boys, not men.

And I can't rant about the signal/noise ratio, either, because the signal/noise ratio problem for Hacker News, Digg, Reddit, etc., is in my very firm opinion a solved problem of behavioral economics. The answer is simple: those sites will always decay and inevitably suck. The "karma" economies they create systematically grant upvote "wealth" to people who do nothing but waste time on those sites, and the non-competitive nature of these "karma" economics means that there is no way to leverage wisdom-of-crowd effects, which means that you get groupthink instead. Hacker News is guaranteed to suck ass in the same way that computer hardware performance is guaranteed to continue improving, and for the same fundamental reasons. If you don't understand my argument that sites based on "karma" economies are doomed to signal/noise ratio degradation, then you need to read James Surowiecki and Dan Ariely and then click that giant link I just made of almost the entire preceding paragraph.

I suppose I have managed to get some good ranting in after all, but the only real problem with Hacker News is my habit of reading it. I could in fact solve that problem for myself entirely just by killing my mashup -- I just can't handle the site without it -- but I get periodic tweets and emails from people who use it too, so I'm kind of proud of it, and it's nice to have users who like what you've built.

I know that it's much, much easier to replace a habit than to break it, so I put some work into building a Twitter Newspaper to replace Hacker Newspaper for myself, but I dropped the project because I got bored of it. I may return to that project, but I can't guarantee it. Hacker News is still useful enough for now, and I've got a bunch of other things I want to do.

Wednesday, November 9, 2011

Drums And Ideas

Got a drum set recently. Just a little one. Been watching a lot of videos on YouTube to get some ideas.

Tuesday, November 8, 2011

Fuck These Idiots

A Microsoft employee named Scott Hanselman recently took up the gauntlet of an issue the Rails community settled in 2006:

I was perusing the Interwebs yesterday and stumbled on a new article from Zach Holman called Don't Give Your Users Shit Work. I was a little taken aback by the swear word in the title. I clicked around Zach's site, and found his Talks area and clicked on A Documentation Talk and the second slide dropped the F-bomb. Wow, really? I said to myself, is this how to connect with someone who is trying to learn about a technology?


There's hundreds of thousands of perfectly cromulent words to use that aren't the Seven Dirty Words. Or even just the two words that evoke scatology or copulation. At least use some colorful metaphors or create a new turn of phrase. Shakespeare managed, thou frothy tickle-brained popinjay. Zounds.

When you hear that a Microsoft employee was telling DHH and a GitHub employee how they should talk, you might laugh it off with a thought like "fuck that shit." But let me expound a little further. Scott Hanselman's employment status with Microsoft doesn't just invalidate his opinion because I fucking hate Microsoft. Scott Hanselman's employment status with Microsoft also invalidates his opinion because that employer of his is very relevant.

The more likely your users are to say "fuck this shit" when confronted with the products of your effort, the less likely you are to want to hear the words "fuck" or "shit." How many Microsoft endeavors can you think of for which "fuck this shit" is the only appropriate response?

For instance, fuck this shit.

Pretty much everything Microsoft has ever done, with the exception of the XBox, has been awful. Even Bill Gates's charitable efforts may be doing more harm than good. Is it really a surprise that a guy objects to hearing words like "horseshit" when he works for the single largest and most productive horseshit factory in the history of the world?

I'm ashamed of myself for spending time on this nonsense, but I just want to point out two things: first, I put this in draft mode with no expectation of ever finishing it, because I figured I would find better things to do. Second, I didn't find anything better to do, but that's because I've got a terrible cold right now, and my brain shuts down when that happens, rendering it useless for anything except the most trivial tasks, such as tying my shoelaces and spotting bullshit on Hacker News -- where Rob Conery came at the same topic with a very, very minor variation.

According to this guy:

Zach's heard a lot about his slides. I've been thinking a lot about writing this post but as with most things, Hanselman beat me to it. It might look like I'm "piling on" - but my take is different than Scott's. I'm not opposed out of principle, I just think Zach is more talented - A whole lot more talented. It's a bit of a shame to resort to Grunting Monkey Tricks when you're clearly a whole lot more clever...

However, his take is not all that different. Scott Hanselman gives Zach Holman plenty of credit for his intelligence, and does it without the cloying, paternalistic tone here.

Conery continues:

I'm not offended at the presence of the F-bomb, I'm offended that someone with his talent takes the easy way out.

Making your point with profanity is what the general population uses as punctuation to emphasize a point. It's conversational punctual shorthand.

Obviously, there is nothing either punctual or tardy about the conversational shorthand here -- that's just garden-variety incoherence -- and you might interpret Conery's use of the term "general population" to indicate an aversion to gutter speech, the unworthy dialect of the unwashed masses and the filthy poors, but the undisguised and unrepentant upper-class bias comes from a throwaway remark. His main point is that profanity offers an "easy way out." He imagines Holman's goal to be shock.

You know you need to hit it within the first 3 slides. But how? This isn't Terminator and there's no dramatic music behind your slides (though yes, I did that once... but it was at the end). How do you pull this off?

Your skill as a presenter and story-teller are now under serious strain. You're prepping your talk - do you take a chance? A Risk? Do you GO BIG? Or play it safe?

I know! I'll make my point, and insert the word "Fuck" somewhere!

Conery continues throughout his post playing the role of Good Dad, assuring Little Baby Zach that he doesn't need to swear at people to impress them.

The problem with his pitiful logic is that only people who are shocked by profanity ever assume that somebody who uses profanity is doing it for shock value.

There are in fact other ways to use profanity. One way in which people use profanity is as an indicator that nothing is going to be censored, which implies that people are going to be up-front and honest. That's actually an excellent tone to establish in a presentation.

This guy is projecting, and he continues with it later on:

A Good Presentation Is Hard

If you've never given one, well you will at some point. Nerves tighten your throat and your voice raises an octave or two, you fight to maintain good posture so your breath comes evenly and you don't hyperventilate. You struggle to make eye-contact and, as you try to remember all of these tips you forget what you're trying to say.

What happens to his argument if Zach wasn't nervous? It disappears. I'm not even saying the guy wasn't nervous. Who knows? But I want to point out that this argument completely collapses without that assumption, and Conery's done nothing to shore it up. I don't mind seeing an argument built around an assumption as long as the assumption is acknowledged, but he should have investigated the assumption, or sought some proof of its accuracy. All we know for a fact here is that he got scared at least once and he thinks everybody else does too, every single time.

The next bit deserves just a moment of rebuttal:

It's flat obvious when watching someone who's thrown, and it's uncomfortable. It moves into "sad" territory when the speaker resorts to gimmicks like inserting cat pictures, LOL-speak, and yes, F-bombs. It's sad because we've seen it before and you're better than that.

Yep, "you're better than that."

Here's an Internet meme pic. Is it here because I'm afraid of what my readers will do unless they see an Internet meme? Or does it serve as ironic juxtaposition against a tone of disappointed authority which would be creepy were it not flat-out silly? Seriously, where does this guy's unexplained and probably undeserved tone of authority come from? How does he know what Zach Holman is or is not capable of? Does he know something about this guy which we don't? Does he have spy cameras in his home or something?

Does this picture distract you from my argument, or hammer it home? That picture isn't distracting. This picture is distracting:

But that Yoda picture is completely legit. And so is Holman's swearing.

The phrase "Don't make your users do shit work" emphasizes the fact that shit work is not work people enjoy. I don't know what Rob Conery does for a living, but I know for a fact that Scott Hanselman works for Microsoft, and nobody who works for Microsoft has heard the words "Don't make your users do shit work" often enough, or had the unpleasantness of that shit work emphasized enough. Zach Holman's swearing was not a shock-factor distraction, but a completely valid emphasis used by a grown man who is old enough to choose his own words and probably doesn't need a fake Internet daddy telling him he can do better. The fact that all these Internet dipshits are trying to tell him what to say is just ridiculous.

He probably doesn't need me to defend him, either, and hell, even if he did, he's not paying me. I want to emphasize again that the only reason I even got into this conversation was because I've got a terrible cold and my brain's running too slowly to be any use for real thought. But destroying Rob Conery's weak logic does not take a great deal of thought, and it's marginally more entertaining than downloading bad spy movies I don't have the attention span for right now anyway.

Anyway, Hanselman's argument amounts to a cost/benefit analysis:

swearing decreases your reach and offers little benefit in return. Swearing is guaranteed to reduce the size of your potential audience.... you take no chances of offending by not swearing, but you guarantee to offend someone if you do.

It's a valid point, but it's only an important point if your aim is quantity over quality. You don't necessarily want everybody in the world to read your blog. Some people are idiots. And Conery's argument, frankly, consists of nothing more than calling Zach Holman a pussy. I would much rather read a guy who swears while delivering a message about not being a dick -- for instance, "don't give your users shit work" -- than one who uses polite language to say something which is not only rude but completely illogical (for instance, "Zach Holman swears in his presentations because he's too pussy to get through stage fright any other way, and this somehow pertains to his use of the word 'shit' in a blog post title somehow even though stage fright is not relevant in that context oh shit that made no sense I better make some condescending noises about Zach being better than this").

These guys are full of shit.

Sunday, November 6, 2011

Peaceful Photographer Dude Suddenly Shot

While filming a police line at Occupy Oakland after midnight on Nov. 3 following the Nov. 2 general strike, an officer opens fire and shoots me with a rubber bullet. I was standing well back. There was no violence or confrontations of any kind underway. At 0:31 seconds you can see a tall officer in the front raise his weapon and then fire. This is the full clip of the incident.

Kitty City And Hydraulic Spiderbots

(via boing boing)

Friday, November 4, 2011

Ticket Available For Keeping It Realtime

Way too sick to travel. Email me if you want it.

Looks like a great conf.

Friday, October 28, 2011

Upgrade from password gem to 1password

In 2008 I wrote a password gem, but today I use 1password, so I wrote a simple 1password importer shell script.

Monday, October 24, 2011

Silicon Valley Human Rights Conference

Unfortunately I only just found out about this, but I'm really pleased to hear it exists.

Environmentalists Knit Sweaters For Penguins

After a catastrophic New Zealand oil spill started killing a terrible number of blue penguins, activists responded with ludicrous style and aplomb.

Saturday, October 22, 2011

Two Notes About Game Of Thrones

I've been reading the Song Of Ice And Fire series. It's so grim, brutal, and full of sex (occasionally for erotic effect, but usually for shock and horror) that it reminds me of Caligula, but unlike Caligula I'm enjoying the story. Two brief notes about the series:

First, I'd bet a lot of money its author, George RR Martin, read the Assassin series by Robin Hobb. Both feature a scheming queen unworthy of her king, whose violent, psychopathic, sadistic child becomes the next king, despite having no valid claim to the kingship. Both feature zombies and Vikings, and the ruins of a much greater ancient empire. Hobb's series takes place in a land called the Five Duchies; Martin's setting is called the Seven Kingdoms. Each series features protagonists who share a psychic bond with a wolf, and dragons who, in times past, fought in service to the king, but have since disappeared from the world. Both series give attention to the role of bastards in the medieval-like societies of their settings. Both series have castles filled with secret passageways, unsavory characters who lurk in those passages doing terrible things for the good of their respective kingdoms -- or for their own advantage -- and marriages of political expediency.

In short, I think Martin read Hobb's series and decided to do his own version.

This is not such a bad thing. I sometimes think the same thing about the relationship between Inception and The Matrix -- that maybe Christopher Nolan saw The Matrix and decided to make his own artistic answer to it. In fact I like to think of Inception as the sequel that The Matrix always deserved but never got.

One reason I think this whole phenomenon of an artistic answer to a previous work is totally cool is because Martin's remake expands on the scope of Hobb's original to a degree which is so extraordinarily detailed, and realized in such depth and detail, that it makes JRR Tolkien look like a lazy stoner who never did his homework. Which brings me to the second note. If somebody came to me and said, "I need to learn Rails, what should I do?", I would tell them that they could do worse than to build an application which allowed the user to document the world of A Song Of Ice And Fire.

The series keeps track of a staggering number of noble families, each with very detailed family trees. Each family has its own heraldry, castles, counties, warriors both noble and common, and feuds both recent and ancient. Every member of those families has their own distinct characteristics, including sexual history, style of clothing, favorite food, names, nicknames, and distinct reputations at local, regional, and in some cases even global levels. Regions have gods, customs, dialects, and even hairstyles, for fuck's sake. It came to me that developing a plain vanilla Rails app to track all that shit would be a great exercise in object-oriented design when I asked myself what George RR Martin's writing space must look like. I hope it features outlines, graphs, timelines, maps, and family trees all over every wall, but the thought that terrifies me is that maybe, just maybe, he keeps the whole damn thing in his head.

Friday, October 21, 2011

Code And Beats: NYC Party

Enigmatic web site says only:

A handful of hardcore coders from the city's hottest startups will work in the center of a pounding dance floor to a musical journey of electro beats.

Jasmine-Node: Identify Failing Spec

I love jasmine-node for command-line JavaScript specs, but there's one thing I hate about it: its failure messages. The usual error output is complete line noise. No indication what spec failed, no indication of even which file the spec which failed lives in. Here's how you find that out.

I'm going to set this up as a command-line option and send a pull request later, assuming I remember, but for now, open up node_modules/jasmine-node/lib/jasmine-node/index.js. Add one line right here:

Edit: yeah, ok, fuck. Actually that didn't work. You can at least run it file-by-file, using bash and the -m command-line flag, but the regex in -m is pretty freaking primitive and literal. For instance, to run individually, I just did:

node_modules/jasmine-node/bin/jasmine-node -m foo_ --coffee spec/javascripts/node/

That underscore in foo_ is not a typo!

If you don't see a followup blog post where I explain how I fixed this, please bug me about it on Twitter. It's a good project and these are easy fixes. By the way, the reason I have spec/javascripts/node is because I also have spec/javascripts/browser. Although I like jsdom, for Backbone views, I'm running regular Jasmine in the browser, because browsers are notoriously twitchy.

Side Projects: The Lamborghini Miura

This is (or maybe was) DHH's Lamborghini (photo by symmetricalism).

Most Rails developers know DHH extracted Rails from an application he was building. It may even have been a side project. What many people do not know is the core design of DHH's Lamborghini started as a side project too, about 40 years ago.

From the September issue of Robb Report:

The Miura, the first viable mid-engine sports car, might be Lamborghini's most celebrated model, for both its mechanical and aesthetic attributes, but company founder Ferruccio Lamborghini did not initially champion the automobile. Knowing that their boss planned for the then newly-formed marque to produce refined grand tourers instead of race-ready sports cars, the engineers initially developed what would become the Miura in their spare time.

Wikipedia has more:

The car is widely considered to have begun the trend of high performance, two-seater, mid-engined sports cars. At launch, it was the fastest production road car available.

The Miura was originally conceived by Lamborghini's engineering team, who designed the car in their spare time against the wishes of company founder Ferruccio Lamborghini, who showed a preference towards producing powerful yet sedate grand touring cars, rather than the racecar-derived machines produced by local rival Ferrari. When its rolling chassis was presented at the 1965 Turin auto show, and the prototype P400 debuted at the 1966 Geneva show, the car received a stellar reception from showgoers and motoring press alike, who were impressed by Marcelo Gandini's sleek styling as well as the car's revolutionary design.


During 1965, Lamborghini's three top engineers, Gian Paolo Dallara, Paolo Stanzani, and Bob Wallace put their own time into the development of a prototype car known as the P400. The engineers envisioned a road car with racing pedigree; a car which could win on the track and be driven on the road by enthusiasts. The three men worked on the car's design at night, hoping to sway Lamborghini from the opinion that such a vehicle would be too expensive and would distract from the company's focus. When finally brought aboard, Lamborghini allowed his engineers to go ahead, deciding that the P400 was a potential marketing tool, if nothing more.

The Robb Report story also mentions that the Miura featured brilliant and original engineering. It debuted:

at the 1965 Turin auto show. Though the car lacked a body, showgoers still placed orders for it.

Sunday, October 2, 2011

I Had A Problem And I Decided To Use Regular Expressions...

Now I have zero problems, because I'm not an idiot.

Seriously, regex is its own category of programming language. It's worth learning but like anything else you do have to learn it in order to use it. The problem most people have with regular expressions is not that regexes are in any way more difficult or strange than any other type of programming problem, but simply that most people do not bother to do their homework.

So do your fucking homework.

Monday, September 26, 2011

A Point Of Order

An interesting thing about HTML5 veers off its rails quite quickly:

Speaking of the 90s, Brett McLaughlin says:

Back in the ancient days, when electronica was cool and not called "house music"

First, the term "house music" predates the term "electronica" by over a decade, much nearer to two decades.

Second, the term "electronica" was never cool. MTV and Spin magazine invented it; it never had anything to do with where the music came from.

I hope this guy knows more about HTML5 than he does about music, but I'm not finishing his post.

Sunday, September 4, 2011

Madison RubyConf In A Nutshell

People have asked me if Madison RubyConf was a good conference. This is easy to answer.

I am wearing a penguin.

It is a stolen penguin.

In addition to stealing and wearing a penguin, I heard great talks, I enjoyed giving my own talk, I learned a bunch, Rob Sanheim schooled me with his DJ skills, I got a ton of awesome research material for my music projects from Randall Thomas of EngineYard -- who's done some awesome music hacking of his own, and has the background to actually understand the stats end of AI and machine learning, where I kinda flounder and make shit up -- and everyone had a great time.

I would say the only downside was the clever restaurant employee who stole my penguin back when I wasn't looking. I'll give her credit, though, because I never even saw her coming. I don't know if she just had a natural talent for it, or if she developed the skills because people steal those penguins all the time, but she was like a penguin repo man ninja.

Sunday, August 28, 2011

A Question For Serious Sci-Fi

I've found sci-fi pretty dull since William Gibson stopped writing any. Gibson took the point of view that things were changing so quickly that near-term sci-fi goes out of date before it's published, and far-term sci-fi lacks sufficient constraints to ever hope for relevance, context, or predictive accuracy. I'm paraphrasing, and may be putting words in Gibson's mouth, but this is at least my general impression of his reasons; and I've seen similar concerns voiced elsewhere.

Anyway, I recently read Sex At Dawn, an examination of sex from the standpoint of evolutionary biology, and vice versa, which revisits, revises, and categorically obliterates the usual stereotypes of human sexuality as understood from the standpoint of evolutionary biology, and in the process completely discredits the pickup artist clichés of alpha males and "displaying higher value." From the standpoint of evolutionary biology, monogamy and marriage are very recent and unusual phenomena which run counter to the fundamentals of human sexuality.

This is a great question for science fiction to take on. There are at least two very interesting interpretations, both potential goldmines of controversy. Monogamous marriage developed alongside agriculture as a way to manage the effects of reproduction on economies. The first controversial interpretation is that monogamy is a destructive maladaptation, like agriculturally derived diets. The second controversial interpretation is that monogamy is a powerful technology which, in supporting the economics of the agricultural era, enabled humans to take over the world and become the planet's dominant species.

Obviously, both interpretations may be correct, and yet one brands monogamy a harmful thing, while the other names it a hero.

The non-monogamous mating patterns of tribal hunter-gatherer societies also pose very interesting questions because of the Snow Crash prediction that post-industrial society fragments and becomes tribal. If such a process is already underway, one would expect some decay in the institutions of monogamy in the world today, and of course anecdotal evidence for this is easy to find, most obviously in the history of the 1960s and 1970s and the very high divorce rate.

However, it seems overbold to call post-industrial society truly tribal, as it is not and will not be possible without education, technology, and many other systems not native to the tribal model and probably not sustainable under it. Therefore you have this very interesting dynamic of society becoming more tribal-ish but never really tribal per se, and this interesting conflict of monogamy the destructive maladaptation versus monogamy the world-changing innovation. The potential for controversy, complication, and pure human drama here is absolutely immense, as you already know if you've ever made the immensely time-consuming mistake of asking a polyamorist to describe their relationships in detail.

Saturday, August 27, 2011

TDD In JavaScript: No Excuses

Madison RubyConf was awesome, but listening to the testing panel outraged me beyond words. I frothed at the mouth and nearly had an aneurysm right there in my chair. It sent me loony in the noggin and left me wondering how many guys on that panel were huffing glue right before they got on stage. Somebody said that testing was an insurance policy, and this madness went uncorrected - despite the fact that test-driven DESIGN is obviously about design - and when the subject of testing JavaScript came up, the consensus was NOT TO FREAKING DO IT.

Names will go un-named to protect the guilty, but I later cornered one of these lunatic miscreants on a rooftop while inebriated, and I have to give him credit, because the distinguished if utterly mistaken gentleman handled my vehement, drunken correction with grace and aplomb. So kudos there.

Nonetheless, if you're not writing your JavaScript TDD, you're out of your fucking mind. It's just so fucking EASY, and it's such a quirky language with so many pitfalls. Writing JavaScript without tests is like having sex without a condom, except worse, because it's the wiggiest language out there, and it can turn on you at any second, so it's more like having sex with a rabid orangutang without a condom during the act or a taser to subdue it afterwards so you can make your escape. Look, just write fucking tests when you write fucking JavaScript, OK? Seriously, what the fuck.

Here's a quick video showing how easy it is. The video uses CoffeeScript but everything in it translates very, very easily and directly into JavaScript; all you do is add punctuation. By the way, I wrote a lot of the code and the tests in this video while sitting in the audience of this testing talk. It's so easy you can do it without even fully paying attention to it because you're also busy listening to somebody tell you how allegedly impossible it is.

Aneurysms aside, Madison RubyConf really was one of the best conferences I've been to. I definitely recommend checking it out.

Update: Bryan Liles was on the testing panel, and he reminded me on Twitter that he did in fact say to test JavaScript.

Thursday, August 25, 2011

Time Management Videos Relaunch Delayed

Yes, it's funny - like when a psychic cancels an event "due to unforseen circumstances." But I'm delaying the relaunch of my time management videos, because I came down with a pretty nasty cold after Madison RubyConf and have been sleeping it off ever since. More news soon, I hope.

Wednesday, August 17, 2011

50 For 50

It's her 50th birthday, so Colleen Wainwright is raising $50,000 for her favorite charity.

I've donated - you should too! Colleen gave me a terrific interview for my short-lived podcast Hollywood Grit.

Video Download Setup Semi-Fixed

Been getting emails from people trying to buy my resumés video. The buying segment is fixed here. The download segment I'm handling manually for now.

Sorry for any inconvenience! Unexpected demand is a good problem to have, but I probably won't have time to fix this fully until next week, after I get back from Madison RubyConf.

Tuesday, August 16, 2011

Programmer Resumes Video: Fantastic Testimonial

Giles - had to shoot you an email because your resume video helped me in a big, big way. I recently landed a dream Ruby job (with an amazing startup) as a direct result of what you taught me in your video. I doubt my old resume would have even made it past the screener.

Before your video, I blasted my resume out everywhere and it was ignored with great vigor - in spite of my strong skill set. (Your skills don't mean jack if you can't get people to read your resume.)

Of course, I was doing it the way we're all taught: just list your jobs and education, then sprinkle some "power verbs" on top. FAIL.

As I discovered, there is only one "insider's way" to do a tech resume...but lots of so-very-wrong noob ways that don't work. All the stuff you read in books is outdated or wrong for our industry. I know because I wasted a lot of time with them.

Once I learned the "what goes first / what goes last" in your resume video, the door really blew open for me. Same skills, one little tweak and everything changed. Now instead of me doing all the I'm the one pursued. (I joke with my wife that sending out my new resume is "chumming the water".) Soooo sweet to get responses back within the hour. And they all say the same thing: "Chris, your resume looks great. When can we get you in to talk?"

Only one criticism: It would be better if you chunked the content into quick chapters, instead of one long video. You covered a lot of ground and it might make it easier to absorb. But that's minor. Point is, your information really works. Not ten years ago, not in theory. It works now.

So, thanks!

Chris Whamond

PS - I was really skeptical when I ordered this video. So if you are someone considering it, think about this: If Giles' video helps launch you into a better career making more money with greater job satisfaction...what's that worth to you over the next year? Or over the next five or ten years? The return on your investment here could be huge.

For sale individually and as part of a bundle.

Monday, August 15, 2011

Historical Intriguification

Tuesday, August 9, 2011

Multi-Track Rails Music App via SoundCloud API

Sessian allows you to use your browser like a mixer, with an important caveat: the tracks can only be soloed or muted, not volume-adjusted, as far as I can tell. Still, turning your web browser into a primitive mixer is a neat accomplishment and a sign of things to come. The developer, Chris Whamond, goes into a little detail on his site.

Before coming to Rails, Chris also did a bunch of interesting direct marketing work, and was kind enough to do an interview with me last year, which is unfortunately sort of trapped on a semi-fragile hard drive. I'm going to upgrade my old box to an SSD drive, maybe two, and I'm hoping to blog Chris's interview once I get things cleaned up a bit.

Sunday, August 7, 2011

Browser Exclusivity

Here's something I've never seen anybody do, but I imagine it would work: sell refusal to support IE6 not as a technical decision but as a marketing one - a mark of exclusivity.

Consider this solid-gold iPhone case:

It sells for $100,000. A cheap plastic case probably does a better job of protecting your iPhone. But a cheap plastic case does a much worse job of broadcasting your wealth to everybody around you, which is what this iPhone case is for.

Telling regular people to upgrade their browser is like saying they need to manually modify what they consider to be the dangerous, mystical internals of their computer. Most people don't upgrade, they just buy new machines. But if you say, look, your computer has to be at least this new to use our web site, you're speaking in a language of money, class, and social status, which is a language everybody understands.

I'm absolutely not saying this is the way things should be, but anything which gets web developers out of supporting Internet Explorer is worth a shot.

GroupOn Equated To Madoff

irrational valuations for a company whose seeming goal is to make its original founders and investors money while leaving "the next sucker" holding the bag.

Note that original investors have cashed out more than $800 million, instead of using the money for operations... note the stories from the field already coming in - for example, about Groupon selling half a million dollars worth of salon services for a salon that was not even set up yet.

Saturday, August 6, 2011

Great Web Comic: Girl Genius

From a hilarious world ruled by mad scientists, which should look all too familiar if you're a programmer.

I recommend starting at the beginning.

TOLDJA! Unnecessary Registration Costs Businesses Money

BoingBoing, in 2011:

The fastest way to alienate... customers and scare away [their] money is to make [them] establish a relationship with you before [they] can make a purchase.

we did an analysis of the retailer's database, only to discover 45% of all customers had multiple registrations in the system, some as many as 10. We also analyzed how many people requested passwords, to find out it reached about 160,000 per day. 75% of these people never tried to complete the purchase once requested.

Me, in 2008:

Control is a business disadvantage.

Monday, August 1, 2011

ActiveRecord Minus The Record Part

Today an ActiveRecord discussion revisited an issue raised about a year ago. The short version: ActiveRecord models which contain all your application's domain modelling become bloated and a total pain in the ass to test, refactor, and/or read.

A year ago, James Golick said:

The truth is that in a simple application, obese persistence objects might never hurt. It's when things get a little more complicated than CRUD operations that these things start to pile up and become pain points. That's why so many Rails plugins seem to get you 80% of the way there, like immediately, but then wind up taking forever to get that extra 20%.

My favorite comment in today's discussion echoed this thought:

I think this all depends solely on the complexity of the app you are building.

If you're building a small website, even proper MVC might be overkill and things like Sinatra + Sequel might be the best solution.

If you're building a medium sized app, the Rails approach of thin controller / thick model will be just right.

If you're building an enterprise information system, you might need that three-tier architecture with presentation / business logic / persistence layers separation and maybe even other Java world practices.

Don't over-engineer, don't under-engineer. Make it just right for the thing you are building.

Factoring an ActiveRecord persistence strategy (either the design pattern, or the Rails gem) out of the centerpiece of your object model makes a lot of sense once you pass some threshold of scale. In this instance by "scale" I mean code base size but also possibly traffic. The argument for code base size is hopefully obvious, and certainly covered in the blog posts I've already linked to and quoted.

With enough traffic, strong arguments mount for slicing your persistence up. You might read from read-optimized databases while writing to a central write-optimized one (since most web apps do a lot more reading than writing) or handle most persistence through SQL while shunting a small subset off to NoSQL alternatives. It gets ridiculous managing multiple persistence solutions within an object which exists to model your business logic. A line or two of ridiculous, I can handle - I've written ActiveRecord models which snuck in calls to Redis pub/sub on the side - but go much further beyond that and the argument for separate objects becomes rock-solid.

In this sense, the traffic-motivated split is really just a code-size-motivated split with a specific reason for code size growing, and obviously where a general code-motivated split can depend on the overall size of your model code, a traffic-motivated one would depend on the size and complexity of your persistence code.

I don't think there's really any debate here at all, except for one crucial question: where do you mark the threshold? How do you decide when your code needs this split? Although you can certainly perform various measurements to guide this decision, I think this is a judgement call, and pretty much impossible to decide ahead of time. I've worked on sites which I knew for a fact would see gazillions of pageviews from the first day of launch, whether their larger business goals succeeded or failed. For a site like that, I would absolutely start by factoring ActiveRecord out into a service like James does. For more typical Rails sites, I'd start with ActiveRecord and move it out of the picture only when necessary. In my opinion this kind of split is crucial if you hope to scale a Rails site, but optional for most smaller projects.