Archive for March, 2004

Examples Of Bad Code #25643

Monday, March 29th, 2004

I’m sure you’ve all seen this one. Rather than having code looking like:

result = functionCall(foo, true, false, false, true, true);

some bright spark thinks it’d be a great idea to replace the boolean parameters with something more “human-readable”. So, they #define a whole heap of macros and instead they call:

result = functionCall(foo, MACRO_ARG_MEANING_TRUE, MACRO_ARG_MEANING_FALSE, MACRO_ARG_MEANING_FALSE, MACRO_ARG_MEANING_TRUE, MACRO_ARG_MEANING_TRUE);

And then they feel happy that their code is more “understandable”.

No No No No! The problem is in the tool, not the code. If you don’t have a decent editor that allows you to quickly cross-reference across your codebase then get one.

Stop making the code look like a dog’s dinner because you have a bad editor.

Will Young - Leave Right Now

Monday, March 29th, 2004

Shocker I know, this is actually a really really good pop song - one of the best I’ve heard for years. As well as Will having probably the best pop voice since George Michael, there are two reasons why this song is so good.

1 The opening chord sequence. I’m talking about the bit under the lyrics “I’m here, just like I said, Though it’s breaking every rule I’ve ever made”. Not quite sure how I’m going to notate this, but I’ll try putting chords in parentheses after the appropriate syllable.

I’m here (I) just like (IVc) I said (I) , Though it’s break- (II) -ing every rule (VIb) I’ve ever made (V)

The good bit is the unusual imperfect cadence at the end there. A boring pop song would do the cheesy II-I-V thing, but by using II-VIb-V instead you get the same bass-line but with an interesting VIb chord. VIb has almost the same notes as I except it (obviously) includes VI. Because the previous chord is II (which also contains note VI) it’s possible to suspend the 6th between the II and VIb, which is what the producer does. Very clever, a step above the usual dross.

2 The chords in the chorus. I’m talking about the bit under the lyrics “I think I’d better leave right now, Before I fall any deeper”.

(IV) I think I’d better leave (VII b5) right now (III) , Before I fall (I) any deeper

Quality stuff. Changing from IV to VII b5 is actually only a one-note change (dropping the tonic to the leading note). As this is done in parallel with the tune (together with the change of inversion underneath), it makes really good effect. It also implies a key-change which in fact is side-stepped by the unusual cadence III-I (the ear expects the chord-sequence to follow the cycle of 5ths and change from III to VI).

I don’t know who wrote it but it’s very very good.

Harmonic Resolution

Sunday, March 28th, 2004

I’ll be posting a bit more about music here, I think. The irony of me posting lyrics is that I’m terrible at remembering them, and working out what they are from listening to a song.

So, as well as posting lyrics that mean something to me, I’m going to start talking a bit more about the harmonics of certain songs. This feature will be know as “Why <song> Doesn’t Suck”. There’s two songs that immediately spring to mind. They’re played on the radio all the time, and I don’t think most realise exactly why they like them so much. We’ll have a bit of my take on why they’re so good.

There may also be the odd post in the “Why <song> Sucks Donkey Balls” category (sorry, South Park reference). If I do, first up will be Katie Melua…

Shopping

Sunday, March 28th, 2004

I went out shopping today to get some jeans. I came back with:

Discipline. Need More Discipline.

Belle de Jour

Friday, March 26th, 2004

Because it seems to be fashionable to declare your opinion one way or the other on this one, I Have A Theory™ about who Belle de Jour is.

Well, not really a theory, more a “I wouldn’t be surprised if that who it was”-type feeling.

I reckon BdJ is actually Anna. I have no real evidence for this other than:

  • They both live in London
  • I think Anna moved to London about the same time BdJ started
  • Anna hasn’t been posting much lately - too busy writing a book? ;)
  • Both clearly well-read - I can imagine Anna reading Private Eye (BdJ did a spoof E. J. Thribbs poem)
  • Both not exactly technical - Belle struggled with an RSS feed, Anna has never had one on her site
  • Something about the writing style rings a bell.
  • Both excellent, excellent writers (and if it’s not you, Anna, you can take it as a compliment that your writing is as good as Belle’s…)

So there you go, that’s what I reckon.

