February 2008 - Posts

I've recently renewed my effort to "use the right tool for the job" when developing xhtml and CSS, which got me to thinking. If using a <ul> rather than a <div> is better in a certain application, are there better ASP.NET tools for other jobs?

With that mindset I came across a task that required connecting to one of our databases. Rather than building a DAL (and no, I'm not LINQified yet) I decided to just grab the data though a SqlConnection and go from there. So far so good. I then was faced with how to "deal" with the stuff returned from the SqlCommand. Here ASP.NET has a couple controls that do can read the data from your SqlCommand: DataReader and DataSet. But which to use?

I've always been partial to using what you know, and knowing what you use. So for almost all my cases I've used the DataSet control. This has allowed me to not only get stuff out of a database, but update and insert stuff as well. In those cases, DataSet is ideal. But, with all that extra functionality comes extra overhead.

DataReader, on the other hand, doesn't "do everything for you" and then some. It does its job, and does it well, and doesn't do anything else (sound like a UNIX concept, doesn't it?). With DataReader you are doing just that, reading the data from the database, and handling it (parsing it into an object, writing it onto the page, etc.), and closing the SqlConnection.

For details and a chart that illustrates the point, see my article on JoeTheWebGuy.net.

In ASP.NET 1.1 it was a pain to maintain the position of the scrollbar when doing a postback operation.

In ASP.NET 2.0 it's not so hard... To see how I fixed this see my article on JoeTheWebGuy.net.

For a good long time we developers have been using Arial as the default font that we've used for all of our san-serifed needs, most of us too young to know why, or where it came from.

Arial is a hybrid between Helvetica and Grotesque, which mimics the same weight and dimensions of Helvetica, but using many of Grotesque's "parts" (for lack of a better word).

Arial (and all of its copycat brothers) came from Helvetica having been built into the firmware of printers, and needing something that could be "swapped out" as an equivalent. Arial is not alone in its copycatting of  Helvetica, many others did it so they wouldn't have to pay fees to license Helvetica. One of the benefactors of Arial was a little company known as Microsoft.

Bundled with Windows and every version of Microsoft Office (including those for Mac), Arial soon became the font to use, even though it's arguably not as nice as Helvetica. Even Yahoo! with their YUI 2.4.1 uses Arial preferentially over Helvetica in their fonts.css file.

I argue that Helvetica is better than Arial, and Arial is simply a "knocked off" version of Hevletica, and not an improvement. Therefore, YUI (and your stylesheets) should reflect this accordingly, as such: font-family: helvetica,arial,clean,sans-serif;

That having been said, there are fonts that have theoretically improved over basic Helvetica and Arial for on-screen readability. Verdana, Tahoma, and Calibri, for example, could be argued to be improved and designed specifically for use on monitors and other displays (rather than the printed page, as was the media that Helvetica and Arial were designed).

Thoughts? 

Also published on JoeTheWebGuy.net.

More Posts