XML is still evil

I love people. Everybody who knows me is aware of how much I respect and admire the average person. Software folks are no different. Most of them are very intelligent and never say stupid things regarding topics about which they have almost no experience.

So while I wasn’t terribly surprised to see that XML is still crap, I was utterly shocked to see that people still defend it.

PEOPLE, LISTEN THE HELL UP. It’s very simple. XML was built to mark up documents, not to store data. Here are some choice comments from really smart people:

XML became the default because of its flexibility in data formatting. And, because it has become so ubiquitous, almost all programming languages have built in ways of easily parsing XML. In fact, I do almost all of my web output using XML and then use XSL style sheets to transform it into HTML. I remember some blogger, can’t remember his name, blathering on about MVC and how you should make your output “skinable”. Well, if you produce XML output, your webpages are extremely skinable.

The problem here is that you’ve apparently killed most of your brain cells by listening to idiots tell you what to do all your life. XML is flexible for sure, but the problem is how it’s abused. XML is used for everything. SOAP is the worst example. XML is not for data storage. It is not okay to store data that isn’t meant to be human-readable in a TEXT-ONLY FORMAT. Have you ever seen how much smaller binary files are than text files?

Skinnable websites = marked-up documents. That’s what XML was built for. I don’t even like it for that very much, but it does work fairly well in that capacity. Marked-up data is a completely different situation.

I’m afraid I couldn’t disagree more. No, XML isn’t the easiest to read (by humans) of all the infinite number of alternatives out there. No, XML isn’t the most efficient in terms of space. And yes, perhaps it has been forced into places it was never intended to go. But you miss what I think is the most important point: it is rapidly becoming a standard way of representing information. I would argue the value of having a standard far outweighs the inefficiencies in most cases.

I would argue that you’ve been brainwashed by people who are only slightly stupider than yourself. XML as a standard isn’t a good thing, but even here your “logic” is nothing but a straw man argument. The author of the post didn’t say standards were bad, and didn’t even say XML didn’t make sense anywhere. He said XML wasn’t the best choice for every place it’s being used, which you have already admitted!

You’re an embarrassment! It’s not good to have bad standards! Look at SOAP! It is good to always look for a better choice. Where the fuck would you be without people ten times are intelligent as yourself always looking for better options? You’d be a fucking caveman. We evolve, we look for better options, we find better ways to get a job done! Standards are fine, but without constant analysis and reconsideration of those standards, our industry would never go anywhere. How can you claim to be an IT person and yet not understand this?


Following a link from that site to an old JSON vs. XML debate, I found even more idiocies. But one in particular just shouts out about the morons who’ve managed to become part of my industry:

As Dr Phil asks — What were they thinking?

No doubt I can write a routine to parse this, but look at how deep they went to re-invent, XML itself wasn’t good enough for them, for some reason (I’d love to hear the reason). Who did this travesty? Let’s find a tree and string them up. Now.

This is bad. This guy is a total moron. I mean, he didn’t even bother to investigate JSON before he said this most absurd of arguments. Not only is he saying, “Let’s not reinvent the wheel for any reason, ever” (which should be a blasphemy to all computer science disciples), but he’s saying JSON makes no sense for anything, ever. JSON may not be your cup of tea, but it’s faster than XML when used in Javascript (eval vs. parsing XML – sorry, but if you can’t figure that out, you’re just a dildo – only you probably get less sex) and for the most part, more human readable and writable.

Oh, but Dave Winer (Whiner?) gets even worse:

Dan, where are the benchmarks that say that on a processor capable of running Flash apps or playing Youtube videos that it can’t parse XML “cruft.” If you’re going to use an engineering argument, be prepared to back up t your assumptions with data. I’m pretty sure you can’t because I ran my own benchmarks on the end-user CPU of the late 90s and the overhead of parsing XML was negligable then, and now..? Geez Louise. How many gigahertz to people have these days??

XML parsing is a monumental task. This is clearly the ramblings of some dumbshit who’s never actually used SOAP, XML-RPC, or even plain old XML with XSLT on large data sets. Parsing tens of thousands of records (serialized from the Oracle DB because XML is so great) at my current job is a nightmare. XSLT transforms in some cases take 5 minutes or more, on blazing-fast hardware, using a C++ library (libxml and libxslt). In the late 90s, you’re going to try and tell me XML parsing had “negligable” (IT’S FUCKING SPELLED “negligible!”) overhead? What did you parse, “<hello />world” or something?

