Spaghetti code? No I dont think so

I just wrote this while working on the IssueTracker.NET project:


<tr>
<th>
        - </th>
</tr>
<tr>
<td>
       </td>
</tr>

Now some will look at this and be thinking eurgh!… why is he writing classic ASP style spaghetti code and that’s the point, since when did writing code in the page == spaghetti code? I believe that spaghetti code originated because of the shortcomings of ASP 3.0 not allowing us to separate UI concerns from other concerns, but we don’t have this problem in ASP.NET we can quite nicely have our seperate objects in other layers deal with persistence, domain etc… and the code on our pages can deal just with what they are supposed to the UI.

This is why when I look at the code above I don’t think eurgh! because it’s not dealing with anything other than concerns of the UI and in the case above displaying any comments assigned  to the current issue and in my opinion it reads quite well.

Advertisements