edit & continue

G

Gary Hoffer

Having come from C++, I don't understand why C# does not
get the same type of "Edit & Continue" support as VB.NET
is scheduled to receive. Is it perceived that we can
somehow "live" with it as opposed to VB programmers?
 
M

Michael Culley

Gary Hoffer said:
Having come from C++, I don't understand why C# does not
get the same type of "Edit & Continue" support as VB.NET
is scheduled to receive. Is it perceived that we can
somehow "live" with it as opposed to VB programmers?

Yes, using luxury features makes you less of a programmer ;-)
 
J

Jared Parsons [MSFT]

G

Gary Hoffer

I read the blog and wasn't really convinced. It looked like 3 major
features were added to VB.NET and 2 of those were added to C#. Only EnC
was left out of C# and no additional features were added to C# to
explain the lack of development for this.

I have seen discussions from MS that talk about the "difference" between
C# and VB developers which purports to explain why EnC is "not as
important" to C# programmers. I still don't understand that kind of
thinking. Those of us doing C++/MFC programming have been wishing for a
language more closely aligned with the ease of implementation that vb6
had. Now that the CLR is here why should there be a dividing of the
feature set from a development platform that started out to prove that
development in either VB or C# was equivalent?

Gary
 
D

Daniel O'Connell [C# MVP]

Gary Hoffer said:
I read the blog and wasn't really convinced. It looked like 3 major
features were added to VB.NET and 2 of those were added to C#. Only EnC
was left out of C# and no additional features were added to C# to
explain the lack of development for this.

Actually, Major features in C# are anonymous methods, generics, partial
classes and iterators, from what I understand VB is only getting generics
and partial classes(are there VB anon. methods?).
I have seen discussions from MS that talk about the "difference" between
C# and VB developers which purports to explain why EnC is "not as
important" to C# programmers. I still don't understand that kind of
thinking. Those of us doing C++/MFC programming have been wishing for a
language more closely aligned with the ease of implementation that vb6
had. Now that the CLR is here why should there be a dividing of the
feature set from a development platform that started out to prove that
development in either VB or C# was equivalent?

Because the customers want it that way. VB has a few features now that I
want in C#(exception filters, for example), and it has features I would
probably stop using C# if they added(such as with or the select statement).
It is a simple fact that each language will diverge and be a little
different, if for no reason other than thats how people want it.

As far as Edit and continue goes, I didn't hear many people complaining
about it until news got out about VB in whidbey supporting it(not just that
it would , but that it did), then everyone came out of the woodworks. I
can't say now if people really want it or if it is just a case of VB-envy,
the "we gotta have what they have and more" syndrome. If you dig back
through the back messages on this group, I doubt you'll find many people
clammering for it(especially before the PDC), and you'll find a few who are
adamantly aganist it. Over all, it seems most people just don't care, or
care enough to really fuss. I know I don't anymore, although I used to be
one of the people who fought it.

C# will get it some day, probably in the orcas time frame, but I personally
feel that iterators alone make up for the lack of E&C. I personally tend to
write more than I debug(I only debug when something fails that I can't
figure out), so code time enhancements will likely be of more value to me.
Also, one of the things I dislike about E&C is the tendency to write 3
lines, maybe even a whole method, and run the debugger to see if it looks
like it works right. In the end it really doesn't end up helping your code
along, and probably will result in inferior code when compared to the
results when using other techniques, such as unit testing. Sometimes it may
even get down to the status of the currently infamous cargo cult
programming, just write something in a "maybe, sorta, it could work" way and
jump into E&C and play with it until it works. It took me quite a while to
teach myself not to do that in VB6 when I was learning it. As a whole, Edit
and Continue is a time saver that is most often abused, which alone is an
argument against it, but at this point I don't bother maintaining that
argument, I simply refrain from using the feature abusivly when its
available(and feel it shouldn't be taught, or allowed, in a beginners level
programming course).
 
M

Michael Culley

Daniel O'Connell said:
As far as Edit and continue goes, I didn't hear many people complaining
about it until news got out about VB in whidbey supporting it(not just that
it would , but that it did), then everyone came out of the woodworks. I
can't say now if people really want it or if it is just a case of VB-envy,

I think EnC is the biggest productivity improvement that could be made to C#. The number of times I run a project and go through a
series of steps just to find I've made a minor mistake is quite large. I then have to exit the app to make the change and start
over.
I personally tend to
write more than I debug(I only debug when something fails that I can't
figure out),

