One thing that working on this first programming assignment has made me realise is that nowhere
in the course structure for my Computer Systems Engineering
degree @ UTS
is there a subject on algorithms.
Now Chris, one of PTS' senior senior engineering staff who happens to be based in the Sydney office, mentioned the other day that when he did his degree (cue the Four Yorkshiremen skit
) all the programming courses were about algorithms first and languages second. So of course when we've all been sitting around at lunch time challenging each other to find better ways to find perfect numbers, Chris has looked at what Nathan and I did, and then ripped the guts out and replaced them with better and better algorithms. And I do mean, better and better --- both in terms of cpu usage and memory usage.
I remember being fairly good at working out good algorithms in my first degree but being terrible at coding them. Now I think the balance has turned somewhat --- my coding is much better and I'm re-learning how to develop algorithms.
A few months ago I had a chance to fix a bug in the mpt(7D)
driver (this is the on-board scsi controller in the v20z
). The problem manifested itself on a v20z with Solaris 9: handling an interrupt while handling an interrupt blew the kernel thread stack away because of the way we were doing scatter-gather list allocation for each scsi command structure. I re-designed the way we do this allocation to use an as-needed allocation of exactly as much kernel memory as is needed for that particular scsi command.
Now while it took me a few goes to get all the necessary pieces re-written, it was tremendously satisfying to know that I personally had figured out how to do this, and it was efficient, it was elegant and it was mine
Now if I'd been tasked with fixing that bug straight out of uni first time around, it probably would have taken me twice as long and not been nearly as elegant --- because I didn't have the exposure to good code and good algorithms. But with a few years (ok, 10+) behind me, it was actually quite easy.
Now what I need to do is try to pass this experience on to my colleagues and the young-uns who I'm studying with. That
is going to be the challenge!