09 March 2010

More Cowbell in One Line of Groovy

Sometimes you just need more cowbell.

It is for those times that I wrote this:

groovy -e 's=javax.sound.midi.MidiSystem.synthesizer;s.open();c=s.channels[9];c.noteOn 56,99;Thread.sleep 99;c.noteOff 96;s.close()'

I do often find myself needing more cowbell, such as when invoking a maven comannd which inevitably downloads the internet, like mvn clean. So get this puppy on your PATH and you can do this:

mvn clean && cowbell

...for an audio cue that tells you the internet has been successfully downloaded with a modicum of funk.

20 February 2010

Ali G Joins Github Team

I was browsing a Github hosted project, Mangos recently and attempted to check out the network graph visualisation of the clones of this open source World of Warcraft server.

Moments later I learned that there are too many branches on the graph for the flash visualisation to render. The following error message is shown:

Sorry, this repository's graph is currently too logical awesome to display. We're working on optimizing it. Check back soon.


Which leaves one wondering just how much is the right amount of logical awesome.

Clearly the only conclusion is that the Github team has been joined by a celebrity error message writer, Ali G:



Booyakasha!

11 February 2010

A Tale of Three Buzzes


Google's Buzz is causing a stink. It's the third social network which is called "Buzz" to come out recently. All have the Twitter model of microblogging (or multicast chat) with an asymmetric social graph (people decide who they follow but not who follows them).

Yahoo Buzz has been out for at least a year on buzz.yahoo.com and predicatably, Yahoo and their new overlords Microsoft are going batshit insane about this.

Oh really Microsoft? You've got a product and a bigger competitor comes along and uses your idea? And they use the generic term to name it? That must be annoying. The worm has turned.

And the drones at AT&T launched buzz.com about 6 months ago. Less said about that the better. In fact you can probably safely forget them right now.

So now we'll all be looking forward to the shakedown. There are too many players.

I think the winner will be the service that provides enough features (not necessarily the most, Facebook) with the best integration with everything else. Twitter so far has been successful at crowdsourcing the integration work with the massive proliferation of Twitter clients and "tweet this" buttons like Tweetmeme. Can Yahoo/Microsoft get this traction?

Google already has a great integration story. When the hundreds of millions of monthly GMail users hit their inbox now, they will be able to thread together lots of their google software that produces socialisable events. Now the google suite can buzz.

Perhaps it's just me but the one image I have about Buzz is those hotted up cars with the ultra-loud stereo systems and the monsterous bass frequencies causing every bolt in the chassis to loosen and the number plate to buzz.

09 February 2010

China Hackers Update: Arrests and Details

It is inevitable after the Google hacks, as they are known, that China responds by showing its international business partners that they do not condone hacking.

China Daily reports that the biggest hacker training site has been shut down. via RWW

"I could download trojan programs from the site which allowed me to control other people's computers. I did this just for fun but I also know that many other members could make a fortune by attacking other people's accounts," said a 23-year-old member of Black Hawk Safety Net in Nanjing of East China's Jiangsu province, who asked to remain anonymous.
and

They seized nine Web servers, five computers and one car, and shut down all the sites involved in the case, according to the provincial public security department.

So there you go Google - nothing to worry about. The "provincial public security department" got the baddies. Carry on.

Of course there's no reported link with what is now clearly a much larger and more sophisticated program of industrial espionage than previously thought as reported in detail by wired magazine.

The salient points of the wired article are:

  • The hacks have compromised thousands of companies, not just 37 as previously reported.
  • Most of the compromises are currently still active and law enforcement has been contacting companies to let them know they have been compromised.
  • The exploit was an IE 6 security flaw that was first reported to Microsoft by an Israeli researcher in September 2009 but which remained unpatched for months. ("0-day")
  • The attack profile include multiple-year-long occupation of companies' computer systems and typically involved hidden siphoning of large amounts of private data including email, documents, etc. This is in contrast to the smash and grab techniques more common in the past.
  • Existing security software (like antivirus software) is not able to detect this attack profile or the malware used to initiate it.
  • The full extent of data theft will never be known.
  • The goal of the attacks appears to be coroporate and national espionage.
  • The hackers have levelled up.
  • The trail goes dead in Taiwan where the data was siphoned to and China where the spear phishing attacks were initiated from.