I've been reading about EnC (or the lack of it) since .net beta was released and the posts against it always have a common theme.
There is always this "I check my code thoroughly before I run it". In my opinion this is newsgroup bollocks along with such gems as
"I always spec out my projects to last detail and changes to the spec are rare". If I've written a slab of code the easiest way to
check it for mistakes is to run it. 90% of the time there is something minor wrong that needs to be changed. EnC would save a lot of
time.
 
J

James P

90% of the time there is something minor wrong that needs to be changed.
EnC would save a lot of time.

Amen.
 
D

Daniel O'Connell [C# MVP]

Michael Culley said:
I think EnC is the biggest productivity improvement that could be made to
C#. The number of times I run a project and go through a
series of steps just to find I've made a minor mistake is quite large. I
then have to exit the app to make the change and start
over.

I must ask, why are you testing that way? Shouldn't you be testing all your
individual chunks of code in a more modular way instead of running from
point A all the way to point X? Outside of errors in the UI(which are hard
to test outside of debugging), I don't think the approach you use here is as
good an idea as you seem to.

Furthermore, E&C doesnt fix the situation, which isn't uncommon, where the
code that causes the error actually occurs in the first few lines of the
program, even if the manifestation of that error doesn't occur for 6000
lines. That is much more the kind of thing you should be stomping around a
debugger for, IMHO, and chances are pretty high you are better off
restarting the whole app than trying to jump back that far(if its even
possible). Who knows what kind of bugs you'll add.
I've been reading about EnC (or the lack of it) since .net beta was
released and the posts against it always have a common theme.
There is always this "I check my code thoroughly before I run it". In my
opinion this is newsgroup bollocks along with such gems as
"I always spec out my projects to last detail and changes to the spec are
rare". If I've written a slab of code the easiest way to
check it for mistakes is to run it. 90% of the time there is something
minor wrong that needs to be changed. EnC would save a lot of
time.

Neither of which I said, I simply said I don't use the debugger enough to
justify E&C. I do not(and abhor the practice, incidently) test my code using
a debugger, that isn't the purpose of the debugger(which is to help find the
cause of bugs, not to find the bugs themselves). On larger projects I only
use the debugger when a unit test fails and my glance at the code doesn't
suggest that I did one of the many stupid possiblities that you
suggest(wrong value, wrong method, or even the occasional accidental
infinite loop), or a user test does, often times the debugger is more
valueable in the last case, but that last case is probably somewhere around
5 to 10 times less likely than an unit test failing. On smaller projects I
prefer to run the app and use it instead of jumping immediatly to the
debugger and patching till it works right. If there is a failure I *rethink*
the method instead of hacking away at it as E&C can, and sadly often does,
promote. This is helpful in another way, to be blunt, most of the time the
first implementation of a method you write isn't the one you should be
using, which si another thing I think abuse of E&C promotes.

Perhaps if developers were a bit more disciplined it would be possible to
add E&C without getting people paranoid, but I know for a fact(I, for one,
made these mistakes myself the first few VB6 apps I did), that the majority
of users are going to abuse it, badly. I don't think I've seen source for a
VB6 app that didn't look like it had been written half under E&C. People
start to write code *for* the debugger, in the debugger, instead of
addressing the problem that their code just isn't right. That is one of the
biggest problems with edit and continue. Beyond that, people seem to love to
just slam out code and run it, not bothering to actually think about what
they are writing, catching the little mistakes that are left behind. In my
own experience I tend to write less silly little mistakes when I'm in a
langauge without E&C, mainly because I can't rely on that net and I actually
have to consider my code. You don't have to check it throughly before
running(that is pretty infesible at times), but you really should be
checking it while you're writing it, don't you think? Or, at the least,
glancing along the last 5 or 10 lines to see if you wrote what you meant to,
something similar to what I'm doing right now as I write this reply. I
certainly don't have an english debugger waiting to run over it so I can
make sure I didn't write something legal but stupid. Its up to me to read
what I'm writing, to understand it and to make sure it fits in with what
I've said before(mercifully, english readers are more forgiving than C#
compilers. However, english is considerably more complex, unlike the
compiler I doubt anyone reading this actually knows all the rules). That is
part of your responsibility, not the debuggers, to ensure you wrote what you
meant to while you are writing.

Anyway, tell me, what arguments do you have for it? Just the "I hate having
to restart when I screw up" argument(which, incidentally, is the only
argument I've ever heard in favor of E&C; not that it helps find bugs, but
that its easier because minor screwups can be fixed and likewise ignored
while writing, or perhaps hacked around)? Does that really justify E&C? Is
it enough, given the enormous potential for abuse, to make E&C a "good"
feature? Enlighten me, be the first to provide an actual reason.

