Saturday, April 4, 2009

A query for the ages

On a normal day, I write about 10 different queries sql queries. And they mainly are composed of selects, updates, deletes, and inserts using things like inner joins, inner joins of inner joins, where, like, top 1, orber by, group by, count, max, etc., etc. I've gotten really good at it, and can do these half asleep usually error free the first time.

Today though, I had to branch out of my comfort zone and use for the first time (on top of everything above) coalesces of coalesces, outer joins, cases, havings, and more in one single query. Been working on one query pretty much all day, and I must say I'm proud of it. I'm taking mutiple queries, and queries that would branch off after another query, and turning something that would require a minimum of 1-2 seconds to complete into a complex recordset that gets formed in one shot.

Another thing I decided to do is improve my javascript skills. I'd say I know html, css, T-SQL and ASP inside and out, and can practically look at any web application/site and break it down and remake it from scratch. But where I never really concentrated too much time was on javascript. If you want to do anything interactive after the page has loaded has to be done by javascript. And I felt hungry to learn this weekend.

Another thing I played with yesterday was XML. I've been avoiding XML like the plague because everything I do, I always have a SQL Server backend. I have to say that with everything I've tried so far, making, reading, adding, deleting, and editing XML with code, I really hate the syntax. I feel like I can write a more simpler and easy to version of xml if you give me a few hours. One thing I wouldn't do is use words like childNodes, createElement, appendChild. I think we have more meaningful and shorter words in the english language. The word Elements or Nodes doesn't add to or take away from visualizing the structure of the data. Its like adding confusion to your code by writing confusing comments and being too general. Childs should have parents. If you're going to have a root, you should have trees and branches, not childs. And the whole thing about converting to XSLT to do stuff with it. As if loading an XML file and parsing through strings wasn't inefficient enough. After I got there, I decided these guys are just whacking eachother off trying to invent names for the smallest of things. The best thing about XML is that its universal. But I'd say if they really collaborated, we can achive something a lot more sophisticated, a lot more powerful but easy to use as sql queries and recordsets, a lot faster, and a thousand times more efficient. All the big players of every framework need to have a big sitdown and hash out a killer standard that should last through at least a decade.

No comments:

Post a Comment