Fun · Technology

Today in music

Thanks to my son misplacing an adaptor for my earphones to work with my iPhone I had to turn to internet radio for background noise to block out the office chatter. Well, at least it’s giving me something new on my playlist. Trying out 100hitz and the Alternative channel

  • Just listened to Lucinda Williams’s “Righteously”. A bit bluesy, a bit country, a bit rock.
  • How about Korn’s “Freak on a Leash” (MTV unplugged). I’m not normally a Korn person.
Technology

iPhone 3G

Looks like Apple really has improved the sounds quality on calls. Both GSM and 3G.
From iPhone 3G review – Engadget:

One thing Apple was keen to talk up is the vastly improved call quality of the iPhone 3G. Those in the know understand that 3G call quality is often better than regular GSM — but it turns out Apple made a huge improvement on both sides. iPhone 3G calls made over 3G and GSM both sounded significantly better than calls made on the original iPhone. If you’re upgrading your device iPhone you may not necessarily notice it, but on a side by side it was pretty obvious.”

Technology

Indirection, Interfaces, and Control Inversion

I’ve been working on some existing code that has a reputation for being very difficult to understand. It’s taken a while but I’m feeling pretty comfortable with it now and it’s not that complicated. Part of what makes the code inscrutable is a combination of too much indirection and control inversion (no documentation doesn’t help, of course).
Indirection is calling code that calls code that finally does what you want.
It’s great for abstraction. For example, do you really know what happens when you write

i = i + 1;

Indirection gives you more flexibility (i.e. polymorphism). It’s what novice programmers fail to do. When you see 200 line functions, duplicated blocks of code, and hardwired values that constantly need to be changed it’s code written by a newbie.
When you see an execution path like

Class1::doit() -- Class1::doit2() -- Class2::doit() -- Class3::doit()

it’s from someone that learned their novice lessons but hasn’t learned the cost of indirection.