Archive for the 'Coding' Category

Feb 19 2008

300 Page Binary Madness

Published by saalon under Coding

No, really, Microsoft’s obfuscation was necessary and in no way purposefully opaque!

Joel Spolsky seems like a really good programmer with solid design skills and a fantastic looking product, FogBugz.  On the other hand, his blog, Joel on Software is…not bad.  A lot of what he writes is at worst worth thinking about, and occasionally right on target.  Then every once and a while, his misplaced Microsoft sympathies come creeping out and he writes something like today’s post.  In it, he points out the absurd difficulty in reading and understanding Microsoft’s Office file format specifications just before telling us all why it was such a good idea and that its inherent unreadability and utter lack of portability were simply necessary side effects of good programming.

I don’t want to go point by point through his post.  Joel makes a lot of technical arguments whose validity is irrelevant: he’s working from a lot of goofy and faulty assumptions.  I imagine these are the same goofy and faulty assumptions that Microsoft’s design team works under when they produce their bloated, only occasionally functional monoliths.

There are a lot of things like: They were designed to be fast on very old computers.

And: They have to reflect all the complexity of the applications.

As well as: They were not designed with interoperability in mind.

The designed to be fast on very old computers thing amuses me, since the very argument Joel made in defense of Excel was that, unlike IBM’s Lotus package, Microsoft largely ignored the speed and hard drive limitations of the day, knowing that computers would get better quickly and thus having a product out that worked was more important.  I don’t buy that “efficiency” required a format no one could manage to implement today, even with the specification.  I’d like to note that the UNIX world managed to get by just fine without ever coming up with an equivalent binary monstrosity.  Plus, Word files were bloody huge, partially because of junk like Word’s “fast save” feature just slapping document updates onto the end of the file, leading to documents that grew in file size every time you saved a minor change.

I think it’s telling that the feature Joel suggests as the kind of complexity that necessitates massive binary specification is a “Keep With Next” function I never knew existed and have never seen anyone use.  This isn’t to say this is not a vital part of 5% of the user population’s day, but building a file format design that no one will ever be able to unpack so that you can add features most people don’t know exist is putting the cart far in front of the horse. Once again I must point out: The UNIX world managed to get by without binary madness filling in for reasonable document markup.

That’s what I can’t get past.  Other people have solved this problem, and they’ve solved it better.  We’re talking about tables and text files, here.  UNIX managed to get by with a minimum of crazy opaque binary formats, and largely due to this became the backbone of the Internet.  To suggest that Microsoft just couldn’t have anticipated interoperability being this important is insane.  UNIX hackers were making decision that facilitated interoperability since the 70’s, not because they pre-visioned the rise of the Internet, but because it was good design practice.

It’s possible Microsoft wasn’t prescient enough to see what was coming.  Microsoft certainly isn’t known for being forward thinking.  At best, they’re quick to react, purchasing or stealing the technology they needed to keep up with the market.  Even so, they never rectified their binary-file-format mistake, and I have no doubt it was for the same reason Microsoft obfuscates all of their formats: Because they can.  Microsoft’s control of the market relies on maintaining that control.  Not on producing better technology, or anticipating market trends, but simply by using its current market share to make switching to competing software so inconvenient that user laziness will sustain that market share.  Word 2003 had a big, opaque binary format so that people couldn’t easily switch to Linux and still read Word documents, thereby alienating them from the rest of the business community.  That this was not working is the only reason Word 2007 uses XML.

I can’t end without mentioning the flaw that cripples every Microsoft product, as spoken by Joel: They have to reflect the history of the applications.

Microsoft has been hobbled by the poor design decisions of its past for decades.  Everything from an MS DOS file system to the Registry to a lack of robust multi-user functionality is and must remain a part of the Microsoft codebase.  Every product by Microsoft has to be 100% compatible with every prior version of that product.  Word 2003 couldn’t have just imported in Word 97 formats, it had to stick with it, shoving even more binary madness into the spec to accommodate feature enhancements.  We’re not even talking about being backwards compatible with the OS here.  We’re talking about a marked-up text file.  It’s one thing to be backwards compatible with sane designs, like much of the UNIX world has been.  It’s another thing to be shackled to bad ideas you made in 1980.  Apple found itself in the same position, and scrapped their entire historical codebase.  Would the company still exist without OSX?  Maybe, but it certainly wouldn’t be growing its market share at all, let alone at their current rate.

