AspAlliance Author Profile
Name Steven Archibald
Column Name The Clever Coder
Average Article Rating N/A
Join Date 03 Aug 2005
Birthday 01 Aug
Location Alameda, CA, USA Send Feedback
Bio
Blog (Html)  
Blog (RSS) http://feeds.feedburner.com/theclevercoder RSS Feed 
My Blog
tag:blogger.com,1999:blog-152626622014-10-05T00:27:19.872-07:00theCleverCoderPhilosophical musings on the practice of software development. Adhering to the maxim: Just because you can, doesn't mean you should ...TheCleverCoderhttp://www.blogger.com/profile/04887434701481007002noreply@blogger.comBlogger3125This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.tag:blogger.com,1999:blog-15262662.post-1127176519238290902005-09-19T17:27:00.000-07:002005-09-19T21:52:06.536-07:00C# Does Not A .NET Application Make ...<p><span style="font-family:Verdana;font-size:85%;">In my current consulting gig, I'm working on an application that was developed and delivered by a large offshore company. While the history is somewhat murky, my understanding is that the client wanted an ASP.NET application. This was back in the days of 1.0. The vendor assured the client that they were quite familiar and experienced with ASP.NET. What was actually delivered was the most unusual amalgam of code that I've seen since .NET was released (even in Beta form). It is a wasteful <a title="http://www.hyperdictionary.com/search.aspx?define=" href="http://www.hyperdictionary.com/search.aspx?define=chimera" target="_blank">chimera</a>. See particularly the first definition of the word. Essentially, what my client has, is a CGI application with a C# back-end. It is a classic example of "Just because you can, doesn't mean you should ...".</span></p> <p><span style="font-family:Verdana;font-size:85%;">Why do I state this? Certainly, if you look at the folder contents, it LOOKS like an ASP.NET application. There are web pages coded as .aspx files and .aspx.cs files. There are data access projects coded with just straight .cs files. It has layers defined as UI, Business Facade, Business Rules, and Data Access. The .aspx files are wired to the appropriate .aspx.cs files...</span></p> <p><span style="font-family:Verdana;font-size:85%;">Closer examination, and some excruciating code modifications, reveals a "dark underbelly" of the code. Consider the following:</span> </p><ul><li><span style="font-family:Verdana;font-size:85%;">Almost none of the pages use web server controls. Except for some repeaters added after the product was delivered, everything is done as HTML controls with a "runat='server'" attribute.</span> <li><span style="font-family:Verdana;font-size:85%;">While the .aspx pages do validation, it is ALL done with custom JavaScript code - not a single .net validation control is used. As a consequence, there are no corresponding server side validations done. Not good for a financial institution.</span> <li><span style="font-family:Verdana;font-size:85%;">Hidden fields are used liberally on every page to maintain viewstate - not only in the code behind module, but with custom JavaScript on the page.</span> <li><span style="font-family:Verdana;font-size:85%;">Similarly custom flags are used to determine whether a post is the first post or not.</span> </li> </ul> <p><span style="font-family:Verdana;font-size:85%;">In effect, the vendor completely ignored almost ALL the benefits of ASP.NET, and re-coded all of the same in custom JavaScript and code behind modules. So, it's not as type-safe as it could be, it's MUCH harder to maintain, and about 60% of the code is totally redundant. That's not counting the inordinate number of useless comment lines such as the following (made up but representative example).</span></p> <span style="font-family:Verdana;font-size:85%;"><p>// create the business object</p><p> ObjectBusiness objBus = new ObjectBusiness();</p></span> <p><span style="font-family:Verdana;font-size:85%;">Comments such as these are generally created by neophyte object oriented programmers who have to explain what the syntax means.</span> </p> <p><span style="font-family:Verdana;font-size:85%;">And finally, most of the code is in the wrong place. Had it been done as a more standard, web-server-control-based ASP.NET application, most of the code would be in the code behind module and would be much smaller. I recently finished modifying a page at this client, and most of the work was done in a 200+ line button click event handler in JavaScript. It has so much spaghetti-code, I eventually had to just put in a slew of "debugger;" statements and walk through the JavaScript. Based on the test runs, I'd say half of the code for the event handler is vestigial. </span> </p> <p><span style="font-family:Verdana;font-size:85%;">So what can be done about this? Basically, nothing. The code is what it is. It works for the most part. But it's getting harder and harder to maintain. No one really knows what code can be eliminated. But I'm just contracting here, and my contract ends near the end of December. So now I have a better set of questions to ask of a company when I am interviewed, and it is my turn to interview them.</span></p> <ul><li><span style="font-family:Verdana;font-size:85%;">Does your application use primarily web server controls, or HTML controls?</span></li> <span style="font-family:Verdana;font-size:85%;"></span><li><span style="font-family:Verdana;font-size:85%;">Do you use .NET validation controls?</span> <li><span style="font-family:Verdana;font-size:85%;">Do your pages have a lot of hidden fields?</span> <li><span style="font-family:Verdana;font-size:85%;">Do you have your own code to manage the state of the hidden fields?</span> </li></ul><span style="font-family:Verdana;font-size:85%;">Finally, there are some architectural issues that this rant does not deal with. I'll do that in another post.</span> <p><span style="font-family:Verdana;font-size:85%;">Cheers!</span> </p>TheCleverCoderhttp://www.blogger.com/profile/04887434701481007002noreply@blogger.com7http://theclevercoder.blogspot.com/2005/09/c-does-not-net-application-make.htmltag:blogger.com,1999:blog-15262662.post-1123772889627452392005-08-11T08:05:00.000-07:002005-08-11T08:10:09.356-07:00First Article Published<span style="font-family:verdana;">Yesterday, my first technical article was published on AspAlliance.com! It's an article about creating and using an ASP.NET custom .config file. It's quite exciting to have an article published in this venue!</span> If you are interested, simply click on the heading above to be taken to the article. I hope you enjoy the article -- both from a standpoint of enjoying my writing style, and from the standpoint of providing some clever approaches to a coding problem. Cheers!TheCleverCoderhttp://www.blogger.com/profile/04887434701481007002noreply@blogger.com1http://theclevercoder.blogspot.com/2005/08/first-article-published.htmltag:blogger.com,1999:blog-15262662.post-1123611918126805622005-08-09T11:17:00.000-07:002005-08-09T14:43:49.843-07:00Clueless Software<span style="font-family:verdana;">At my current gig, the client is using Rational Suite. This morning, I attempted to find a list of the files I currently have checked out. This was actually relatively easy to do. I'm currently working on several tickets, and wanted to sort and print the list so I could easily identify which files were associated with each ticket. Again, relatively easy to do. Since some of the files had to be un-checked out, (the ticket was cancelled after work was done ...), I wanted to print the list. NOT easy to do. At first, I thought I was just missing something; or a required permission in the software had not been granted to me. But I checked with another developer who has been here for some time and my initial impression was correct. The only way to get a print-out was to do a screen print!</span> <span style="font-family:Verdana;"></span> <span style="font-family:Verdana;">Now I understand that analyzing useabliity can cost a lot of money, and end up causing some modifications to the code and UI, which costs even more money. Not every company can afford this. But Rational? Owned by IBM? At the least, couldn't they just COPY the UI functionality that Microsoft has? How can a company that presents itself as a premier provider, provide a report that can't be printed?</span> <span style="font-family:Verdana;"></span> <span style="font-family:Verdana;">Brain-dead software.</span>TheCleverCoderhttp://www.blogger.com/profile/04887434701481007002noreply@blogger.com0http://theclevercoder.blogspot.com/2005/08/clueless-software.html

AspAlliance Articles  Articles RSS Feed
20 Sep 2005 Override the Standard Status Bar Message of the DataGrid
10 Aug 2005 Create and Use a Custom Config File





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-03-27 10:34:39 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search