CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

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



Comments

Darrell said:

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.
# October 19, 2004 3:23 AM

Brendan Tompkins said:

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.
# October 19, 2004 3:36 AM

Mark Bonafe said:

"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?
# October 19, 2004 5:00 AM

Brendan Tompkins said:

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.
# October 19, 2004 5:16 AM

Paul Laudeman said:

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.
# October 19, 2004 5:17 AM

Brendan Tompkins said:

Oy Vey.
# October 19, 2004 5:18 AM

Mark Bonafe said:

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
# October 19, 2004 6:51 AM

Brendan Tompkins said:

Once you run IIS Lockdown, most of your VS debugging is "Turned Off" anyway. ;)
# October 19, 2004 6:54 AM

Paul Laudeman said:

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.
# October 19, 2004 7:34 AM

Brendan Tompkins said:

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
# October 19, 2004 7:40 AM

grant said:

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.
# October 19, 2004 10:04 AM

Darrell said:

>> "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. :)
# October 19, 2004 10:06 AM

Brendan Tompkins said:

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... ;)
# October 19, 2004 10:18 AM

Don Demsak said:

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.
# October 24, 2004 2:01 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!

Our Sponsors