Bill Blogs in C#

Bill Wagner discusses C#, LINQ, and other items of interest

Clarifying my comments on Previous Post

My last post generated valid criticisms from readers. Let’s clarify and correct that.

Keith Elder commented:

I got the impression reading your post that you "skimmed" my article and didn't really get what it was I was getting at.
[…]

The whole point of this is C# 3.0 can be written where it is unreadable (lambda as an example) but it can also make the code 200% more readable than the old way by combining several features, not just one.

Although you say you disagree, I know we both agree because we both agree the LINQ example is the most readable.  Hugs all around :)

Fair enough. The title of Keith’s post certainly led me to conclude that his point was that the new syntax made for less readable code. Not his intent, and clearly my fault.  My apologies for misinterpreting your intent.

Sean comments:

 

On the "don't use it just to use it" idea, I admit that just throwing something in can be reckless, how can you know when to use it if you don't blatantly experiment with it?

I would advocate ‘blatantly experimenting with it’. It’s a great way to learn where new features can help, and when you’ll run into weaknesses with that new feature.

But…

Before declaring a task done, take a moment and do your own review of the code.  In this sense, much like Keith explored multiple solutions in his blog post, look at alternatives, determine which is the most readable, and maintainable, and go with it.

Another important technique to learn new techniques is reading code. Scott Hanselman’s “Weekly Source Code” series is great example of how to do that.

Published Sat, Oct 11 2008 3:21 PM by wwagner
Filed under: , ,

Comments

# re: Clarifying my comments on Previous Post@ Sunday, October 12, 2008 11:20 PM

It sometimes can be really hard to tell the difference "using this (LINQ) becasue it's the shiny new thing from Micrsoft" and "this (LINQ again) really solves my particular problem".

The right reason to use LINQ is because it is a good solution, not just because it's new.  Care to provide any advice on telling the two apart?

# re: Clarifying my comments on Previous Post@ Monday, October 13, 2008 9:38 AM

"Before declaring a task done, take a moment and do your own review of the code.  In this sense, much like Keith explored multiple solutions in his blog post, look at alternatives, determine which is the most readable, and maintainable, and go with it."

Absolutely agree.

Although this cross blog discussion hits on something that difficult to nail down: readability.  The old adage about one man's treasure really fits this.

by Sean

# re: Clarifying my comments on Previous Post@ Tuesday, October 21, 2008 11:11 AM

I just wanted to say Bill that I think it is very classy of you to follow up with this post.  

Very classy sir.

-Keith