Brendan Tompkins [MVP]

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Think first, THEN Edit and Continue...

I agree with DonXML when he questions the value of making Edit and Continue a part of your development process.  To add my $.02 to the debate, I can see this being misused in a number of ways.  Take this for example:  You're debugging, you encounter a bug.  So, you inspect an object in the Immediate window, find the property with the value you're looking for, add it to your code, and voilà.  Your code runs! 

The big problem I can see here is coding to some value of some field at runtime!  Now hopefully most developers won't do this, and will actually use it to say “Oh yeah, dumb mistake, I need to fix this.”  But I have a feeling that many developers will begin to use the debugger instead of intellisense or framework documentation to find out what interface to code against.

I've been guilty of this myself.  I wrote a bunch of pathing code to determine runtime paths for ASP.NET.  I figured much of this out by inspecting the Request object's properties at runtime.  What happened?  The shit broke, that's what happened.  The problem was I didn't understand the objects I was using, I was just programming to what looked good at runtime.   When the runtime environment changed, it broke my app.

Now,  Microsoft doesn't seem to be interested in fundamentally changing the way we develop code.  They're never going to develop tools that support agile methods first.  To do this would be to alienate 95% of the developers out there.  They want VS to fit into your existing development process, no matter how screwed up it is.   And you can't blame them.  They're trying to make everyone happy - they're selling software. 

So, I guess what I'm saying is we can't really blame them for adding features that are going to be mis-used.  Keep yourself disciplined.  Use these things only when you really really need them, like right before a deadline.  ;)

-Brendan


Posted 10-19-2004 6:00 AM by Brendan Tompkins

[Advertisement]

Comments

Darrell wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 3:21 AM
All the arguments against EnC are the same: "It *CAN* be misused so Microsoft should *NOT* put it in the product."

What a bunch of crap. It's a feature, just like any other, that can be used for goodness and puppies and apple pie, or for villainy and cats and fruitcake.

Let's apply this to some recent advancements in car technology. On some of the nicer models (ie, all the ones I can't afford) like Lexus, Infiniti, etc., there is a proximity sensor to help you park by beeping as you get closer to something with a constant beeeeeeeeep at 12 inches or less. Now, should I try to drive my car blindfolded using this instead? No, but ohmygosh! It *CAN* be misused this way, so we should remove it from all cars!!! AAAAGH! What are those insane car manufacturers trying to do to us! The sky is falling! Run for the hills!!!!
Darrell wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 3:23 AM
Not that I'm picking on you Brendan, but there is almost as much hype against EnC as there is positive hype for Longhorn. Puh-lease people.

Bad developers will misuse tools regardless of what all the experts say (either because they don't read stuff written by experts or because they think they are smarter than the experts) and good developers already agree.
Brendan Tompkins wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 3:36 AM
Darrell,

Ever use power tools? I have a basment full of them, and there's a bunch of design features that keep me from cutting my arm off. If left to my own devices, I probably would. Okay, terrible analogy.

I think there's a little bit of a bigger issue here. You're right that *good* developers won't mis-use this stuff, but *most* developers will, don't you agree?

Now, when the selection pressure for MS is to make tools easier, not more effective, don't you think we'll end up with less and less *good* .NET developers over time? When the MS tools are eaiser to misuse than others, is this slightly concerning to you?

I'm not saying remove it. That would be like trying to fight the tide. But it does make for interesting conversation.
Mark Bonafe wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 5:00 AM
"So, you inspect an object in the Immediate window, find the property with the value you're looking for, add it to your code, and voilà. Your code runs!"

Do VB programmers really do this? I never have, even when I was new to VB. WARNING: If you (whoever is reading this) are doing this, STOP!

I have to agree with Darrell on this. EnC is a great tool to have in the tool box. Why throw it out because someone might use it the "wrong" way?
Brendan Tompkins wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 5:16 AM
Who said to throw it out? I've just said to remain diciplined.

I can't speak for VB progammers, since I've never really considered myself one, but, I have used the debugger countless times to hunt for a property on an unfamiliar object... Yes. I've hacked out plenty of code. I'm not proud, but I did it because I could. If my IDE had made it easier, I may have hacked more! At least I had to stop debugging to introduce more bugs.
Paul Laudeman wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 5:17 AM
Well, how about just disabling the feature by default so you have to go out of your way to turn it on?

At least this way the only person you'll have to blame for your troubles is yourself for turning it on.
Brendan Tompkins wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 5:18 AM
Oy Vey.
Mark Bonafe wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 6:51 AM
Brendan - Right. Discipline is definitely the key.

Nice one, Paul. Like the old C++ compilers that let you "switch" all the features per the developer requirements. I like it
Brendan Tompkins wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 6:54 AM
Once you run IIS Lockdown, most of your VS debugging is "Turned Off" anyway. ;)
Paul Laudeman wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 7:34 AM
Mark: Just think of it as "secure by default" -- Microsoft's latest mantra for turning off everything that could potentially cause trouble :-)

Brendan: E&C will not be available for any language when doing ASP.NET development.
Brendan Tompkins wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 7:40 AM
Paul. Yes. In fact, here's an article here about no E&C for ASP...

http://www.aspnetpro.com/opinion/2004/06/asp200406jg_o/asp200406jg_o.asp
grant wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 10:04 AM
Not that you need another opinion thrown in here, but I've been saddled with tweaking a VB6 application for the last week or two and it's been a trip down memory lane. I had to install Visual Studio 6, brush up on my ado "classic" libraries, I even fired up Package And Deployment Wizard the other day!

I've noticed that I don't use the edit and continue feature like I did in years back -- I don't even inspect variable values etc in the Immediate Window. I just don't use it. My current theory is that my programming has improved enough with unit testing and c# (no EnC), that I'm confident the functions I write are behaving properly. Of course, without the unit tests to confirm it I could be in big trouble, but so far I'm on course to finish this VB6 effort very soon (and then maybe consider upgrading the customer to VB.Net to take advantage of web services and the easy winform deployment story via web browser).

Bottom line: programmers write better code without the tempting crutch of edit and continue.
Darrell wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 10:06 AM
>> "Now, when the selection pressure for MS is to make tools easier, not more effective, don't you think we'll end up with less and less *good* .NET developers over time?"
- Less good developers as a percentage overall, maybe. But is that necessarily a bad thing? Microsoft makes programmers out of business people, and those business people write apps that would never be cost effective if developed by professionals. If those business apps later need to be upgrade to full-fledged line-of-business apps, then great! We've created an opportunity. If not, then at least the business problems are getting solved somehow. On the flip side it does create a lot of below-average coders, but I think that will always be a problem regardless of the tools/IDE/language/etc.

>> "When the MS tools are eaiser to misuse than others, is this slightly concerning to you?"
- Microsoft is always focused on developers! developers! developers!!! :) If you want a programming environment that generally *enforces* good programming habits, I suggest you check out J2EE and the related stuff. Of course, all that complexity may be overkill for smaller applications....

Nice jab at me over on Jeff Donici's blog. :)
Brendan Tompkins wrote re: Think first, THEN Edit and Continue...
on 10-19-2004 10:18 AM
Ha! D. That wasn't a jab at you... Um. Well at least I don't think it was! It was just that he supported *my* agrument and all I was getting over here was an ear-full from my supposed best budds... ;)
Don Demsak wrote re: Think first, THEN Edit and Continue...
on 10-24-2004 2:01 PM
I have the same problem with EnC as I do with bad coding techniques in presentations. The wise know how to use it(them), and all the rest just abuse it and never think about what (or why) they are doing.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?