Now it really feels like we're living in a Neal Stephenson novel.

10 December 2009

Build to Flip vs Organic Growth

In this world of GFC hell (is it over yet?) the biz buzz is "Organic Growth". That is to say business owners who are looking forward to the challenge of entrepreneurship in a downturn are standing as proud adovocates for a refreshing change to the mentality of the bubble and the zero profit, high valuation world of two point oh dot coms.

It's refreshing because the business press is usually obsessed with the crazy valuations. A sale price with more zeros means more heroes. Examples abound. Twitter's recent funding round reportedly topped $100,000,000. That would be nine zeros. Profit is currently just zero. You'd think by now they could afford to give us more than 140 characters.

Clearly people building businesses the traditional way, you know, charging a price (stay with me) for a product or service and growing revenues slowly over years, those people feel some justification in presenting themselves as a sane alternative to a world gone mad. Atlassian CEO Mike Cannon-Brookes has ranted exactly this in the past.

With financial systems in the toilet due to excessive valuation of flaky assets, this can seem justified as much as ever. Indeed my own aspirations for a new business incorporate this sane model of organic growth. I know it could take longer.

It seems that the venture capital (VC) funded model of startups popular in silicon valley are stuck in railway thinking. VCs think that if it isn't something they can put many millions in and get hundreds of millions out, it's "not interesting". And of course more is always more.

As a tech guy, I think the prospect of growing a business up from nothing seems plenty interesting. But if I had taken millions of someone else's money to start the company, well the reality is I'd have already sold the company. A chunk of it. I'd have borrowed money and would need to pay it back. How would I pay back the millions with extra zeroes on the end? I would have to sell out big. This is the railway. Once you get on it you don't get to choose where to go. You only get to choose when to get off, assuming you don't run out of steam. And VCs don't want you crawling down the track. They are looking ahead to their exit impatiently. They want their money to fuel the train as fast as possible. Destination "liquidity event".

On the other hand, is it really a problem if people want to start a business with someone else's money and sell it in a couple of years? What's wrong with build to flip?

I think the real problem here is cultural. If kids these days aspire to be like Kevin Rose, founder of Digg, or want to build the next Facebook or Twitter or even Mint (just bought by competitor Quicken for $170M), they may well be building with a mind to sell out in the short term. I don't think this short term thinking will build the next generation of great companies. It wasn't the kind of thinking that built Apple or Microsoft or even Google. These companies have really made their mark and changed the world, hopefully for better, but they're clearly more than an expensive flash in the pan. Even Bill Gates has become quite the philanthropist.

The parallels of build to flip with the the Underpants Gnomes are too stark to ignore. Can't remember step two.. never you mind about step two. Step three is profit. I suspect it's only this pesky string of recent bank collapses that has put a dampener on the craze of Underpants Gnomes business models. If the GFC hadn't happened first I think the startup upstarts might well all have bubble gum on their faces by now.

17 November 2009

Jason Fried on Less is More

I'm a fan of Jason Fried, the 37 Signals founder who sticks to his guns and stands up for simplicity in software design. I like how he's a dissenting voice and clearly has the courage of his convictions. I like how he promotes what VCs disparagingly call "lifestyle businesses". I'm happy that he's been featured on INC, a major US business magazine, even though I'm not enough of a fan to care what kind of tea he drinks and all that.

I'm a fan of Less is More. This year I have been exploring the surprising depth and complexity of this oft-quoted pithy aphorism. Jason Fried is a Less is More poster boy. Except he doesn't like the phrase. I've read it from him elsewhere, but the INC magazine feature reminded me.

