Friday, September 16, 2005

Disappointment

It appears that work would like me to fly to LA.

Now, this would have been fine if my wife could have accompanied me, but since she can't, and flights are rather expensive, this is really quite annoying. Spending Sunday driving/training/flying/taxiing to LA is not my idea of fun, and not having guitars at the other end is not sounding fun either.

It's not even entirely clear what I'll be doing in LA. Certainly I can support the customer, but why me?

Thursday, September 15, 2005

Dilution

Those of you who have been writing applications for more than a couple of years probably recall a technology called ActiveX.

ActiveX was never really well defined. It kind of grew out of VBXes and OLE Controls as a kind of catch-all component term. ADO stood for "ActiveX Data Objects". ATL stood for "ActiveX Template Library". Still, over time, we calmed down and ActiveX was subsumed by COM in the general mindset, and COM we all understand, right?

ActiveX became a synonym for OLE, which isn't COM; it's built on COM, as a means to perform object linking and embedding. Much like you can drop .NET components into a Windows Forms designer or a Web Forms designer today, you could drop ActiveX components into a VB6 form designer.

You could also - and this is the killer functionality - embed into Office. Everything from Windows Write and WordPad up to PowerPoint supported embedded ActiveX objects. Equation editing, Excel embedding in Word, org charts, and the Binder.

Now, this might be memory-lane stuff for you, but bear with me.

What happened to this functionality? Well, it's still there - but in order to do it, you still have to use ActiveX. Where's our promised Windows Forms hosting in IE? Okay, it's possible, but point me to an Internet site that actually uses it. And what about Word? I'm sure I could care less about Word 12's "open XML", but I'd have to work at it. I want to be able to embed into Word, and ActiveX is still the only game in town.

The trouble is that ActiveX is truly horrible. ATL does its best, bless it, to ease the pain, but ultimately the technology needs a complete rework. The average ActiveX control has to implement a dozen interfaces, needs extensive boilerplate code, and has severe limitations on presentation.

If you need to work in Word, you've got a real problem. Word doesn't use IViewObject to display ActiveX controls. Word uses IDataObject, instead, to render the control into a Windows metafile (not an enhanced metafile). No font embedding, no gradient fills, no fancy context-sensitive interaction. When you load a Word document with an ActiveX control in it, Word just plays back the metafile - the control isn't even loaded.

No wonder Microsoft gave up on the ActiveX Control Host for .NET controls.

OLE is fifteen years old, having been released with Windows 3.0 and Write, and we still don't have anything in Microsoft Word 2006 to replace it. IE still relies on ActiveX to provide everything from Flash to the MSN Messenger installer and Windows Update. ActiveX and OLE are not secure, are not portable, are actually incompatible with .NET, and are inhibiting the development of applications for end-users.

Sometimes I think that Microsoft forgets that Word is used by people to write letters, essays and reports - and that developers would like to target that market, too.

Distrust

On Monday, I had a particularly trying time with Windows. I had the following symptoms:
  • Clicking anything - link or button - in Internet Explorer hung the process
  • Outlook would randomly hang
  • MSN Messenger would randomly hang

When these processes hung, nothing would kill them. I could kill from Task Manager or Explorer or Process Explorer or even attaching in Visual Studio and Stop Debugging - and the damn things kept going. I was even unable to log off or shut down. Hard resets do work, but then I've yet to find anything that wasn't affected by a power off!

What do these things have in common? Well, I figured it was a networking thing. Particularly the IE thing. I tried Firefox, and lo and behold, it works! "Hmm." thinks I. "Well, I guess I could live with Firefox rather than IE, and I rarely use MSN, but Outlook is a problem." I went looking for info on WinInet crashes, and found variants of viruses - but none present on the machine. I was thinking that only device drivers caused hanging like this - but I can't exactly do without network connectivity, either.