Fucking idiots. There’s a reason enterprises that were stupid enough to follow the XML trail are now buying XML-parsing hardware.


My comment is this – if you’re in the computer industry, don’t shoot your mouth off about things you’ve only thought about for 2 minutes while you jerked off to pictures of your dad. You sound like a moron when you do. Me, I’ve used XML in the real world. And a tiny bit of JSON, and a good deal of YAML (I even jerk off to YAML now and again). For marking up documents, XML is fine. For data that needs to be human-accessible, YAML and JSON are so incredibly superior, it’s a joke. Try them out in real situations before you make a total ass of yourself. Yes, I’m talking to you, Dave.

(Yes, I read his “ooh I dun learnt alot in that there diskusshins” follow-up. Ignorant bashing is ignorant bashing, regardless of your “oops” responses later, people)

Why Ruby is so sexy-awesome, part XXXIV

I use Ruby whenever I can. Not specifically with Rails – Rails extends the language and adds some nifty things, but the beauty is all Ruby’s.

Today I was using Ruby (in a Rails app, as it happens), and I had this “API” that returns generic hash data. I want to be able to take data from any source (Oracle, flat text, web service) and return data that’s in a very simple and easy-to-use format, so I chose to just convert data to a hash on a per-source basis.

But how do I handle typos in hash keys? What if somebody asks for “person[:name]” when they’re supposed to ask for “person[:full_name]”? They just get blank data and wonder WTF happened…. I can’t live with this situation, because it’s just too easy to forget a key’s name, or make a simple typo. I could return default data from the hash, such as “YOU FUCKED UP WITH YOUR KEY, SIRS”, but that could find its way into production and then I’m out a job.

So after a tiny bit of digging, I discovered that a Hash can not only have a default value, but also call a default block when a nonexistent key is requested:

irb(main):001:0> a = Hash.new {|hash, key| raise "#{key} not found!"}
=> {}
irb(main):005:0> a[1] = :foo
=> :foo
irb(main):006:0> a[1]
=> :foo
irb(main):007:0> a[2]
RuntimeError: 2 not found!
irb(main):008:0> a.default = nil
=> nil
irb(main):009:0> a[2]
=> nil

Normally I’m good with non-strict default data, but in this case it’s great to know I can actually validate data in a way that makes it hard to miss typos.

It’s not as safe as C++ (edge cases are only caught at runtime), but it’s far better than Perl (and nicer to read or write than both, IMO).

Laid off? The one thing you absolutely need to do if you’re rich or stupid

I like people who have no understanding of the average Joe, but preach to him anyway. They’re cute and their naivety is endearing in a certain way. I’m talking about you, Jason Kester.

Get laid off from your job, go take a six- to nine-month vacation. It’s the best time in the world to do so!

You have a pile of saving [sic] and a severance package.

Savings, maybe, though that’s not a given. Severance package, though? How many jobs even offer those anymore? Mine sure doesn’t (at least not below the Director level, which is where the majority of IT folks are), and I don’t work in a small place. Don’t preach to a group if you don’t even know anything about them.

I’m not going to bash the rationale behind this thought – I can really understand the suggestion for people who have the means to take this advice. What I just don’t get is Jason’s blanket advice that says basically nobody has an excuse of any kind not to do this:

But I don’t have any money saved…

You can’t possibly be serious. Are you saying that you’ve been working in IT for all these years and haven’t put away a lousy ten grand??? Shame on you. Get a book on life skills and open a bank account fer cryin’ out loud.

Wha…? Since when have all IT people been paid so well that $10k is (a) pocket change, and (b) something to throw away when times are hard? Hell, the most I’ve ever saved is $8k and that was to buy a house. And my salary isn’t even on the low end of the spectrum! Some people just live paycheck-to-paycheck by necessity, and condemning them for it is not only extremely snobby, but just proof you live in a bubble far from the real world. In San Fransisco, for instance, the average pay for a software engineer means barely scraping by or living an hour’s drive away. Sometimes both.

At both of my professional jobs, there have been software engineers paid low enough that two salaries are required if the people want to even own a shitty home, much less living nicely. Jason, you’re an ass.

