Monday
Jul072008
Concise Code - Does it make things hard to read?
Eric Phan |
Monday 07 July 2008 at 07:50 AM I was using Resharper 4 and noticed some nice code cleanup advise that it gives. One to note it the compression of:
// Create job if quote is won
if (CurrentQuote.Status == "A")
{
quoteView.FindControl("btnCreateJobCard").Visible = true;
}
else
{
quoteView.FindControl("btnCreateJobCard").Visible = false;
}
To the one liner (which I prefer)
// Create job if quote is won
quoteView.FindControl("btnCreateJobCard").Visible = CurrentQuote.Status == "A";
I like short succinct code. I think the shortened form is better, but I know some people need to do a double take to see what it’s trying to do.
I would love to hear your opinions on this.
tagged
.NET,
Resharper in
Development
.NET,
Resharper in
Development 
Reader Comments