And, at that, if you think all of the above is bollocks, then I respectfully
state you should try it and see if your code quality improves, rather than
assuming that easy is best.
 
M

Michael Culley

Daniel O'Connell said:
I must ask, why are you testing that way? Shouldn't you be testing all your
individual chunks of code in a more modular way instead of running from
point A all the way to point X? Outside of errors in the UI(which are hard
to test outside of debugging), I don't think the approach you use here is as
good an idea as you seem to.

Every time I get into this sort of thread the programmers all of a sudden become perfect. They plan their projects down to the last
details and unit test everything, they write and check all of their code before they run it and most of the time it runs ok first
time. They have a team of testers and bugs rarely appear on the end users machine. Maybe if you are writing a new file system then
this would be reality but when you are writing an app with 300 forms on your own in limited time it's a bit different. Anyway,
that's a different story, the fact is I don't generally do unit testing and just run the app in the dubugger to test it. The
majority of other programmers would be the same.
Anyway, tell me, what arguments do you have for it? Just the "I hate having
to restart when I screw up" argument(which, incidentally, is the only
argument I've ever heard in favor of E&C;

What other reason do you want? That's what it does, that's ALL it does.

Your reasons are much more vague than this. Really, stop and read your post and then read the above three lines you wrote. This is a
solid reason, "If I encounter a simple mistake I can fix it without restarting and save time" as compared to all sorts of coding
practice talk that only seems to apply if you are following a certain coding practice.
Does that really justify E&C?
Yes.

Is
it enough, given the enormous potential for abuse, to make E&C a "good"
feature? Enlighten me, be the first to provide an actual reason.

The abuse of it is not your problem. I don't think the inclusion of it will promote bad coding practices, programmers will continue
with the same practices regardless.
Furthermore, E&C doesnt fix the situation, which isn't uncommon, where the
code that causes the error actually occurs in the first few lines of the
program, even if the manifestation of that error doesn't occur for 6000
lines.

In that situation EnC is not of much use but I find it is more common that the error is in the current procedure or a little further
up the call stack and can be fixed fairly easily.
 
D

Daniel O'Connell [C# MVP]

Michael Culley said:
Every time I get into this sort of thread the programmers all of a sudden
become perfect. They plan their projects down to the last
details and unit test everything, they write and check all of their code
before they run it and most of the time it runs ok first
time. They have a team of testers and bugs rarely appear on the end users
machine. Maybe if you are writing a new file system then
this would be reality but when you are writing an app with 300 forms on
your own in limited time it's a bit different. Anyway,
that's a different story, the fact is I don't generally do unit testing
and just run the app in the dubugger to test it. The
majority of other programmers would be the same.

I'm really astounded you'd consider what I'm implying perfection, I consider
it pretty off the cuff and risky personally. The approach you suggest, with
testing in the debugger has lead me to create what had to be among the worst
apps in existance. In my first year professionally, I wrote an app for a
construction company, charged with organizing some of their internal
business. It was in vb6 and I make two mistakes, 1) I abused ADO, and 2) I
abused E&C. The abuse of ADO is very apparent, and pretty irrelevent, as it
only made the app slow. The abuse of E&C instead made the code hard to fix
when I did figure out where the abuses of ADO existed. As I analyze that
code(and, a great many other chunks here and there as well by other
authors), you can see places where methods were modified in some *stupid*
way because it fixed the immediate problem, sometimes to the point that
fixing the original problem caused the method to fail because the immediate
fix screwed up the remote fix. That is the problem with E&C, and the legacy
from abuse is something anyone who ever works on material other than their
own. It is *far* too easy, and horridly common, to write code for E&C. And
yes, I am worried about it.