Whilst considering this, I came up with another strategy to “out” Belle. I’m fairly convinced that whoever is Belle already has another blog - probably well-known to those in the UK blogging scene. So maybe some correlation could be done between posting times of Belle and other UK bloggers? Take some standard deviations of the differences in posting times and see what comes up? This relies on Belle and the other weblog being posted to one after the other… Possibly a good metric, possibly not. You could get some pretty graphs out of it and see which lines look suspiciously similar…

Dawning

Monday, March 22nd, 2004

You may have got the impression, from reading this site, that in fact I am less than happy. You may think that this is where I wail about how crap things are, rant about the hypocrisy in Western politics, and occasionally geek out.

This is not true, of course.

I’m perfectly happy.

That’s why I’m listening to Skunk Anansie - Secretly

The Rain In Spain Falls Mainly… In Madrid

Sunday, March 21st, 2004

The Madrid bombings were obviously followed by “grr terrorists we will defeat them oh yes we will” posturing from almost everyone. That was to be expected, and perfectly natural. I’ll admit to glazing over when Jack Straw came out shortly afterwards and began the war-on-terror rhetoric.

Far more interesting were the events two days later, when the Spanish people decided to chuck out the centre-right government (that had taken Spain to war in Iraq against the opposition of 90% of the population) and install the Socialists (who had pledged to withdraw Spanish troops if they were elected). The most interesting quote following this came from the Leader of the House of Representatives in the US, who said that the Spanish people had voted “to appease terrorism”. Bush et al were obviously not impressed by the choice of the Spanish people.

I think to say the Spaniards voted to “appease terrorism” is to distort the facts. The millions of people on the streets of Madrid were certainly not appeasing terrorism. They were out there in the pouring rain stating their views on terrorism very clearly. The main reason they kicked out José María Aznar was because they thought he had lied to them following the attacks.

Aznar and his allies (including Jack Straw, I might add) immediately sought to blame ETA for the attacks, because Aznar knew that his policies on ETA were strong. If the bombings had been ETA, Aznar’s party would probably have increased their majority in the Spanish parliament.

In the hours following the blasts, Popular Party officials were briefing the State media that the attacks were the work of ETA, despite having evidence to the contrary. They even proposed motions in the UN condemning ETA terrorism and persuaded the British government to support this line publicly (even though we probably knew that ETA had not carried out the bombings).

Unfortunately for Aznar, there was enough time between the bombings and the elections for the truth to start to seep out. Clues leaked to Reuters of possible Islamic links, and Aznar began to be undermined. When it became clear that Aznar had probably known of these links and had sought to influence the election by filling the media with reports of ETA’s involvement, the Spanish people were understandably pissed off. They kicked him out.

So who changed the election result? The terrorists? The Spanish government? The Socialists? It seems clear to me that by their deceit the government threw the election away. The Spanish people stopped trusting them (are you paying attention here, Tony?) and voted them out.

The Spanish people voted for truth and honesty in their democracy (a democracy which, let’s remember, is only 25 years old). That’s not appeasing terrorism. It’s exactly the kind of democracy that the US preaches, but rarely seems to practice. Perhaps Bush, Cheney and Rumsfeld should reflect on that.

Too Busy!

Friday, March 19th, 2004

Argh - I have stuff I want to write here, but no time..

  • “Depressing” music
  • The Spanish election results

When I have a minute…

Symmetry

Monday, March 15th, 2004

As someone who stumbles with words, life seems a never-ending search for lyrics to quantify feelings, and express emotions.

These are the best so far:

I’m caught in the symmetry of your mind
But I’m not happier than you

Did I really see you or was it a dream?
Dreaming that it was seamless, not a trace of wrong
Wrong words that we have spoken, little did we know
No bigotry, No tears shed

Oh if only you’d try to be polite
Thinking you were right
Only to find that you’re unkind
But ironically you will always be belle of the ball at least to me

I’m caught in the symmetry of your mind
But I’m not happier than you

But my words are frail not audible
They do not even convince me
Perhaps they are untrue
Truly with you the worst is always true
I gave you all the benefits of all the doubts

I had never hoped to be as benign as me
Funny how you always get through
But ironically you will always be belle of the ball

At least to me.

– Mew “Frengers”

Getting a “Real” Player

Wednesday, March 3rd, 2004

The RealOne player sucks. It’s awful. It’s quite possibly one of the most annoying, bloated, crapware-filled pieces of software I’ve ever made the mistake of installing. You can read more than I have the patience to write on the subject here.

But there is an alternative! Finally!

Real Alternative is lightweight and Just Works™. You can download it here. I tested it in Firefox with the BBC website and everything seemed lovely.