ASP.NET versus agile web frameworks
August 4, 2006 – 4:57 amFor a new project I’m embarking on, I have to use Microsoft’s web stack, which means Windows / IIS / ASP.NET / MSSQL. As I usually use free software for web (and other) applications, I’m new to ASP.NET and I’ve spent a couple of hours researching the technology.
I’m used to (or spoiled by) agile stuff one can find in today’s modern web frameworks (I personally like TurboGears), so the next sentence isn’t much of a surprise: ASP.NET sucks enormously compared to these “scripting” guys. Consider the following ASP.NET example, for creating a custom web “control” which outputs some bar charts:
output.WriteBeginTag("table");
output.WriteAttribute("bgcolor", BackColor.Name);
output.WriteAttribute("border", "1");
output.WriteAttribute("cellspacing", "0");
output.WriteAttribute("cellpadding", "0");
output.WriteAttribute("width", Width.ToString());
output.WriteAttribute("height", Height.ToString());
output.Write(HtmlTextWriter.TagRightChar);
output.WriteFullBeginTag("tr");
output.WriteBeginTag("td");
output.WriteAttribute("colspan", BarCount.ToString());
output.WriteAttribute("align", "center");
output.WriteAttribute("height", "10%");
output.Write(HtmlTextWriter.TagRightChar);
output.Write(Title);
output.WriteEndTag("td");
output.WriteEndTag("tr");
output.WriteFullBeginTag("tr");
output.WriteBeginTag("td");
output.WriteAttribute("colspan", BarCount.ToString());
output.WriteAttribute("align", "center");
output.WriteAttribute("height", "90%");
output.Write(HtmlTextWriter.TagRightChar);
DrawChartTable(output);
output.WriteEndTag("td");
output.WriteEndTag("tr");
output.WriteEndTag("table");
This is just for displaying the border (actually, a just table with two cells), without really drawing the charts. If you haven’t closed this page in disgust already, you might’ve noticed what the above code does. It’s an extremely verbose way of outputting a table. Even PHP’s dreaded echo is more readable than this cruft, not to mention Rails’, Djangos or TurboGears’ templating systems…

