Archive for May, 2008

Doomed from the start

There’s no shortage of people lambasting the recording industry for keeping their business model firmly behind the times.  The ability to download music online seems to have presented the industry with a challenge it simply can’t accept.  They have a hammer that’s been serving them well for a very long time, and by god they’ll bash away at this problem even though it no longer in any way resembles a nail.

I’m not going to rehash the arguments or the history here, but needless to say, the recording industry has very firmly clung to the the premise that no matter how much money you pay, they must retain control over what you do with that music.

Enter a new business model that is doomed from the start.  Lala.com presents a model that is essentially a rental scheme.  I found out about this site via Slashdot and Michael Robertson.  Lala has a large number of songs on it (over 5 million) that you can search, listen to from start to finish once, and then add to your playlist for 10c.  Once the song is on your list, you can play it whenever you like.

Here’s the catch: you can only listen to the song via the Lala website.

Ok, that’s not entirely true, you can (sometimes) pay more money and buy the track in mp3 format, but the new business model Lala is going for is clearly listening to your 10c tracks via their website.  They get to control everything because you stream the music.  You can’t put it on any devices or burn it to CD.

So why is this doomed from the start?  To be fair, I’m sure there would be some people who would be happy to pay such a small amount of money to be able to listen to their music from any Internet-connected computer, but I’m not one of them.

I generally listen to music in several places using different devices.  In the car, I’ll listen to music on the radio, on CD, or on my iPod.  At the gym, I’ll listen to their music or my iPod.  At parties, I’ll listen to music from a stereo via an iPod, CD, or yes, a computer.  And sure, sometimes I’ll listen to music at home or at work from a computer.  The vast majority of my music-listening is done via a little plastic disk or a little portable music device.

Now, there’s some criticism of the restrictions forced upon you from online music stores like iTunes.  iTunes lets you download music, but the files contain DRM that restrict what you can do with it.  According to the website, you’re allowed to burn it to CD as many times as you like, and copy it to as many iPods as you like.  You can only put it on up to 5 computers though.  Not much of a restriction - who has more than 5 computers?

Lala on the other hand won’t let you burn to CD and won’t let you put a track on a music device, but they’ll let you play it on as many computers as you like (via their website).  For me, that means I can no longer listen to my music in the car, at the gym, or anywhere without an Internet connection.  That’s a deal-breaker for me, and I’m sure for a lot of people.

The argument is between consumers who want to be able to purchase something without strings, and record companies who want to control their rights and insist that you’re only buying a license to play the music they still own.  Launching a website that tightens control over what you can do with the music is stupid.  It’s giving people the exact opposite of what they want.  Mark my words, this idea will fail, and it will fail hard.

Update: Ars Technica, Wired, and CNet have written about this beta of Lala.com now as well.  The general feeling seems to be similar to my own - they’re unsure of the 10c streaming model.  Also, see the comments section of this post for a reply from one of Lala.com’s employees.

Singletons are what? Oh, I see…

I found this article by Steve Yegge claiming that the Singleton pattern is stupid and evil.  I know it’s old, but I found it via reddit (which I’ve been getting into a lot more than Digg lately - probably more on that later) and despite having his blog on my feed, I hadn’t gone back that far into his archives.

I read about half of the article before I decided I’d write my own post pointing out that he’s actually attacking not the singleton pattern itself, but its use in inappropriate circumstances.  I use the pattern occasionally, and I’d like to think I use it when it should be used or at least when it’s useful.  The examples he gives throughout represent inappropriate uses for the singleton pattern, not a failure of the concept.

Then I read the rest of it, including the final note which says:

Note: I think there are some good uses for the Singleton pattern, but it’s so incredibly overused, and serves as such a convenient crutch for people who don’t understand OOP, that I figured I’d just take the stance in this article that it’s basically Evil.)

Huh.  So here I am writing a post about nothing.

New Template

If you’ve visited here before, you’ll have noticed that the template I’m using has changed.

While the old one looked good to me for a while, the more I looked at it, the more I thought it just looked too busy.  There were borders all over the place and gradients and background textures and all sorts of things.  It was too much.

So I’ve gone the minimalist approach and have chosen a template that’s very simple.  I hope you like it.  I think it makes the posts easier to read.

Damo

Post-traumatic Documentation

It’s great when software is designed and implemented with careful planning and plenty of documentation so someone can pick it up when it falls down.  Unfortunately, it’s often the case that a) You’re working on an existing project that has no documentation, or b) You’re working on an existing project that has documentation that is now out of date.

I’m doing the former right now.  The software is old.  Like 12 years old.  It has no documentation.  It has duplicated code, code where it shouldn’t be, hard-coded values, code that does the wrong thing before being corrected by other code.  Think of an anti-pattern and it’s in there.

The application is being phased out, but it must be supported until it’s completely gone.  It’s also in an environment where changes are inevitable and legally mandated so there’s no chance of a complete code-freeze.  The original programmers are long gone.  It’s not fun to work with.

Now don’t get me wrong.  I don’t go in and make changes that just add to the spaghetti - I refactor when it’s practical.  If I’m changing some code that’s repeated in three places, I’ll pull it out into its own method.  If there are hard-coded values that could change, I’ll set them up so they’re configurable.  In short, I’ll do some cleanup, but I’m not going to do it all.  Refactoring everything would mean nearly rewriting the thing from scratch, and that’s been done (hence the phase out).

