Blogs

dxRAM - Richard Morris' DevExpress blog

How refactor helps me use new language features (AKA Pair programming with Dustin).

     

There was a time that I was pretty invested in the latest language features.  In the late 90s during my Delphi era I used to speak at conferences on new language features, would start every conversation with the compiler dev team with "When will you implement Design by Contract" , and would actively seek out new features of every new compiler release and find ways to use every new feature. It didn't take much rationalization to justify using the latest language feature in whatever code I was building, and I must admit I wrote some pretty arcane code in my time.

These days I no longer live on the language leading edge, I program in C# or VB.NET or Delphi Prism to get the task done and I'll let you in on a secret ... with the exception I guess of LINQ I don't really use many new Language features.  Sure, I understand what anonymous methods and lambda expressions are, but to me they seem to be simply building blocks needed to get to LINQ rather than essential features the the Language that demanded inclusion for their own sake. So I have not invested too much time learning everything there is to know about these new language constructs.  In the immortal words of Roger Murtagh: "I'm too old for this ... errr ... stuff"

Sometimes it seems to me that it is possible that being able to convert an expression to a delegate or compress it to a lambda expression results in cleaner looking code.  And this is where Refactor Pro comes in, Refactor is able to parse my code and tell me when an expression can be converted to use a new Language feature.  I don't have to know much if anything about the feature, I just trust that Refactor will create correct code - and if the result looks cleaner I go for it, and if not I can simply Ctrl-Z undo.

 

Since one of the key developers of this feature was Dustin Campbell, F# expert, C# MVP and VB PM for Microsoft I am fairly confident that the resulting code will be superb.  It's as if I am pair programming with someone who I can trust to learn all this arcana for me and suggest how to improve my code, and I can focus on the problem domain. 

Interview with Dustin

It's like in my universe ... Clippy has been retasked to Visual Studio except he's been replaced by a little Dustin and he has to check all of my code before it gets checked in.

Published Jun 08 2009, 04:05 PM by Richard Morris (DevExpress)
Filed under: , , ,
Technorati tags: Lambdas, Dustin, Clippy, Refactor
Bookmark and Share

Comments

 

Dustin Campbell said:

FYI: The little Dustin that appears in Visual Studio 2010 (often wagging his finger or shaking his head in disapproval) is a slimmer version that the one found in that video. We've rebuilt him. Better, stronger, faster. Thinner.

June 9, 2009 10:15 AM
 

Richard Morris (DevExpress) said:

I would love a little anime Dustin running around my code surface pointing at smells and making faces, and when idle just playing some jazz - it would be like a Neko for Nerds.

June 9, 2009 11:30 AM

About Richard Morris (DevExpress)

Richard is a developer living in Batemans Bay, Australia, about 4 hours south of Sydney. He blogs and tweets for Developer Express, and develops applications for Campbell Page an Australian charity that helps Australians find jobs.
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.