Reputation: 648
There is an old video of Notch debugging and testing his code and while doing so he simply pauses his game, makes his code modifications, and resume his game with the new changes.
I found this old post explaining how he does it, but I'm wondering if there is an equivalent to Visual Studio 2012.
I know that you can enable Edit and Continue but this is a lot more restricted in the sense that you can't edit anything you want and you need to set a breakpoint. So Edit and Continue is not quite what I'm looking for.
Upvotes: 1
Views: 3317
Reputation: 52659
.NET's edit and continue is nowhere near as good as that provided by Visual C++, Visual Basic or any dynamic (ie script) languages which is a pity.
If you can live with the limitations (having to break execution, no 64-bit support unless you are v4.5.1+, no lambda/linq changes, changing active statements, and a few others) then you should be ok to do pretty much the same. I find though, that I always end up wanting to change something that's unsupported :(
The big alternative is to use unit tests - in that, if you have enough tests you do not need to go debugging into your code at all. I think its debatable whether you save more time or not, and maybe it depends on the programmer style which suits you better.
Upvotes: 1
Reputation: 244757
I know that you can enable Edit and Continue but this is a lot more restricted in the sense that you can't edit anything you want …
Yes, there are some things that you can't edit with Edit and Continue. But that's the best you can do with the current tools, I don't think there is a way around that.
… and you need to set a breakpoint
No, you don't. You can use the “pause” button in VS (real name Break All), edit your code and then let it continue executing.
Upvotes: 4