But I’m married with a family and a house…

Ok, you win. You’re screwed, but that’s the life you chose for yourself so you’re going to have to live it. It’s worth noting, however, that most Europeans wouldn’t consider that a reason not to travel. Right this second, there is a German couple pushing a stroller down a remote beach in Thailand, and they’re not going home for another month. What’s your excuse again?

Wait, so we’re screwed if we chose to have a family? A house? What if we’re happy with this choice? Are we just too ignorant to see the error of our ways or something? I honestly don’t get what you are saying here. But again this speaks to ignorance on Jason’s part – he has no concept of giving up something you want to have something else you want (the house – I’m assuming if I say I’m happy to be married and have kids he’ll just say I’m lying to myself, but having a house is a tangible asset – even idiot snobs can understand that). He also has no concept of how expensive it is to take the whole family to Thailand for us IT people paid a “normal” salary. He also doesn’t understand that sometimes kids are in school or that the spouse of the laid-off IT person has their own job.

But the most amazing piece: he doesn’t understand that some of us who actually do have the severance, the extra $10k, and everything else may not want to take the time off. Maybe it took me years to save $10k, and I don’t want to blow it on a trip when I could increase that savings instead. Maybe I am hoping to get a million in the bank before I retire, and every year I work hard gets me 5% closer to that goal, whereas just disappearing drops me by 5% instead. Maybe I want to really enjoy my 40s or 50s instead of waste my disposable income on a one-time trip that will screw up other goals in my life.

Then again, maybe Jason is just a stuck-up, ignorant white guy who simply hasn’t got a clue.

Intuit’s Evil Empire: Quicken Deluxe 2005 Strikes Back

I have always used Quicken for the most minimalistic of checkbook balancing. For some reason, even though the newer versions have continued to get bigger and more bloated, I’ve continued to stick with them, and even paid for the pile of rat dung they call Quicken Deluxe 2005.

Hating Intuit was a dangerous choice, as it turns out. Starting in 2005 editions, Intuit apparently added in the ability to disable select features after a three year period. For those of us who rely on, say, importing transactions from our bank, we’re just screwed through and through. Raped, more like. Violently. With broomsticks, chains, whips, and random jolts of high-voltage electricity.

How can a company as big as Intuit actually get away with something like this? It’s pretty much blackmail – won’t their users get as disgusted as I did and look for other options?

Maybe it doesn’t even matter. Because I did that. I looked at the other options. I looked at Moneydance. I looked at Gnucash. I looked at a few others whose names I forgot about as fast as it took me to run their uninstall programs. I avoided MS Money because I’ve heard it’s just as bad as Quicken in terms of the BS they’ve added in over the years.

In the end, I wasted a couple hours just to buy Quicken 2008.

I’m amazed at how utterly shitty the competition is. I’m a software designer for a living, and I’ve even worked on accounting software at my last job, so I know how challenging it can be to design something as big as a knock-off of a really successful accounting package. And for the freeware options, I can hardly fault them for sucking – they’re free. Gnucash looks promising if you’re an accountant. Plus, it couldn’t deal with downloaded transactions even a tenth as nicely as Quicken. Moneydance, a commercial app, was written wholly in Java, making its UI anything but consistent with other Windows apps. Plus, it couldn’t deal with downloaded transactions even as well as Gnucash. Another app, another set of problems, plus they couldn’t fucking deal with downloaded transactions nicely.

I can’t figure it out. For all of Intuit’s crap, for all Quicken’s painful UI decisions, it’s still the best app for somebody who just wants to download transactions and keep a single checking account balanced. Weird.

Dotproject strikes again…

I’m sure I’ve bitched about open source plenty of times, but I have to rant once again. Dotproject is my project management application of choice. It does everything I want, and in particular allows for very awesome time estimation which was extremely useful for Bloodsport Colosseum. I was able to break down every task into subtasks and really get a feel for how much effort was left by looking at the accuracy of past estimates.

But it’s programmed by idiots. I mean, these guys are actually pretty stupid compared to the average rock. I’m sorry, it’s a great tool designed by somebody who had a head for project management, but programmed by idiots.