If he didn't like less is more because it was overused and therefore overlooked, I would completely understand. But that's not his objection. He says that he doesn't like Less is More because it implies that More is better. Ridiculous!

Actually I worked with a guy who straight-out didn't understand the phrase. In one of his customary rants about inconsequential stuff he confided that he thought Less is More was vacuous and clearly irrational. "More is more and less is less!" he said.

First of all, I think it's obvious why it has a deliberate and prominent paradox. The semantic collision is a key feature of its beauty. Less is More works so well because it identifies the conflict of competing values in a compact and humourous way.

Less [of one thing] is more [of another].

There is an unspoken contex shift in the middle.

So to object to the phrase because it implies that More is better is to misunderstand it on the most flimsy semantic level. Less is better because it is "more good". To advocate Less you must refer to its superiority. Inherent in every word to describe "better" is the notion of "more". It's just words!

So to properly appreciate how well Less is More applies to Jason Fried's own philosophy of software design, you see that (arguably) less features enables something. Something is gained in their place. There is more of something.

Understanding what the two sides of the see-saw are is the critical (dare I say pivotal?) task of applying the less is more wisdom to a given situation. What exactly is the tradeoff being made? This is how I use Less is More in my software development and also in my life.

The opportune moments for the wisdom of Less is More are more specific than just identifying competing goals. It represents minimalism. It's not just less pizza is more beer. It advocates a fresh look at what is essential and rejects overconsumption, overburdening, hoarding and powermongering. It represents a philosophy of happiness and a wholistic goal rather than the pointless pursuit of intermediate tokens that we first world people frequently use as proxies for real goals.

Less is more is a tool for escaping from the distraction of things that are merely a means to an end and resets attention on the end itself.

There are usually hidden tradeoffs in software design and the business of programming. The 80/20 rule (the Pareto Principle) is essentially a variant of this where the see-saw becomes a lever and therefore provides (hold your nose) leverage.

Complexity is befuddling. Complexity in software actually prevents people from getting their work done and often inhibits progress towards their goal. For all it's enabling potential, complex software has an opportunity cost. When I was a kid, I had the justified belief that I could learn any application in one sitting. Those days are long gone. There's a great power to that. Jason Fried seems to be a voice in support of this idea.

I'd like to write more on Less is More. I think the irony is stopping me for now.

06 October 2009

Smart Programmers Who Don't Get Patterns

I've been recently struck by the relatively large amount of ignorance about software design patterns amongst the pundits and seemingly intelligent "thought leaders" of the sofware development blogosphere. Actually it's not all that recent.

Sure, I expect newbies and unscreened job applicants to fail to understand the point of design patterns, but to me they've always been one of the things all good developers should understand.

First, I don't think the problem is the definition. I'm not squabbling about this. People get this mostly right. A design pattern is a form of solution to a known problem. They originate from Christopher Alexander's work in Architecture where examples include the "Ante Room" or "Roof Garden". The idea is that a pattern describes a general solution to an open range of problems. Architects might consider adding a "Roof Garden" when they are faced with forces and constraints in a design project where the Roof Garden can help achieve the design goals.

Thanks to the work of many OO pioneers, but most famously the Gang of Four via their seminal book, Design Patterns, the software world has adopted design patterns as a technique for storing and disseminating software design wisdom.

But why?

This is where many otherwise well-trained and intelligent software developers fall down. They think that the point of design patterns is component reuse. They think that, like building blocks, design patterns are prefab parts you can stick together, thereby doing less work or using less attention. And once this mistake is made, their rejection of this dumbing down of attentive design in place of convenience is understandable.

But they have missed the point.

The whole point of design patterns is to enable communication about design. Design patterns are an attempt to standardise a vocabulary for solutions. Design is frequently a collaborative effort, and even when it's not, a design concept often needs to be communicated either verbally or in written form. Learning about system design also relies on a standardised language.