There are other situations where unit testing isn't going to happen. Right
now I am playing with a compiler in my spare time(the Mono C# one), and
there is little realistic way to perform unit tests, especially given vs's
refusal to load exe's as references. So instead I have test scripts that run
across my own function tests, and occasionally I run the supplied regression
tests(although, thats my one beef with mono, the damn compiler they ship as
source never seems to work the same as the binary one, so tests tend to fail
and cause headaches). The downside is although the scripts ensure that there
are no regressions and that the code compiles as it should, I am still stuck
using ildasm myself and verifying that the code outputted is what I expected
and in general correct.
What other reason do you want? That's what it does, that's ALL it does.

Your reasons are much more vague than this. Really, stop and read your
post and then read the above three lines you wrote. This is a
solid reason, "If I encounter a simple mistake I can fix it without
restarting and save time" as compared to all sorts of coding
practice talk that only seems to apply if you are following a certain
coding practice.

I follow only the practices I've found usefull. Unit testing(be it formal,
using NUnit or the like, or informal, using console utilities that you'll
never understand again and really aren't very useful for anyone but you)
isn't really that hard. Now, granted, in the above situation you described,
of 300 forms that is, I suspect E&C and the debugger is your best choice.
Unit tests of any kind for UI code is possibly the most difficult type of
test to do, and I don't really believe that they'll ever actually be right
anyway. There are too many variables and what data is returned doesn't
matter, its what users see and how it behaves in real use. That is why, alot
of the time, the first bug you run into in any given app is a UI bug. Its
rather difficult for even a professional test team to really work out a UI.
I hear that whidbey or longhorn(I think longhorn) is supposed to deliever a
more robust framework for accessiblity that will also allow testing UI code,
but that is a ways off yet.

Anyway, perhaps alot of my reasons for not seeing a use in E&C is that I
write very little UI code, when I do the UI tends to be little more than a
form and event handlers that calls into the classes I tested earlier on. I
can't even do databinding on my own, ;).

I also can't say that I spec everything properly, infact I argue against TDD
for that reason. When I was playing with it, I found that most of the time
the tests I wrote to follow the spec were a waste of time because when I sit
down to write the system I realize that the system can't communicate with
itself, or other such annoyances, but the tests said the system was right. I
find myself writing alot of little console apps just to demonstrate the use
of an infrastructure, both internally and externally, but I can't say thats
good practice, just that its what it takes to get what I'm doing right.

Frankly, I'd love to have even one tester so I didn't have to spend so much
time dreaming up ways to hammer my classes with stuff that should never be
passed to the method in the first place and actually get some more work
done.
The abuse of it is not your problem. I don't think the inclusion of it
will promote bad coding practices, programmers will continue
with the same practices regardless.


In that situation EnC is not of much use but I find it is more common that
the error is in the current procedure or a little further
up the call stack and can be fixed fairly easily.

Everyone sometimes makes silly mistakes, assigning the wrong enum value or
mis-casing a case sensitive string argument. Or my fav, and probably the one
I do most often, forgetting to reassign a string to itself after an
operation(string.SubString() on its own doesn't do a whole lot). However, I
really don't find those mistakes(ones that compile anyway) to be that
common. Most mistakes I find are due to logic errors or to writing something
that plain doesn't compile. My code certainly isn't perfect but it is
generally as right as possible for how wrong it is.
 
J

James P

Every developer has his own way of finding and fixing bugs. E&C helps the
developer who runs the code through the debugger to find out what went
wrong. If your are a skilled developer you know if the fix would break
something else. If you are not, no tools are going to help you much. By
being rigid you deny yourself an opportunity to solve the issue quickly. How
far you want to go with a particular feature of the development environment
is upto you. Some leads insist on how you should be using such tools. They
better limit the tools to a text editor and a command line compiler.

I would'nt even promote someone to a lead position if he/she is rigid in
their views about development practices. To me the quality of the code is
more important. There are many ways to achieve that.

James P
 
M

Michael Culley

Daniel O'Connell said:
The approach you suggest, with
testing in the debugger has lead me to create what had to be among the worst
apps in existance. In my first year professionally, I wrote an app for a
construction company, charged with organizing some of their internal
business. It was in vb6 and I make two mistakes, 1) I abused ADO, and 2) I
abused E&C. The abuse of ADO is very apparent, and pretty irrelevent, as it
only made the app slow. The abuse of E&C instead made the code hard to fix
when I did figure out where the abuses of ADO existed.