After not using dotproject for a while (after the death of bloodsport colosseum, I had little to track), I got a contract job that really needs careful design. So I jumped back into a semi-recent version of this awesome/disgusting app, and found that it uses overlib for popup help! (No, that isn’t the problem. Overlib is actually really nice for web-based hover-help) But the dotproject devs by default chose to make the popups STICKY. That is, when you hover over a link you think is just a link, a popup shows up that will not go away until you explicitly mouse over the “close” button.

This is revolting.

So I know overlib. I’m not phased a bit. I used it for Bloodsport Colosseum and it’s really a pretty straightforward JS library (a rarity these days). It’s open source, so it probably sucks monkey balls, but as a user of the tool, I liked it.

Overlib has a central area to put all your app’s default preferences for things like font, colors, opacity, and, of course, sticky. To override the defaults, you can actually specify “commands” in your call to the overlib methods, which is handy for special cases.

The dotproject dimwits actually ignored the defaults altogether, and put the exact same preferences into their HTML in seven different places. I’m not sure what can happen to a programmer where they learn the number one failing of software. The first thing you learn in your first CS class is about code reuse. Functions, code centralization, that sort of shit. HOW can somebody be so stupid as to ignore these amazingly simple principles when the library already provides a really easy and central place for this stuff?

Then I remembered my first dotproject disaster – an old version had some broken SQL for calculating the % left on a task, and to fix it I had to change this SQL in 3 or 4 places, and rewrite a couple rather large sections of code.

No, that memory didn’t comfort me, but at least I was able to say, “Oh yeah, they’re just dotproject developers. They didn’t know better.”

Twilight of the Arnor officially released!

All right, I’m a couple days late, but one of my all-time favorite games, Galactic Civilizations 2, has just released what I believe to be the most impressive expansion pack ever, Twilight of the Arnor.

I’ve played with the beta a bit, but now that it’s officially released (and the weekend is here), I am hoping to dig in a whole lot more, play some metaverse games, and maybe even tinker with the editors.

Why would you care about this release? Read on:


GalCiv2 is a 4X game (think of Civilizations, Age of Wonders, Heroes of Might and Magic, etc). These kinds of games have traditionally been somewhat complex, turn-based strategy games. Think of a game like the board game Risk, but with a whole lot more details, rules, military options, diplomacy, randomly-generated maps (or at least a large collection of hand-crafted maps), etc.

The biggest issue with games like these is there are so many options at every point of the games that a computer cannot effectively plan out a smart strategy. Most games give the computer cheats – free resources, “good luck” bonuses when attacking or defending territory, free military units, the ability to see the player’s private data, and so on. This is frustrating to a player, because instead of playing against a human-like opponent, she’s playing against what amounts to a really stupid cheater. The cheater isn’t playing by the rules, yet still really sucks at planning a long-term strategy.

Stardock, at least starting with GalCiv 2, doesn’t believe the AI should need to cheat. (In GalCiv1, the AI got a free peek at the galaxy, giving it a tremendous advantage when choosing where to colonize and such) Additionally, the AI is built with the philosophy that it should play like a human, so at various difficulty levels, the strategies actually vary. When you play against a “cakewalk” set of AI opponents, they will have fewer strategic options available than when playing against “normal”, which itself has fewer options than playing against “tough”. This amounts to a much more immersive single-player game.

The other thing that tends to plague most 4X games is repetition. Even GalCiv1, and to a lesser degree, GalCiv2, suffered from this problem. The thing is, all playable situations eventually amount to the same general approaches. In Civilization III, you have a couple civ-specific military units, and some bonus depending on your empire’s specialties, but overall very little is different from any one game to the next: you research the same technology, most military units are the same, cities build the same improvements, etc. The heroes series is a tiny bit better, as each faction has a semi-unique city and units, but even so, the game is so simple that the differentiation doesn’t change the repetitive play.

I love both of those games, but I cannot deny their inherent problem. And as I stated above, even GalCiv2 (even with the Dark Avatar expansion) suffered from this issue. Dark Avatar made each race a bit more unique with the Super Abilities, but overall strategies, technologies, and planetary improvements were all shared.

Twilight of the Arnor throws this all away. What GalCiv2 did for the belief that all 4X AI has to suck, Twilight of the Arnor does for the belief that repetitive play is just a part of the 4X genre. Every single race (there are twelve, mind you) has its own technology tree, planetary improvements, and to a lesser degree, ship modules. The tech trees have many common elements, of course, and some races are very similar to each other. The Korath, for instance, are an offshoot of the Drengin, so their tech trees are naturally very similar – but there are still a few differences, and the already-present racial attributes and super abilities make even those two situations a bit different. When looking at the Humans and the Thalan, on the other hand, the trees and overall strategies are so different that it’s like playing a totally separate game.