So a design pattern usually has a kind of specification which includes a stable name and possible aliases, description and suitable use situations. Developers who have used this pattern can then use the name instead of some long-winded boxes-and-lines session at the whiteboard.

Now for some examples of seemingly intelligent and experienced software developers speaking out against design patterns.

Some years ago Paul Graham and others argued that Design Patterns suggested a violation of the DRY principle and that they always indicated a smell that the program required refactoring to remove duplication or that the language was not powerful enough to factor out the duplication. While this could in theory be true, only Lisp developers are in danger of suggesting that their language is perfect, so for the rest of us (statistically speaking, everyone), perhaps there is enough complexity and subtlety in our domain that we find ourselves able to recognise solution forms that we can name and talk about, and yet not implement generically.

I take his point, but I think for most people it's a principled rather than a very practical one. The reality is that we live with imperfections in everything, so even if design patterns only exist to cope with this imperfection, then they will still have a seemingly permanent role.

The point that different languages have different patterns, some more than others, is well documented, and really orthogonal to the issue at hand - namely that design patterns are useful primarily for collaboration and communication. Even programming language designers use design patterns. All (impefect) programming languages, like all software, are knowingly designed to contain a subset of all possible features. Don't forget simplicity is a very valuable feature. Apparently Ralph Johnson, one of the Gang of Four, pointing this out did little to calm the hysteria on an argument that design patterns formed a list of language features that should be implemented.

Zed Shaw, Ruby on Rails agitator and apparent chronic self-congratulator warns developers in his keynote entitled "Why Keynotes Suck" which was (with what one must assume is deliberate irony) literally read off an irc channel:

"Stop using patterns. No really, quit using patterns, they aren't helping. I have evidence on that by the way, which is later"

I didn't catch the evidence but later he did say:

"Adapter, Bridge and Connector are the same"

And then

"Patterns suck, use algorithms."

The idea of patterns "not helping" conjures images of these dead zones in the code where there is a pattern just taking up space and not actually providing functionality. Should I go and delete all the patterns from my code? What would pattern-free code look like? Do they just suck because there are aliases? Plenty of algorithms have multiple names. What makes algorithms ok? Is Zed just trying to sound old school?

To be fair, during this talk his main point was to encourage individual thinking and not to follow advice blindly (including his own) but I do get the impression that his idea of patterns has come from the blind cookie-cutter adoption of patterns with small amounts of bad glue code holding the "architecture" together. We've all seen it.

A recent example is from a video interview with Stuart Halloway author of "Programming Clojure" and a series of articles about post-java jvm languages. When explaining the advantages of macros, Stuart basically repeats Paul Graham, saying,

"Languages that have macros don't really have design patterns".

Perhaps because he thinks a design pattern is when:

"I couldn't really figure out how to solve this in a resuable way, so whenever I hit this problem I copy and paste from somewhere else and tweak. So it's amazing that design patterns has put a positive spin on this copy and paste reuse of these blocks of code".

I'm not an expert on functional languages with macros, but Peter Norvig is. Even this mighty Lisp and AI guru identifies design patterns in such languages though he does say that 16 of 23 patterns are either invisible or simpler due to language features like macros, first class functions and multimethods. Stuart may be overstating it - I think what he is talking about is a more populist use of the canonical GOF design patterns and similar OO patterns.

The dread curse of this misunderstanding about patterns seems to have arisen from the usual cause of all technology's ills: marketing. I distinctly recall a Compuware salesman give a bone dry presentation to a local Java user group in about 2000 demonstrating how you could avoid programming almost completely by dragging and dropping patterns from a palette onto a ... thing on the screen. Clearly not targeted to a group of programmers so geeky that they want to get together after hours and talk about the joys of programming. Similarly books about something called "pattern oriented architecture" began to appear and patterns was something to put on the resume.

What these people need to understand is that design patterns will continue to be useful and to have a role because they are one level of abstraction above implementation. They are needed to explain solutions in terms of a programming language but they cannot be replaced by the language. They are softer than software.