There are reasons Microsoft’s dominating presence in the home and office spheres did not translate into the same market share online.  Most of them are laid out rather nicely in Joel’s post.  So check it out.

No responses yet

Feb 02 2008

The Old Glory of Sierra

Published by saalon under Coding, Creating, Watching

They have one of the worst reputations of all games now, but there was a time when the Adventure Game was king. It wasn’t a short time, either. One of the earliest Big Adventure Games was the Zork series which launched in 1980. Even as it was dying, classics of the genre continued to come out as late as 1999. The genre as it was is all but gone, but its reign was long and glorious.

There are a lot of reasons why it was so successful at one time and why it’s become nigh reviled now, but I’m not going to waste a lot of time on that. A lot of pixels have been rendered discussing the merits and failings of the Classic Adventure Game, and I doubt I can add anything to that debate. I’m here to talk about what they meant personally to me, and why no other genre has ever been able to match what the Adventure Game did for me.

Late to the Party

I’m not an Old Skooler when it comes to the genre. I didn’t play many text adventure games, and the ones I did play I got angry with after a few

exchanges. Something about the semantic requirements of those text adventures just infuriated me. So while I know what Zork is, I don’t get the references and I can’t claim to have been a fan of them in the least. Yeah, I know. Heresy.

A lot of this may have had to do with what computers were in my house and when they got there. I had an old Atari PC whose designation I can no longer recall, and that was all I had until my dad picked up our very first 386. By this time, the grand old age of text adventures had largely passed, as had the first round of graphical adventure games that were really just text adventure moving billboards, such as the early King’s Quest games. No, I didn’t get involved until the advent of Point And Click.

I wish I could remember what the first Adventure Game I played was. You’d think that was important, but those early games of my youth blur together. If I had to guess, I’d say it was King’s Quest V: Absence Makes the Heart Go Yonder! So yes, I was a latecomer, but once I was hooked, I was totally fished in.

<Something> Quest

If anyone is responsible for cementing my gaming tastes, it would be the developers of Sierra. There may have been single better games created by LucasArts, but it was Sierra that kept the adventure flowing. They had a series for every taste. King’s Quest was lighthearted, slightly Disney-ish adventure. Space Quest parodied any science fiction it could get its hands on. The more action-oriented Quest for Glory (which started as Hero’s Quest) was like playing through a straightforward sword and sorcery yarn. And let’s not forget the less successful but still sorta-interesting Police Quest, which tried (and occasionally succeeded) to tie the game’s puzzles to investigative police work.

There was something that the Sierra machine pumped out that was always missing in the other games I played. Story. These things were written. Not always well written and not usually deep, but they had a frickin’ plot behind them. One of the criticisms of the genre is that they attempted to be interactive stories, but failed; all you could interact with were the puzzles, which had a single solution. True, but that wasn’t why I loved them. I didn’t need an interactive story. I wanted an immersive story. I wanted to feel like I was there, but I still wanted someone to rip a yarn for me.

Were the puzzles annoying? Yeah. Was the gameplay largely following a pre-laid railroad track from puzzle to puzzle? Uh-huh. But at the end of it all, I had just experienced storytelling in a way nothing else could match. I might remember the way the lights flickered in Doom, but it can’t match the sense memory I have for the lion kingdom in Quest for Glory III.

And it definitely can’t match the emotional swell I still feel when someone mentions Gabriel Knight.

Jane Jensen - Queen Of All Game Writers

I wish I could say that I expected something extra out of Gabriel Knight: Sins of the Fathers when I picked it up, but I don’t think that’s true. I think the draw had something to do with the voice cast, which consisted of cult actors like Tim Curry, Michael Dorn and Mark Hamill. Plus it was a Sierra adventure game. I thought I knew what I was in for. It didn’t take long to realize I was in for something completely different. Later, when I got older and smarter and realized that writers were responsible for games just like they are for television, I’d come to realize that the Something Different was a writer named Jane Jensen.