Here are some of my favorite examples:

  • The Korx are mercenaries, and as such have a Mercenary Academy, available from the Mercenaries tech, and “unique” to them and the Drath (both races have some slant on war manipulation). When the academy is built, they get a bonus to their income equal to 2% of the tax revenues of all warring civilizations.
    • In Dark Avatar, the Korx are described as mercenaries and war profiteers, but you only feel that when role-playing. In Twilight, you see a direct, in-game benefit to manipulating people into war.
  • The Arceans have a lot of trouble with space travel. Their ships default to moving at a rate of 2 parsec per turn (normal is 3 – this is a HUGE deal early game!), and they cannot develop the technology to use advanced ship drives, severely limiting their speed late game. They can trade for the technology (which I dislike, but that’s a separate topic), but if it’s entirely up to them, they’ll never learn it. To compensate, they have a few technologies that give them a “free” bonus to ship speed (research tech, instant bonus to all ships), and the ability to build navigation centers on their planets which give all ships built on that planet another “free” bonus.
    • This alone is a huge strategy change – you either trade for the techs and play a “normal” game, or you just live with slower ships. One interesting aspect of this is that you will have a lot more space for weapons, which is great given the existing Arcean Super Warrior ability.

Assuming this wasn’t enough, Twilight sports a ton of other features I can’t even try to explain. Amazing modder tools are finally included, “static” tournament scenarios, the new Ascension victory condition, terror stars, …

If you’ve never heard of GalCiv2, but you like 4X games, there is no better time to try it out.

A new day, a new blogging app

Typo seems cool to us Ruby on Rails jerks. Because it’s Ruby on Rails. It has sexy live searching. Um… and like… did I mention it’s Ruby on Rails?

So… yeah. After the thing sucking time and again, and eating too much memory and having funny stability problems, I’ve given up. I have enough annoyances with Ruby on Rails apps (I truly hope mod_rails helps here – stay tuned for my upcoming first impressions) that I wrote myself – no need to make things worse with badly-built open source.

So here I am on WordPress. I’m willing to bet it’s just another badly-build open source app. The difference, though, is it’s been around the block, and seems to have some stability under the hood. It wasn’t written with the “do what’s cool right now!” approach – it has been more geared toward functionality. So as much as I despise PHP, I can’t deny that this app is much nicer to deal with than Typo ever was. Even the conversion of my old articles was about a 10 minute process, thanks to Will Bridges. And with some minor tweaks, I now have a (hopefully) nicer URL structure.

Yeah, I’ll lose some SEO in the mean time – major site change, loss of something like 50 old URLs, but hell, it’s time for something that isn’t a headache.

I’m sick of Mongrel

I’ve been running my Rails apps (this blog as well as Bloodsport Colosseum) via mod_proxy and mongrel. Run a mongrel server at a given port, tell Apache to redirect a given virtual host to said port. Takes a lot more knowledge than a noob like me has, so even though it’s better than dealing with fastcgi + Apache or lighttpd, it’s still annoying.

Once I got it up and running, however, I figured it was good enough – everything worked, so all was well. Until I had apps that weren’t hit very often. Bloodsport Colosseum is hit pretty regularly, and this blog seems to get pinged by random sources all the time, so both worked well. But my now-deceased fanmail app (granted it was really far too simple to warrant the RoR framework, but that’s a whole different story) was hit maybe every few days.

Mongrel did not like this for some reason. It seems that any app that isn’t getting regular hits just dies after a while. I read somewhere that it was mysql’s fault, closing the socket or something like that. Interestingly, my PHP apps that use mysql don’t have that problem, and on my last server (privately hosted by a friend and using fastcgi), my Rails apps didn’t have that problem.

Okay, fanmail app was kind of unnecessary anyway – I can just put my smart and not at all fat fan’s letters of praise on the main site, run via PHP, and that’ll be good enough.