I eventually managed to get MS Symbol Server support in Visual Studio (don't forget to copy the new symsrv.dll over the old VS one!) and broke into a process to narrow it down... and guess what IE does when you click a link, or Outlook receives an e-mail, or a contact signs in on MSN?

I was annoyed at not having clicked earlier, but I don't have speakers or headphones on the work machine, and so I'd completely forgotten about - the soundcard. Indeed, it was crashing deep, deep within PlaySound... I assume that it was DeviceIoControlling and hung up waiting for the device driver IRP.

Now, I'm not going to blame Microsoft for the awful SoundMAX device drivers*. Since I don't use the sound anyway, I just turned it off in the BIOS - and now everything works just fine. What I will blame them for, however, is what it is that keeps a process alive if it's waiting for a hung device driver - the "hung IRP problem". It would be so easy for Windows to be able to at least provide me with the information saying which driver is hung. If Mark Russinovich can identify the IRP owner, the Windows team should have no trouble.

Why is this behaviour still here? I've encountered it numerous times. I know that ideally we'd all have bug-free drivers - but that never, ever, ever happens, and WHQL is not a guarantee. And as an end-user (in this particular situation) I'm not going to run checked builds of XP, am I?

As Ice Age quote Blake's 7, "Trust is a hard thing to come by these days". Yet I wish that Microsoft would trust less, so that we can trust it more.

According to my father, who is battling with USB devices, the USB drivers in Windows are also poor. You'd hope that if a USB device deviated from the standard that Windows would step on it and disable it, hopefully putting a helpful message in the Event Log... at least, you'd hope it wouldn't do what it does, which is to hang the entire machine without any information. Or spontaneously reset.

Third-parties are inherently untrustworthy. We don't write software with the expectation that the user will never click the wrong button, nor should we write libraries with the expectation that people will not break the preconditions. I lock my car and set its alarm, not because I actually expect people to break in, nor because it will stop 100% of all car thieves - but because the protection is sensible.

Microsoft is learning... slowly, too slowly, but learning.

Are you?

I wonder whether I could craft a special USB device that would give me code execution at Ring 0? I can crash it, I wonder if it has an exploitable buffer overflow. The ultimate hacker tool - walk into a bank, open an account, ask for a cup of coffee, then when the assistant walks out to get it, whip the device in the machine. Five seconds later, it's installed a keystroke logger - at kernel level - and I take it back out. The assistant comes back and is pissed because his machine is hung, so I leave and receive his and everyone else's logins and passwords when he reboots.

Sigh. Maybe if I make up enough stories like that one, someone will fix the bugs.

* Why are soundcards still dreadful? I remember a trying time with Gravis' Ultrasound card (a dark red, full-length ISA card), and crashes with SoundBlaster clones - but surely things have improved?

D&D

My wife and I are attempting to learn D&D, after many years of various computer game variants.

We started at the bottom - the Dungeons & Dragons Board Game. Now, everyone I've ever spoken to has referred to this as "useless" - it doesn't follow the d20 system, it doesn't use the rules, it's pretty hard-and-fast for the DM, etc. We didn't find it so bad, and it serves as a great introduction to the world, play style and general rules for those who have never, ever, played a role-playing game before.

On the weekend, we found a copy of the Dungeons & Dragons Basic Set in a bookshop in Trowbridge. We leapt on it, of course; so far we've played a few hours worth on it, and it's a lot of fun. Yes, it's better than the board game, and certainly it's more forgiving of our restrictions, which require us to be able to play for an hour or so and then stop. It has a much-condensed rule set from the standard rules, but it maintains the free play. It also contains a dice set (well, almost - just the one 6-sided die).

I think that in a couple of weeks we'll probably splash out for the 3.5 basic rule set (Player's Handbook, Dungeon Master's Guide, Monster Manual), and maybe another dice set (to get the cool cloth bag). And maybe an adventure or two. Hmm. This could get expensive.

Of course, part of the point is to play with others... but there just doesn't seem to be any others in the vicinity. Does anyone actually play D&D in Oxfordshire? Or is anyone interested in learning to do so?

Wednesday, September 14, 2005

Divergence

Okay, so by now you know I chose Windows and have stuck with it. Have pity on me, though, because now I have a difficult situation.

It's really nice to read about the "new" .NET stuff. I played with C# quite extensively with VS.NET, and I think it's great - the good bits of Java with real platform capabilities. When it comes to developer environments, Microsoft still haven't lost it, and VS.NET is a great C# IDE. Everything is peachy, particularly the new 2005 stuff, which is really nice.

However, I have a problem, and it's at the root of why I haven't played much with the 2005 beta.

My problem is that, like many people, I work in a vertical market - at the moment, motion capture. A couple of months ago, it was medical review workstations. Both of these domains would really benefit from .NET technologies.

One of these companies is a Java shop, with some C++ for algorithms. We ran up against every Java disadvantage. Number 14 on Sun's Top 25 bug list, which celebrates its 2nd birthday on Saturday, is a real killer (read it all, even if you don't believe it). JNI is just painful. JARs are the wrong solution to the deployment problem for end-user apps. Performance of standard Swing components is questionable, and Swing is just too complicated anyway. We weren't buying in 3rd party components, we bought libraries, and the quality was generally low. And Java 5 is stuffed with bugs.