The thing about the Gabriel Knight series was that the gameplay was almost secondary to the experience. You didn’t solve the puzzles because you wanted to solve puzzles, you did it because it was part of the story to take the next step. That next bit of plot wasn’t coming without solving the puzzle, and many of the puzzles were tied into the plot in such a way that solving them and solving a mystery were tied together. Sure, like all Adventure Games, the puzzles were often arbitrary and perplexing. It was a weakness of the genre. Never had I played through a game with a story like this one, though. Never.

Gabriel Knight: Sins of the Fathers was the first chapter in a supernatural detective series. The title character, through the course of the first game (I almost typed novel there, no joke), learns of his ancestor, a former Schattenjäger. That means Shadow Hunter, but in another language, which is what we fantasy writers do to make things sound less hokey. It’s a journey of discovery, as a self centered loser detective learns that he’s meant for greater things, if only he is willing to reach for them. The core mystery of the game weaves through the New Orleans underground, voodoo cults and a tragedy sealed by the failings of those who came before us.

It was only the first in a series of games that became an obsession of mine. The world of Gabriel Knight was so tangible, so immersive, that I wanted to go back as soon as possible. I did what I almost never do: I played through the thing, from front to back, multiple times. Just to take in the story again. When the sequel, The Beast Within: A Gabriel Knight Mystery hit, I didn’t even care that the contracting Adventure Game market had forced a silly all-live-actors engine onto the series. I mean, it was a modern detective story about werewolves!

If I hadn’t been so enamored with the storytelling, perhaps I would have seen the writing on the wall. Stupid game engine changes are the first sign of morbidity. It didn’t matter that Jane Jensen was a canny enough writer and producer to shoehorn lots of useless live-action video into a playable adventure game with a moving story. The writing was definitely on the wall.

But the writing - the real writing, not the metaphorical kind - was so good it didn’t matter. The sequel let us split our time between Gabriel and his partner, Grace Nakimura. Grace was the Partner With Sexual Tension, a hoary chestnut of a plot device that still works when someone cares enough about it to make us care. And they did. And so came the second thing I had never seen in a game: a legitimate romance. One that made my heart beat a little bit the same way it did when a read a novel.

By the time Gabriel Knight 3: Blood of the Sacred, Blood of the Damned hit, the Adventure Game was nearly dead. Unfortunately, despite the best writing of the series (and a far superior version of the story The Da-Vinci Code would later use to huge success) , the gameplay didn’t help the genre any. Many people have torn apart the infamous Cat-Hair-Mustache-Puzzle, and rightly so. The constant changing-engine game Sierra was playing made it even more of a mess from a gameplay perspective. It missed the point. Adventure Games were not keeping up with the advancement of how interactive games had become. It had nothing to do with whether it was 2D or 3D.

Yet my love for the series, and for the genre, was only sealed by Gabriel Knight 3. Never before, and never since, have I been so moved by the story in a video game. When people talk about the stories in most action games, I can only sigh. They’ve got nothing on my girl Jensen. As the mystery of the third Gabriel Knight wrapped up, we watched Gabriel and Grace sleep together for the first time. Then, confused and unsure of whether Gabriel and she could work, Grace slipped away quietly, leaving to study with another man in another country. And all Gabriel, matured by the revelation of the origin of the Schattenjägers, could do was read her goodbye letter helplessly. And that’s how we left him. Alone.

All Things Must Pass

Gabriel Knight 3 is the last Adventure Game of any note. Some of its ideas and concepts have been absorbed into other genres, but the very particular feel that the Adventure Game left me with has never been replicated. I can’t argue with the charges leveled against its outmoded gameplay, but I also can’t get behind the belief that there wasn’t something right about that style of game.

Sure, you can put plot into a first person shooter or an RPG, but both of those require combat, and demand a certain type of strategy that runs counter to the style of writing the Adventure Game was known for. Not all heroes carry guns or fight hoards of goblins, and no combat-based game (which accounts for the vast majority of what comes out) can really stick us into the shoes of some of our favorite character archetypes using that model. The Adventure Game met the needs of a certain kind of gamer, and the intent of that genre was never wrong. They just got stuck on an implementation that got old.

