New in C#4

Christopher Wright dhasenan at gmail.com
Fri Nov 7 20:20:34 PST 2008


Bruno Medeiros wrote:
> Ary Borenszweig wrote:
>> Robert Fraser escribió:
>>> Denis Koroskin wrote:
>>>> I once had the following Color class:
>>>>
>>>> class Color
>>>> {
>>>>     this (byte alpha, byte red, byte green, byte blue) { ... }
>>>> }
>>>>
>>>> and used it as follows:
>>>>
>>>> Color c = new Color(255, 0, 255, 0); // opaque green color
>>>>
>>>> After refactoring, alpha became last argument in ctor:
>>>>
>>>>     this(byte red, byte green, byte blue, byte alpha) { ... }
>>>>
>>>> Note that this change didn't raise any compilation error, nothing 
>>>> that would notify my of possible error.
>>>>
>>>> Needless to say that I didn't enjoy searching all the code that used 
>>>> Color to reorder parameters (although some artifact were nice :)
>>>> It would save me quite some time if I initialized all my instances 
>>>> as follows:
>>>>
>>>> Color c = new Color(alpha: 255, red: 0, green: 255, blue: 0);
>>>>
>>>> Now compiler could raise an error if parameters order was changed. 
>>>> Even better - compiler could reorder parameters for me automatically 
>>>> if given that all of them are specified and no params ommited 
>>>> (unlike Python). This makes code more robust to refactoring.
>>>
>>> The first thing  I thought of when reading this is Eclipse JDT's 
>>> "Change Method Signature" refactoring that will look up all the calls 
>>> in your project & automatically reorder the parameters for you.
>>
>> Me too. :-)
> 
> Of course I also ate a piece of that cake. ^^
> 
> I keep getting the impression that we 3 are the only people in the D NG 
> that have used JDT extensively.
> That's unfortunate because I feel most people here don't realize how 
> much an IDE like JDT (or something comparable, like IntelliJ IDEA, but 
> not VS) can shape and improve the development workflow (and thus have 
> potential implications in language design).

I haven't used JDT very much -- I can't stand the standard library in 
Java, so I try to avoid it.

I've used Visual Studio with Resharper. From what I've seen, Resharper 
is much better than JDT. It might just be a matter of default 
configurations, but that's still a strong advantage.

Still, Resharper costs $250 on top of the cost of Visual Studio, and it 
won't work with the free versions of VS.

However, when working with C# on a large codebase, I'm significantly 
faster when working with Resharper. Enough so that if Resharper is not 
functioning, getting it in working order is my top priority.



More information about the Digitalmars-d mailing list