Thanks to DevExpress CodeRush CodeIssues it has taught me a simplified initiation of object
I am a VB.NET programmer, don’t hold it against me
I have learnt alot of C# by having to modify OpenSource projects that use C# and personally I can’t see much difference other than what your use to “Reading” syntax wise. I haven’t come across anything that C# can do that VB.NET can’t and that has mostly to do with the MSIL (the language that both C# and VB.NET get compiled into).
The thing I like about CodeRush is it is completely Language independant, if you perform a Property Temple like “pi” it will generate a VB.NET Property as Integer in a VB project or a C# Property as Int in a C# project. Recently with DevExpress releasing v9.2 of their products they had a major performance improvement in their CodeRush add-in for Visual Studio. I heavily use RefactorPro! and CodeRush and when Mark announce CodeIssues a while back I tried to use it however it seemed a little unstable back then. A completely different story with v9.2.
CodeIssues scans your code and provides you with Suggestions to “improve” your code, these suggestions can be major like missing conditions, to just cleaning up code such as the “Rename File to match Class”. During using this I keep finding new ways to represent code and one thing I found interesting recently was this snippet
Dim newObj As New Diag newObj.State = Diag.DiagState.Passed
This is quite a normal approach, define a variable and assign it a new instance of a class then the next line assign something to a property, however CodeRush CodeIssue had a suggestion, so I decided to try it
Dim newObj As New Diag With {.State = Diag.DiagState.Passed}
Personally I prefer this line as it keeps the code clean and makes the line more defining, we see we define a variable then create a new instance of a Diag Class and assign the property State to Passed, and all in one line.
To anyone who hasn’t tried CodeRush/RefactorPro! I would suggest you head over to http://www.devexpress.com and download their “FREE” CodeRush/Refactor Xpress. When I say free, I actually mean it is Free, no strings attached. The Xpress version hasn’t got all the bell’s and whistles of the full product but then again if you aren’t using DevExpress components in your project maybe you should take a look at them as well as I couldn’t live without them.
So I say thanks to DevExpress for helping a developer learn new ways of using the .NET language.
EDIT: A good quick case study on performance gains with CodeRush/Refactor!Pro http://www.devexpress.com/Home/DeveloperStories/McGregorBfa/

Should AussieALF stay bald?
Latest Comments
- How to make XPO only...
Hi Sean, Very true ;) however keep in mi... More...
09-Apr-10 - How to make XPO only...
True, but it's worth noting that DX do ... More...
09-Apr-10 - How to make XPO only...
I would have to check with Gary, as alth... More...
09-Apr-10 - How to make XPO only...
Hi, I agree it seems like a "normal" thi... More...
09-Apr-10 - How to make XPO only...
Another question, how does it work with ... More...
09-Apr-10






Comments
-Jim
RSS feed for comments to this post.