I still fantasize about some resurgence of the genre, some update of the gaming model that makes it all work again. It’s a fantasy that leads directly to Jane Jensen writing another Gabriel Knight game, that lets me follow Gabriel and Grace through their evolving relationship and solve a hinted at mystery about ghosts in Scotland. I believe it can happen. There’s a hole in the gaming market. People like me, who want a game that’s centered around story, atmosphere and discovery, minus the combat and twitch-gaming required in everything else, are not being served.

I still game, but I haven’t enjoyed it in the way I used to in a long, long time. When I think back to the last time I was truly passionate about a game, I think of Gabriel Knight 3, and I realize with the death of the Adventure Game what made me a gamer in the first place died as well.

No responses yet

Jan 14 2008

Spam Spam Scripts and Spam

Published by saalon under Coding

I never knew a scripting language before.  Ok, so I never knew any language before a half-year ago, so that’s not surprising. But as I’m finally beginning to pick up the pseudo-hacking traits I always dreamed I’d have, it’s clear now that some kind of dynamic, scripting language is missing from my toolbox. My first thought was to go back into the language I dabbled with a dozen times in the past but never truly learned: Perl. I always liked its philosophy and it’s got about a billion other people who use it, so it seemed like a natural.

Then I thought: well, if I don’t know any of them in the first place, why not explore more than one and pick the one that works best for me? I knew a little Perl, but other people have been talking up Python and Ruby a lot. It couldn’t heart to dabble there first, right?

Right. I decided to grab a book on Python first. Maybe it was the Monty Python reference or perhaps it was the kinda cool IDLE real time interpreter that came with the distrobution when I downloaded it. I figured I’d end up with something a lot like Perl and end up going back to the one I sorta-kinda-knew, anyway, so it’s not like it mattered. I picked up the book on Saturday and started to poke around.

Me think me in love. I’ll grab something on Ruby, I swear. No reason not to. But something about Python’s orientation toward easy list management hits me in my sweet spot. Screwing around with lists of things is probably the most common thing you’ll do with a language like this (well, maybe any language), but most languages make list management a stabbing headache. Sorting and searching and adding new stuff to it and all the other things you have to be able to do before the list is useful is built right into the core syntax. So built in that it’s featured in that simplistic overview section O’Reilly puts in the early part of their Learning X series. Usuaully you get something like “This is an array. You can add initialize it like this, but we’ll stop there before you start imagining ways to kill yourself too early.”

As a relative newbie whose primary interest is in design, one of the things I look for in a language are features that make me think of problems I could solve more easily. Throwing something in that gives me the “Holy crap! I could have made this other thing I built 100 times simpler and better with this!” reaction is the first step to making me a convert.

Python’s doing this in spades. If I already knew Perl well, I’d probably stick with it and actually learn it. It’s a good language with a huge community and a lot of excellent tools built in it. It’s a venerable, powerful language. And Python could just be attracting me with shiny newness, though it has less shiny newness than Ruby, so probably not.

I’ve got some more learning to do before I make a decision, but golly gee is Python cool.

No responses yet

Jan 11 2008

Binary Headaches

Published by saalon under Coding

Nothing like having the raw power of a great language at your disposal, right? Toss a pile of awesome libraries into the mix and you can do just about anything. Even Microsoft couldn’t deny it, so when they came up with the .NET Framework, they built up a bunch of .NET classes to let you avoid having to reinvent the wheel. “See?” they said. “Who needs Perl and Java and Python and PHP? You have .NET now! Feel the thunder!”

Great, except that The Thunder locks you into MSThunder(tm) whenever it can. I’ve been researching image formats for an hour, looking for one native .NET library that can save an image as a vector graphics file not encoded into an opaque, binary format. If you know Microsoft, you know I haven’t had much luck. There are some n ice formats out there that can handle this, of course. Scalable Vector Graphics (SVG) and Vector Markup Language (VML) are two I’d like to use, but no such luck. At least not until .NET 3.5, which my company will not move to so I can do a useful diff on two printed reports for an test automation.

What I am given are Windows Metafile Format (wmf) and Extended Metafile Format (emf), both encoded in shockingly opaque binary. I’d like to use them. I would. It’s a native format, and while I don’t like Windows native formats, I’m lazy. But both formats are big lumps of unreadable junk. Was an open format such a threat to Microsoft’s vast image format hegemony that they had to save it in a useless format? Because we all know what an industry standard the Windows Metafile Format is.

