XpdWiki

FrontPage
RecentChanges
XtC
FindPage
PageIndex
XpApprentices

Set your name in
UserPreferences

Edit this page

Referenced by
DoesIntelliSenseI...




JSPWiki v2.0.52


WhyIsXpInDotNetDifficult


A collection of experiences in practising some XP practices in the world of DotNet:

Compile and run time can be slow, so you're discouraged from running tests continuously.

NUnit integration with the projects/workspace isn't clean ( eg: to test a dll you need to change project parameters to run Nunit, and project parameters can't easily be shared across a team as directory paths are personal).

Visual Studio .NET doesn't support typed searching, so you can't refactor easily. Eg: Its not easy to find all uses of a class, or all callers of a method.

XRef is a VS.NET plugin that allows you to find all usages of fields/classes/properties/methods/etc http://www.fmsinc.com/dotnet/xref/index.asp. -JoeW

The MS API often have large classes with many methods, and this encourages the same in code you write. In particular it's easier to navigate within Visual Studio .NET with fewer classes.

In CSharp inheritence must be declared in the parent class, and much of the Windows API doesn't allow this. It's difficult to substitute Mocks here.

There are no code layout tools.

The expectations of Microsoft programmers are vastly different - IME wizards and ease of coding come higher in priority to quality. Programming by intellisense. Its often easy to knock-up something that works, but difficult to improve it.

This is down to discipline. It's just as easy to create bad code in other languages too. I tend to avoid all the evil wizards in VS and rely on trusted OO techniques to get the job done. -JoeW

-- Dmitriy Lapshin:

I'd say that compile time is not so slow, and tests can be run on the development server along with automated builds in background mode. Moreover, if one makes some changes to the code, usually he will compile it anyway (at least to check that there were no dumb syntax errors).

I have never tried NUnit, with a tool in development of which I am involved (X-Unity) there is no such a problem. I tried to lay the foundation for a teamwork from the beginning.

And I agree, there's no typed search. However, I have seen C# refactoring tool somewhere on the Internet.

As for Microsoft programmers, let me disagree. Wizards and Intellisense significantly improve productivity, and they in no way prevent code from improvements. Again, I was experimenting with refactoring while developing X-Unity, and it was rather easy for me to refactor in VS.NET.

-- Anthony:

I should think you can interate Nunit with VS.NET off the tools menu or set up a macro very easily to complile and run tests in the output window automatically. I've not found it to be slow, but then again I haven't put together a large number of tests yet. -- PaulS sadly this won't allow debugging from a tools menu as far as I know. --Anthony: you could add Nunit to the tools menu and then record/write a macro to compile and run nunit and assign a key to it. its very easy to extend VS using macros and add-ins

VS.NET does have find all references search. Alt-F12 or Alt-Shift-F12 for quick search. It doesn't have a set of refactoring tools though. There are a few being developed, but they all seem to only be beta at the moment. -- PaulS thinks this isn't quite true - it seems to do some sort of symbol search, and results in a load of false references. -- Anthony: it returns all symbols that match and their references below each one. you just need to look at the references to the one you want.

I don't think inheritance needs to be declared in the parent does it? It can be sealed which stops inheritance. -- PaulS thinks you have to declare methods virtual in a parent if you want a child to override it. This is fine if it's your parent class, but not if it's part of the Win32 API or third part library. -- Anthony: yes that's true. why is this so important? and isn't there a work around?

Here's why I think it's important: In C# you have to declare methods with virtual/abstract to override (but not to overload). Having to declare every method with 'public virtual void...' is too much work, so I skip it. This practice however, results in every time I create a mock or refactor out a common base, I curse a lot, bite the dust and go and add 'virtual' to every method complaining method. This is not good, it breaks my flow. I could declare every method with virtual to begin with, but all those modifiers just clutter my code -- ThomasEyde?


Staale:

Unit Testing: Grab a copy of NUnitAddIn? http://dotnetweblogs.com/nunitaddin Also hosted on sourceforge. NUnitAddIn? enables you to run a test directly (right click menue) from the VS.NET IDE.
Refactoring: http://www.xtreme-simplicity.net/
Code browser: http://www.axtools.com
Appart from that my impression is that most of the complaints are due to work habit (hmm, which is realy hard to change..:o)


See also DoesIntelliSenseImpareXP³host³³date³October 25, 2002³agent³Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)³WhyIsXpInDotNetDifficult


Edit this page   More info...   Attach file...
This page last changed on 21-May-2003 16:44:04 BST by unknown.