« Hypocrites! | Main | Post Election »

November 04, 2004

How I Learned to Like Microsoft

My recent position has required me to move from my traditional bastion of development, FreeBSD/MacOSX, to the entirely old but new realm of Microsoft Windows programming. The current project has me with an open ended development environment, but a request to make it cross compatible with a future Linux client. Typically this isn't a big deal as ANSI C can handle this very nicely if you're careful. The catch with this project is that it requires a large amount of functional GUI, something I'm not very well versed in being a systems hacker, and Windows MFC is certainly something I'm not looking forward to thanks to many horror stories.

Since the requirement was open, I decided to check out the .NET platform instead of running down the MFC route. It would mean learning C#, which in turn would bring me kicking and screaming into the modern realm of object oriented programming (what's a delegate?) while at the same time removing some responsibility from me the programmer. The really nice thing is about C# is that the Mono project has almost completed the entire ECMA standard for C# and is working on the Windows.Forms compatibility portion.

Windows.Forms has to be one of the most intelligent advancements Microsoft has ever accomplished, despite it sounding rather brain-dead obvious. For the first time I can very easily author a GUI mockup without having to actually understand the underlying code. What's even nicer is the unified API that allows all languages to operate the same way. As far as product development goes, it's nothing too exciting, just what should have been done from the start. As far as a Microsoft move to sanity goes, this is a HUGE leap forward.

Before you start asking what happened to Dan, and who this is writing, I do have complaints. To start with the fact that C# is a run-time language ala Java just makes me sick. I don't really like the fact that it's possible someone can decompile my byte-code and get functioning source out of it. That is bad. C# itself is a little confusing. Take for example it's threading mechanism. There is an option to make something a foreground thread, which sounds like giving a thread a higher priority than another in your thread pool. No it just means the thread won't die when you think you've killed it. Enums and bit-masks seem to not work either (just try checking your thread's ThreadState enum for more fun and excitement).

My biggest complaint has been that you still cannot create an application with multiple output formats. Meaning that I can't write an application that will contain a GUI when no arguments are used, and a CLI when > 1 arguments are given. Well, I lied a little bit. Technically you can do this (and I have), but it seems your GUI will forever be tied to an annoying persistent black console window for it's entire life. Why I can't kill that, I don't know.

Posted by Dan at November 4, 2004 01:18 AM

Comments