Yes, we conquered those issues (well, except for the font rendering), and I'm proud of having done so. I can't help feeling that it would have been better not to have had them, though.

Company B uses C++/Qt. Now, Qt is better quality than Swing, but it's still buggy, and having the source code helps us tell that the bugs are in Qt but nothing else.

The upshot is that, while I really like C#, I can't afford to be religious. I need to eat, and so does my wife, and so will my children. For better or worse, Company A has a lot of Java developers and a lot of Java code, and won't move any time soon. Company B has a division that needs to be portable. The decisions made seem to be sound, except for one thing.

The changes in the .NET space are not happening elsewhere. I like the C# stuff, and I like the new libraries, and I like Avalon and WinFX. I can't use them, though. This is not the financial industry, which appears to have embraced .NET, nor is it the US, nor am I self-employed. Eventually the Windows app market will be divided into two camps: a large one of .NET developers who write exclusively for Windows, and a small one of C++ and Java developers who think they are writing portable code, and sell exclusively on Windows.

I fear I will be in the latter camp, and I will miss out on the fun stuff.

What can I do? I don't want to work in London with the associated commute. I don't want the late-nights, heart-attack stress of the banking industry. I don't want to move from the UK. So I will work in the forgotten minority, those who sit five to ten years behind the "cutting edge", and I will pray that my competence will be enough.

Discontinuity

When I was young (about nine), all those years ago, and blissfully unaware of the computing landscape, while other people celebrated their Spectrums and Ataris, I had what was available at home: an IBM PC.

We're not talking an XT here; it was a 4.77MHz 8088 with two 5.25" floppy disk drives (I think). This was brought home by my father from work for Christmas a couple of years running. Ah, the joys of BASICA on floppy disks (mind, when you're learning from a TRS-80 book, it's slightly more tricky!).

Of course, I wasn't stuck on that PC for long; I went through my father's old machines in search of the perfect development platform. A Ferranti Advance with 20Mb hard disk (do you know how hard it is to type "megabyte" then "hard disk"?). A 12MHz 286 with amber-on-black CGA monitor in 1990. How do I remember it was 1990? Because it had Windows 3.0 on it...

To this day I still know the shortcut keys for Windows. While we did have a fantastically expensive optical Mouse Systems mouse, my dad used that for GEM and Windows on his new 16MHz 286 with (gasp!) colour VGA.

When I graduated to that machine, my friends were all using Amigas and Ataris. We stuck to our guns, and my dad's 486 was light-years ahead; that is, if I'd ever been allowed to play games on it... but it was hard, not having the games. (Does anyone remember a game on the Amiga 500 with bouncing red balls you would pop?)

Ten years later - eighteen years after that first PC - I'm still stuck to PCs. Yes, they irritate me, and so does Windows XP, and yes, I still lust after NeXTstep (in its OS X variation). I haven't gone to any of the "light sides", though. Why not? It's not as if I haven't spent enough time with UNIX to know its advantages; I ran SuSE on a 486 ten years ago, and I've tried a number of variants of Linux periodically. I drool over iMacs. I download Win32 GNU tools. Yet I've never actually fully immersed myself. Why not?

I realised the answer to that a while ago, though. I use this computer for work. It is a tool. It is not an end in itself. I don't play computer games; I have an Xbox for that. I don't hack OS kernels for fun (any more). I am a software engineer, not a code monkey, and not a "quick hack" person, for better or worse. And I go home at 5:30pm to my wife, not to my den.

Yes, everything I do on Windows I could do on Linux, without a doubt. And if I dislike the Linux USB drivers like I do Windows' (more on this later), I have the opportunity to fix them. And I'd get endless customisability.

Thing is, it doesn't matter. In terms of the combination of price, ease of use and overall quality, Windows wins for me. My priorities are different from some other people's. I can't justify handing over £900 for an iMac, nor can I give up the consistency and ease-of-use of a modern GUI for Linux's patchy efforts. If I don't get flamed too badly for that, I might elaborate on Linux's failings, and how it could really compete on the desktop, another time.

I could go on - and, indeed, I have - ultimately, though my sister's husband may call me "Bill Gates' whipping boy", I have made the right decision for me. Not because my friends or peers believe I should serve some higher cause.

Tuesday, September 13, 2005

Disturbance

This would be my first post, then.