Browsed by
Month: April 2010

A rant on some of Microsoft’s API development over the recent years

A rant on some of Microsoft’s API development over the recent years

I’m becoming more and more tired of Microsoft’s mindset of how software should be written.  As an engineer, I can see exactly how they’ve gotten to where they are design-wise – but think it’s time they took a step back and take a look at exactly what they’ve gotten themselves into.

I often frequent a MS insider’s blog who fields problems that end-developers encounter using Microsoft’s interfaces and API’s (The New Old Thing).  Again and again I’m struck by how un-developer friendly some of the newer API’s are.    The API’s can be very unforgiving and inflexible – and confusing.  And the reply you usually get when confusion results of the design decisions and logic are often condescending (actual clip from responses when users/devs give feedback):

“So, I’ve done everything according to the docs and it isn’t doing what it says it should – is the b operator broken?”
No, the b operator is working just fine. The problem is that the b operator doesn’t do what you think it does.

Back in their Win32 days – the API was relatively clean, pretty understandable, and fairly easy to pick up.  But now, with some of the ‘programming features’ in .NET stuff I’ve seen – it makes me glad I’m still in good-old C++ land.  Auto-initializers, massive use of custom data types with strange member functions for interacting with the data, metadata with your classes (Metadata EVERYWHERE in fact), it’s very hard to know what’s really going on under the covers or why the design ended up the way it did.  Maybe I’m old-fashioned or write things that don’t fit nicely into their wizards, but I LIKE knowing what’s going on under the covers. Just ‘trusting’ the API to figure out what I’m trying to do has never done anything but get me into mysterious corners that reason and logic can’t get you back out of.

What I really want as a developer is to be able to develop QUICKLY.  However, I think MS has misunderstood that term.  QUICKLY doesn’t mean getting “Hello World” up in the fewest number of mouse clicks/lines of code typed.  Quickly doesn’t mean I can use some kind of wizard. Speed of development depends firstly on how quickly I can LEARN THE PHILOSOPHY AND DESIGN OF THE LANGUAGE I’M USING.  If I understand those two things – then when I hit a moment of saying “I need to do operation X (which I currently don’t know how to do), I can REASON OUT what it is I need to look for.  However, if you say to yourself, “I need to get the current working directory”, then find out that you need to learn a special new kind of string class with all kinds of new struct types for initializing/interacting, a new kind of file system iterator, etc – you find yourself spending 2 hours trying to learn how to interact with the monstrosity of the language instead of developing real working code.  I could do the above operation in 1-2 lines in Unix c and Win32, but some .NET and other MS API’s have becoming horribly confusing to figure out.  Why?  Because the API’s seem so certain that you need lots of help to write anything, they’ve re-worked every old data type and API call you know and love. THIS kind of attitude is what slows development to a crawl when working on new API’s/languages.

The final nail that makes it all disappointing as a developer is knowing that NOBODY else is using the language that you’re now spending all this time learning.  You feel like you’re spending all this time as a wasted effort in learning non-transferable knowledge.  As a computer scientist – I know the theory behind languages – I have the transferable part of computational/languages theory down.  What I’m really doing is learning the non-transferable parts – and I find myself doing that in spades with some of Microsoft’s newer API’s and not in a good way that helps my career along the path of inevitable growth and change.  At least it’s starting to get compacted down in C#; but it’s taken a LONG road from Win32->MFC->COM to get us there – and I’ve forgotten more of that stuff than I care to try and recall.  But if I learn C or Haskell or Java – at least it works cross-platform and I know I could write it on a Mac/Unix too.  It’s a good use of my time.  But I just don’t get that feel with most modern MS stuff.

It’s frustrating; but I don’t know what the right answer really is.  Maybe this is the way things need to develop.  Perhaps I should ponder and write up a bit about the comparison of how new platform solutions are designed by MS, open source, and Apple OS’s…

Left4Dead 2 – the Passing – and Steam thinks I’m running in compatibility mode – but I’m not…

Left4Dead 2 – the Passing – and Steam thinks I’m running in compatibility mode – but I’m not…

Yet another case of Steam’s PC client giving me headaches that can’t be solved by mere mortals.  I don’t think I’ve had  ONE successful launch day download that didn’t require 2+ hours of fixing/waiting/etc.

Left4Dead2’s new DLC level “The Passing” added one more mission and several new gameplay modes on Thursday last week (which was free on the PC, but cost money on the XBOX).  I forgot to leave my machine on during the day of launch, so I had to start downloading when I got home from work.  My bad – but I was surprised that they didn’t let people start pre-loading like they did for the original launch of Left4Dead2.  Anyway, after getting several ‘Servers too busy – try downloading later’, I finally got a download started.  4 hours later it completed. Steam restarted to install some patched, and then when I restarted Steam, my Win7 x64 popped up a dialog saying it was going to apply compatibility settings to steam because it detected an install problem.  There was no way to say “No – DON’T do that”, so it went ahead and applied these ‘settings’.

Then, when you tried to start Steam again, you got error dialogs from Steam saying:  “Running Steam in Windows compatibility mode is not recommended. Please remove any Windows compatibility settings for all users under file properties for Steam.exe and restart Steam. Press ‘Cancel’ to permanently ignore this warning and continue.” I click on the file properties for the executable and go to the compatibility tab -but it says there are no compatibility modes set.  I try setting/resetting them – still get the error.  I look online, people have tried completely installing/uninstalling ALL their games/Steam – no luck either.  Finally, someone grabs Microsoft’s Application Compatibility Tool and found the compatibility keys for Steam.  He then dug around in the registry to find where those keys were kept, and does this:

To fix the issue:

  1. Hit start->run->regedit
  2. Go to key: HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers
  3. Look for a entry with your path to steam.exe
  4. Delete that entry
  5. If you dont find it there try HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionAppCompatFlagsLayers

So, there’s your fix

Saturn’s hexagonal ring explained (partly)

Saturn’s hexagonal ring explained (partly)

The hexagon ring discovery a few years ago on Saturn was fascinating, but this possible solution from some fluid dynamics folks appears even more so.  Their basic premise is that they can duplicate the flow by spinning a ring under the surface of the water.  This would imply the pattern is created by some kind of high-speed storm running around the pole below the visible cloud layer.

A particularly interesting part of the article is that they can  make other shapes too by varying the speed of the underlying spinning ring/storm.  My question is since it was a scale study – how fast would the winds in that storm be running?  As it is, wind speeds on Saturn are already known to reach 1,800 km/h – and that’s crazy fast (~Mach 1.5).

Local Portland guy beats Asteroids record that has stood for over 27 years

Local Portland guy beats Asteroids record that has stood for over 27 years

I met this guy when he was attempting his 2006 world record attempt at the local Ground Kontrol just a dozen blocks down the street from my place.  I just walked in on a weekend and he was the only guy in the place playing.  I chatted with him a bit while he was playing and he seemed pretty friendly.  Glad to hear he made it this time.  He had gotten about 20+ hours into it the last time when the machine overheated and crashed on him.

http://www.wired.com/gamelife/2010/04/asteroids-record/

Go watch his actual gameplay here:
http://www.justin.tv/johnmcallister#r=P29FTM8~