So what about documentation?  Writing detailed UML for this software is just not practical.  For one thing, it’d be obscenely hard to do, but more important is the fact that this program is unlikely to be in use in 12 months time.  Priority doesn’t go to documenting legacy software.  The fact of the matter is that it’s just not worth the time and effort to pull the thing apart to work out how every little piece ticks.

So I’ve come up with my own alternative.  I call it Post-traumatic Documentation.

I’ve set up a document that I’ve titled the Application Body of KnowledgeEvery time I dive in to make a change or fix a bug, I’ll absorb a whole lot of information about how the application fits together.  There are basic things like which files do what, but most of the important stuff is in the details.  I might spend half an hour working out that some assignments in method A get overridden in certain cases when method B is called, or that a class called ABC actually provides functionality for DEF and perhaps doesn’t get called at all.  I learn these things the hard way and I make notes as I go.

Whenever I finish one of these traumatic quests to change something small, I go through my notes and add anything of interest to my Application Body of Knowledge.  There’s a section dealing with the overall architecture of the application, one for each of the main modules, one for deployment, and one for general notes.  It’s deliberately heavy on keywords and jargon to facilitate searching.

This document is obviously far from complete, but it is immensely helpful to me when I next have to make a change, and it’ll be even more helpful to the guy who takes the reigns from me when I get hit by that programmer-killing bus.

Damo

GTA IV… yeah, me too…

Let me preface this post by saying that I haven’t played it. In fact I don’t even own a console that is able to play it. I’ve never even seen anyone play it, and I’ve watched maybe one trailer about halfway through.

So why am I writing about GTA IV having had no hands-on experience and no exposure?

Well, I’ve been absolutely inundated by the flood of reports, articles, blog posts, editorials and reviews about GTA IV. I spend a lot of time on the web and I watch my share of TV and listen to the radio, so I’m fairly up to date with what’s being talked about online and in the media.

So here’s what I’m aware of so far. Despite the massive success and constant positive reviews of the recently-released Ironman movie, its revenue is likely to pale in comparison to sales of the latest Grand Theft Auto game. The media is jumping all over reports that Hollywood is (once again) scared that computer games are going to seriously eat into their profits.

It’s been said before, and it’s a fairly legitimate fear. It’s worth noting though, that movies and computer games compete in the entertainment market only indirectly. Sure, there’s some overlap, but $100 million in movie revenue will not be replaced directly with $100 million in computer game sales. There is room for both. Motion picture industry revenues certainly haven’t experienced the same massive growth as the computer game industry, but there haven’t been many huge changes in movies in the last few years. Computer games on the other hand have improved out of sight in a short number of years. There are still brand new technical advancements being made (think Wii) while movies now have slightly better special effects than a few years ago. It’s an unfair fight and this result isn’t really surprising.

Anyway, it seems that this game is a very big deal. It’s apparently got a very complex storyline; one that competes with big plot-based Hollywood movies. The big difference is that being as interactive and immersive as the GTA games are, it’s infinitely more interesting and longer-lasting than a movie. There’s little doubt that the $100 million it cost to make will be well worth it. The real question will be whether the other games companies will continue to pump out the same games with better graphics, or whether they’ll go the way of Rockstar and start releasing games that are more like fully interactive movies.

Damo

Pin Complexity

Every few months, my bank card decides it’s not going to work.  Usually generic ATMs or those of other banks refuse to accept it, but this time it was an ATM belonging to the bank I’m with.  Once again, I walked inside the branch and arranged for another card to be sent to me.

In addition to ordering me another card, the customer service rep offered to link my Visa card to my savings account so I could use it to withdraw money from my main account.  I’ve never had problems with the Visa, so this may be a more permanent solution.  Regardless, I needed to choose a new PIN for this to work.

Here’s where it gets interesting.  I was asked to type in a new four-digit PIN with various obvious restrictions such as no birth dates or other important dates, but also with no consecutive double digits.  My initial reaction was that it was an unusual requirement (given that I’ve had PINs with double digits assigned to me by the same bank in the past), but I didn’t think much of it.  That was my initial reaction.  As I considered it more, I thought, wouldn’t this would have the opposite of the desired effect?

Now my probability mathematics is a little rusty, but here goes.  There are 10,000 possible four digit PINs.  If a truly random PIN is chosen, the probability of guessing it on the first try is one in ten thousand.  Given you usually only get three tries before the machine swallows your card, the odds aren’t good.  If you let people choose their own PIN with no restrictions, it could be a little easier - you’d probably try their birth date, or an anniversary or something like that.  Let’s face it, people need to be able to remember this number so they’ll have to choose something that relates to them.  The odds of guessing a PIN like this are a lot better.

I was asked to choose a PIN that didn’t correspond to any important dates, so given that restriction, we’ll make an assumption that the PIN isn’t guessable.  Brute force (albeit three attempts) is really all that’s left, so we’re back to one in ten thousand.  But if you add a rule that says you can’t have double digits, then the number of options available decreases to 7,290A person who finds my card has a better chance of guessing my PIN than if this rule didn’t exist.

This seems like a case of implementing decisions that sound good without any real analysis.  Have I got this totally wrong?  Does this seem silly to anyone else?

Damo