Win32 woes…

For the past six months I’ve been learning the .NET framework api, this whiz-bang new model for Windows programming. It was designed from the ground up to be easy to use, powerful, and internally consistent. And it really is, it’s even got these interoperability hooks to interface with the current Win32 functions. Many times in college I tried to learn how to program in windows, and always gave up because it was really complicated, or because I couldn’t find a good book on it, or because this was before google made finding tutorials easy, etc. I couldn’t even figure out where to start. I did wind up working on a couple small projects, most notably a screen saver that we wound up selling as a fundraiser for the Africa trip, but I was pretty confused the entire time and didn’t really understand what was going on.

Well, I have this little project I want to work on that requires me to use the serial port. There’s no support for serial ports directly in .NET; I have to use compatibility functions. So I have to know how to do it with the Win32 api. And because this is really a simple program, I figured, why not just do the whole thing in Win32? Having worked with the .NET framework in the age of Google, I know where to go to find information about windows programming, what google queries to use, where to find the SDK (because I don’t have the $$ for Visual Studio 2003), etc.

So I started on that today, and within a half an hour quickly found myself in deep weeds. Oh, it’s not hard, really, just very complex (mainly because of backwards compatibility issues), and there’s tons of new stuff to remember. I found a little hungarian notation table that explains what each of the prefixes mean, so I’ve got that hanging out in the corner of my desktop while I slog through all of this stuff. It’s fun in the same way that painting your house or exercizing is fun: you get through it by imagining how much better off you’ll be when you’re done.

I like programming. Sitting down to start a new programming project is like sitting down and eating a sandwich. Sometimes it’s a sandwich you love and are really familar with, like turkey. Sometimes the sandwich is really weird, like peanut butter and bananna. Sometimes the sandwich will have ingredients you don’t really like, but maybe you can “pick them out” and not use those parts in your program. Sometimes you hate the sandwich but there’s nothing else to eat. But sitting down to work on this win32 program is like taking a big bite out of your sandwich only to find that it’s filled with hair.

Maybe I’ll get used to hair eventually, but damn.

Leave a Reply