I don't let E&C change the way the code is written in the end. When doing vb6 stuff I always stop the debugger and make the change
if it is necessary. On the odd occasion I make an E&C style hack, I always put a "TODO: Fix this!!!" next to it, although this is
pretty rare.
Everyone sometimes makes silly mistakes, assigning the wrong enum value or
mis-casing a case sensitive string argument. Or my fav, and probably the one
I do most often, forgetting to reassign a string to itself after an
operation(string.SubString() on its own doesn't do a whole lot). However, I
really don't find those mistakes(ones that compile anyway) to be that
common.

This is what I mean when I said in this sort of conversation programmers all of a sudden become perfect and make few mistakes. Maybe
it's true for you but it certainly isn't for me. I make plenty of small stuff ups, in fact I make so many that I would say I'm
suprised if there isn't one every time I run a new piece of code. Pretty much I always forget something small. E&C would be great in
these situations and if people abuse it then that's their problem.
 
D

Daniel O'Connell [C# MVP]

Michael Culley said:
I don't let E&C change the way the code is written in the end. When doing
vb6 stuff I always stop the debugger and make the change
if it is necessary. On the odd occasion I make an E&C style hack, I always
put a "TODO: Fix this!!!" next to it, although this is
pretty rare.

This is what I worry about most, I don't think most people will.
This is what I mean when I said in this sort of conversation programmers
all of a sudden become perfect and make few mistakes. Maybe
it's true for you but it certainly isn't for me. I make plenty of small
stuff ups, in fact I make so many that I would say I'm
suprised if there isn't one every time I run a new piece of code. Pretty
much I always forget something small. E&C would be great in
these situations and if people abuse it then that's their problem.

That certainly is interesting. For you each compile has some small mistake,
and for me it tends to take three or four compile attempts, but usually no
small mistakes. I am incessently forgetting a ; or slipping up on casing, it
amazes me when I manage to change something and not get a compile error the
first couple of times.

Anyway, for clarity, I don't suppose the addition of E&C is too much of a
serious issue, as far as platform choice goes. I just don't think its
anywhere near pressing enough for the fuss I've been seeing of late. Putting
E&C ahead of refactoring and other IDE features would be a drastic mistake
though, in my opinion.
 
D

Daniel O'Connell [C# MVP]

James P said:
Every developer has his own way of finding and fixing bugs. E&C helps the
developer who runs the code through the debugger to find out what went
wrong. If your are a skilled developer you know if the fix would break
something else. If you are not, no tools are going to help you much. By
being rigid you deny yourself an opportunity to solve the issue quickly.
How
far you want to go with a particular feature of the development
environment
is upto you. Some leads insist on how you should be using such tools. They
better limit the tools to a text editor and a command line compiler.

I would'nt even promote someone to a lead position if he/she is rigid in
their views about development practices. To me the quality of the code is
more important. There are many ways to achieve that.

Yet you feel ok about your own rigidity?

How do you feel about hypocritcal bosses?
 
M

Michael Culley

Daniel O'Connell said:
This is what I worry about most, I don't think most people will.

That's their problem. :) We could remove a whole rash of features because they are abused and most of those would be abused far
more than EnC.
That certainly is interesting. For you each compile has some small mistake,
and for me it tends to take three or four compile attempts, but usually no
small mistakes.

I usually have a few compile attempts followed by a few attempts to run the code.
Anyway, for clarity, I don't suppose the addition of E&C is too much of a
serious issue, as far as platform choice goes. I just don't think its
anywhere near pressing enough for the fuss I've been seeing of late. Putting
E&C ahead of refactoring and other IDE features would be a drastic mistake
though, in my opinion.

I agree with what you've said here. I can imagine E&C being a very difficult to implement feature that might not only be added at
the loss of other features but also make it harder to add new features. If MS asked me if I wanted EnC or templates I'd probably say
templates. (if they said I could have inheritance of tables in sql server I'd pick that, but that's another story).
 
R

Ravichandran J.V.

Edit & Continue is one of the RAD features and C# is not a RAD language
where VB.Net is and hence, the many RAD features like case insensitivity
etc in VB.Net and not in C#, which makes for faster development and
since C# is basically a low-level language for the .net, the designers
of the language probably designed it for other purposes that are usually
not done through an IDE like VS.Net.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 
J

Julie

Ravichandran J.V. said:
Edit & Continue is one of the RAD features and C# is not a RAD language
where VB.Net is and hence, the many RAD features like case insensitivity
etc in VB.Net and not in C#, which makes for faster development and
since C# is basically a low-level language for the .net, the designers
of the language probably designed it for other purposes that are usually
not done through an IDE like VS.Net.

with regards,

J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com

C# is a *LOT* more RAD than C++, and C++ has had E&C for _years_.
 
M

Michael Culley

Ravichandran J.V. said:
Edit & Continue is one of the RAD features and C# is not a RAD language
where VB.Net is and hence, the many RAD features like case insensitivity
etc in VB.Net and not in C#, which makes for faster development and
since C# is basically a low-level language for the .net, the designers
of the language probably designed it for other purposes that are usually
not done through an IDE like VS.Net.

This is just simply not true. C# is practically the same as vb.net and is about as high level as you get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top