This is something that should be easy. This is a problem that should be solved. It’s not. And if it were any other development comminity, someone else would have solved it and released the library under an open license. Only no one does that for .NET, for a bunch of reasons stemming from crap like Microsoft’s unusable binary file formats. Microsoft won’t play nice with anyone, so no one plays nice with them. If I want a library for .NET to save in SVG or VML, I’ll have to pay for it. All because Microsoft is trying to win a war that shouldn’t be fought, and producing junk development tools that lock you into their badly thought-out framework.

I’m sure there’s a way of doing this, and it’s probably not as hard as I think it is. But this is the kind of junk that makes programming no fun. And just like the other programmers out there, whatever interst I’d have in solving this problem and releasing it to the community is killed by Microsoft’s general attitude.

Screw it. I’m going to try again on Monday.

No responses yet

Dec 10 2007

Netbeans or Eclipse?

Published by saalon under Coding

I’m currently working on a D&D character generator (yes, I’m a geek) to hone my Java skills, and I’m starting to feel a little bogged down in the details of building the GUI. Coding GUIs by hand is something I have no experience with, and Java’s GUI layout managers suck hardcore. I’ve been building the thing in Eclipse, which I like in some ways, but in other ways seems to have the worst of open source projects (powerful, but somewhat opaque in design).

I started looking into some options, and started to look into Netbeans as an option. It’s got a built in, WYSIWYG sort of GUI generator, in the style of using Visual Studio or XCode, and its interface seems a lot cleaner. It may lack some things in power and areas for customization, but I mostly want to build this damn application and stop screwing around with pixels and columns and weights and constraints.

Anyone out there have experience, or know someone with experience in either of these IDEs? Any advice, warnings or insights would be appreciated. Thanks!

No responses yet

Aug 04 2007

Java, C#, SQL, Delphi & Visual Basic: Fear In Multiple Syntaxes

Published by saalon under Coding

I’m going to be a software engineer.

This was an unexpected development for me. I was always the least computer geeky of all of my computer geek friends. Oh, sure, I’ve been a big geek for my entire life, but I’ve been the one who didn’t have the sk1llz the others had. I can get around a bash shell, but end up looking up the proper usage of simple things like rm and grep. I can crudely insert letters into vi, but need to google anything beyond saving my changes and quitting. I ended up hacking together tools at work with Access and VBA, but hadn’t managed to get beyond basic loops and control structures in any real language.

I was a non-geek among geeks. My skills were weak. I was no programmer. I was close to certain I was never going to be.

Yet this Wednesday I begin my new position as a Software Engineer for my company. It’s a position I pursued. A position I applied for, interviewed for and wholeheartedly accepted when it was offered to me.

What my precise responsibilities will be on the day I start, I can’t tell you. I can guess that it will involve using Delphi and Visual Basic 6, but beyond that I know only that I am very, very afraid.

Ok, that’s not all I’m feeling. I’m also really excited, and am looking forward to finally picking up some skills that I’ve coveted for most of my life. I like programming. Every class I’ve ever taken in it has gone pretty damn well. The tracking tool I built for my last company was not too shabby, considering I built the thing in Access.

But I’ve never done it for real. Never done it when it mattered to a company whose revenue depended on my code working. To pull this off, I’m going to have to learn an awful lot, and I don’t know how long I’m going to have to learn it. In my future is not only Delphi and Visual Basic, but C# and connections to Microsoft SQL Server. I’ve never had to learn this much for a job before, and there’s that bad little part of me that’s afraid I just won’t be able to pass muster.

I haven’t been sitting still. I’ve spent the last month teaching myself Java, so I’ve got a foundation in something object oriented. Plus Java is similar to C#, so there’s a chance I’ll be able to pick up that skill 2-3% more quickly, now. Baby steps.

So I’m going to be a programmer. I’ll be able to discuss a project with my other friends and not have to talk in abstract concepts. Maybe I’ll even be able to fire up vi and not end up jumping down 10 lines when I meant to write “main()”

On second thought, I shouldn’t get ahead of myself. Textpad may not be l33t, but at least the arrow keys do what I expect them to.

No responses yet

« Prev