It's always unexpected

I have a MacBook Pro now and slowly am getting used to it. It’s quite hard, considering that I’ve never had a laptop before; and actually used any Mac for the first time just a couple of months ago. My daughter thinks the best part about it are the weird image effects in PhotoBooth. I just can’t disagree.

On the unrelated note, now I am a Microsoft DirectX MVP. Just about the time when I almost stopped using it! I’d love to, but we’re making a product that primarily runs on the Macs… quite hard to use D3D there. But almost every day I wish I could, and every second day I’m annoying my coworkers by saying that D3D is lightyears ahead of TheOtherAPI!

The MVP award just came out of nowhere. It’s one of the things that you never expect - but hey, it feels good anyway. And now I have a MVP laptop case for my MacBook :)


OOP and other things now and then

Approximate conversation at work the other day:

Yeah, I split this into separate files, removed this and made these classes to make it actually work.
Ok, but don’t go too fancy with objects here.
Sure! I think it’s the only place where I actually use inheritance!

Heh. I’d imagine how that would have looked back some 5 years ago. “What design patterns did you use here?” etc. Funny how things change.

I think I’ve got it by now - took me way too much time for such a trivial thing - there is no silver bullet. OOP or any other buzzword is just a means to do something; sometimes it fits, sometimes it does not. Regarding OOP, I highly recommend Execution in the Kingdom of Nouns essay - it’s way exaggerated, but has the point. The best part:

advocating Object-Oriented Programming is like advocating Pants-Oriented Clothing

There is one thing about the codebase that we have at work that I love: it does not use any particular design/programming technique. A bit of OO, a bit of metaprogramming, a bit of plain C style, a bit of preprocessor macros, etc. I like to think that we’re using the best of those worlds, of course :)


Threading woes

Getting multithreaded code right is just so damn hard. Reasoning about it’s behavior or correctness is even harder! We’ll be doomed until we get something of much higher level than threads and locks.

Why I’m writing this? Because my head hurts from trying to make the renderer run in one thread, and the containing application in the other. With added spice that most (win32) GUI stuff must happen in one thread, OpenGL contexts can only be active in a single thread, simple functions must be split into complex chains of inter-threading calls, etc. etc. The result is a mess that nobody can understand.

I hope I’m not missing something obvious (well, aside from the suggestion “just don’t use threads”).


Why doesn't this feature exist?

Found this quote from Raymond Chen today (here):

The answer to “Why doesn’t this feature exist?” is usually “By default features don’t exist. Somebody has to implement them.”

It’s not like every feature you can think of comes out of your brain fully tested and implemented, and then some PM somewhere files a bug to have your feature removed. Features start out nonexistent and somebody has to make them happen.

So brilliant.


The holy grail of shadows

It just occurred to me: it seems that noone has ever made a shadowing system that does shadows from anything onto anything, with zero artifacts, with no corner cases, always looking good, running fast and on any sensible hardware.

Hm… sounds like a challenge! ;)

Back to reading.