New in C#4
Nick Sabalausky
a at a.a
Fri Nov 7 15:01:13 PST 2008
"Bruno Medeiros" <brunodomedeiros+spam at com.gmail> wrote in message
news:gf1tci$2s5o$1 at digitalmars.com...
> Nick Sabalausky wrote:
>> "Ary Borenszweig" <ary at esperanto.org.ar> wrote in message
>> news:gf03qh$23sg$1 at digitalmars.com...
>>> Bruno Medeiros escribió:
>>>> 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).
>>>> And it's not something that can be easily understood in foresight - one
>>>> really has to try it out (rich IDE functionality) for some time and
>>>> even then, you might not notice it until it is *taken* from you. Fun
>>>> story, that happened to me:
>>>>
>>>> When I started looking for work after graduation, recruiters asked me
>>>> if I had preference for working with C# or Java. I had no
>>>> anti-Microsoft bias (apparently some people do, even in the workplace),
>>>> so I judged both in terms of language only, and I really didn't have
>>>> much of a preference then (note, this was considering C# only up to
>>>> version 2.0 only). I was slightly inclined to Java, but only because I
>>>> had used it more.
>>>> But months later, when I started working on a project that had a
>>>> desktop client, I tried using C# (to take advantage of the WinForms
>>>> designer) I was vexed as Visual Studio (C# 2005) seemed primitive in
>>>> comparison. Suddenly many of the things I had taken from granted were
>>>> gone, and I missed them a lot more than I expected (one example is the
>>>> Ctrl-1 "Assign to Local Variable" refactoring which gradually become
>>>> one of my most used refactoring, almost as much as Refactor-Rename).
>>> I recently discovered you can do the same with Ctrl+2, L :-)
>>>
>>> Of course in D that'll be
>>>
>>> auto whatever = <your expression here>;
>>>
>>> Do here's a clear example where a language helps not being repetitive,
>>> and that kind of shortcut becomes less useful.
>>>
>>> But refactoring is an essential thing in TDD, and I think that can't be
>>> easily supported by any language without using a proper IDE.
>>>
>>> I also have the sensation we are the only guys that used JDT. In my
>>> workplace everyone feels very, very comfortable using Java; not because
>>> of the language itself, but because of Eclipse. It's amazing the speed
>>> boost you get once you get used to it. You don't have to look at
>>> external documentation files, you don't have to read someone else's code
>>> to understand what's going on. You don't need to remember lots of names,
>>> where's everything is located.
>>>
>>> But, as Bruno says, you can't really feel it unless you try it.
>>
>> I used Eclipse constantly back when I was working with Java (before I
>> discovered C# and then D). And before that, I was a huge Visual Studio
>> fan from version 5 through the early .NET versions. But ever since
>> leaving Java, I've been finding myself deliberately avoiding Eclipse just
>> because I'd much rather use an IDE that's responsive (and not so heavly
>> Java-centric) than one that has a few extra bells and whistles. Don't get
>> me wrong, I love IDE bells and whistles (that's why I used to be such a
>> Visual Studio fan, and used Eclipse when I switched to Java), but when
>> trying to interact with the IDE starts to feel like running through
>> knee-deep molasses, as it frequently does with Eclipse, it's just not
>> worth it to me.
>
> Well, I'm not sure if that was your case, but if we are talking web
> development (something I did in my job), then the Java web development
> component of Eclipse (WTP, which extends JDT), is noticeably slow and
> somewhat unstable on several parts. It really isn't up to par to basic
> JDT, which is much more mature, although WTP has been improving lately. I
> don't know how it compares to Visual Studio since I never did any C# web
> development, only core C#.
>
I've done a lot of web work, but none of the Java work I've done was web (at
least not server-side anyway). The was just normal ordinary Java
applications, command-line and GUI, and the occasional embedded applet. The
.NET versions of Visual Studio have, unfortunately, been getting
increasingly boated, but in my experience, Eclipse is still more boated.
Although, I can't say much about Visual Studio's web stuff. The last time I
used Visual Studio for web, it was still called InterDev.
More information about the Digitalmars-d
mailing list