Then I for once blogged a popular topic – the Network Solutions “scandal”. I was actually #3 on google for the search “network solutions domain name front running” for a little while. But the next day when I checked how things were going, I noticed that mongrel was “running”, but not responding, much like what I saw when an app wasn’t hit regularly. The process list would show a mongrel process using almost no memory (very atypical of a Rails app), and Apache would give an error that the proxying couldn’t happen. So the one time I’m really getting visitors (About 100x normal traffic levels for my shitty blog), within about an hour mongrel had decided it had enough.

I don’t believe mongrel can’t handle large traffic loads, I just think my lack of skills combined with mongrel’s funky behavior problems caused issues.

All in all, I’m tired of that – Mongrel keeps misbehaving, and I’m DONE. Time for something new. I’m trying out Phusion Passenger tonight and we’ll see how it goes.

If you’re not smart enough to program, don’t write a programming guide

I can’t believe this. Simply amazing.

I really can’t.

I’m not even sure this is good enough to fall under my usual “Awesome Software Discovery” banner.

So I work at a place where we use Ruby and Perl a lot, right? The above site is supposedly a “conversion” of O’Rielly’s Perl Cookbook into Ruby. Good idea. But here’s the thing – if you don’t know your ass from a hole in the ground, maybe you shouldn’t be writing a programming guide. Maybe. I don’t know. Am I being too harsh?

The introduction shows this example:

# $defout (or its synonym '$>') is the destination of output
# for Kernel#print, Kernel#puts, and family functions
logfile = File.new("log.txt", "w")
old = $defout
$defout = logfile                 # switch to logfile for output
puts "Countdown initiated ..."
$defout = old                     # return to original output
puts "You have 30 seconds to reach minimum safety distance."

There is no fucking excuse for this kind of programming style. Even a total noob should look at this and say, “What the fuck?”

  1. Yes, sometimes you need to redirect output or errors to a file… but the introduction doesn’t explain that this is an exception rather than a rule.
  2. Redirecting $defout is very dangerous if the developer doesn’t fully understand 100% of what they’re writing, and the libraries they’re using. (And if they need a perl-to-ruby cookbook, chances are they don’t understand 100% of what they’re writing)
  3. Maybe I’m misreading something, but isn’t it significantly safer in an app more than 3 lines long to call .dup on $stdout / $defout when saving the old value? (The answer is “yes,” for my less astute readers)

In any case, here’s how you write to a file in Ruby without making the guy who reviews your code cringe and then stab you in the fucking eye (note that it’s not only safer, but also easier to read and generally doesn’t make you look like a moron):

# $defout, $stdout, and other magic variables are NOT TOUCHED!
logfile = File.new("log.txt", "w")
logfile.puts "Countdown initiated..."
puts "You have 30 seconds blah blah I'm a monkey licker."

Neat!

Wait, are you saying those thieves aren’t destroying the world after all?

I’m a huge fan of Stardock. They kick ass hands down. Galactic Civilizations II, especially with the expansions Dark Avatar and the still-in-beta Twilight of the Arnor, blows away other 4x games that exist today. Civ 4 is so far behind in terms of AI and economic complexity (while still having way too much micromanagement anyway), it’s just amazing.

Then Brad Wardell, CEO of Stardock, has to post this incredible claim that piracy isn’t the root cause for everything bad that happens to us today. Here’s an excerpt of this poor, deluded fool’s insanity:

Blaming piracy is easy. But it hides other underlying causes. When Sins popped up as the #1 best selling game at retail a couple weeks ago, a game that has no copy protect whatsoever, that should tell you that piracy is not the primary issue.

Now many of you out there may fall for this kind of pro-terrorist propaganda, but not me. I’ve seen the DVD commercials that tell me how piracy is just like stealing a car and how it supports terrorism and kills babies and causes hurricanes and the apocalypse is coming early because of torrents. I’m no fool. You morons can go on believing that Hollywood is going to hell because of poor quality movies that nobody wants to pay to see. You can keep convincing yourselves that the record industry is going to be okay and Amazon.com’s DRM-free MP3 sales are proof. And you can say that a game can sell well even if it has no copy protection.

I’ll pray for your souls. I can only hope the very intelligent entertainment companies find a way to not only jail all the pirates (victimless crime my ass!), but also those who spread these filthy, disgusting, dirty dirty lies.

Brad Wardell, you’re now on my “list”. Watch your back, buddy. Watch your fucking back.