wkempf said:
TommyCarlier said:
*snip*
Yeah, I'm not sure which is more exciting, the named parameters or the default parameters (named parameters would be nearly pointless without default parameters, but that doesn't change the question)? Glad we're getting both, though. Now if we can only get
nameof() into the language. 
Talking about a wish list for C#...
Since destructors in C# are essentially useless if you want to execute some code at the exact time when the object goes out of scope, and using try/finally blocks can get messy, I was thinking of other ways to deal with that.
One way would be to add the virtual method "OnScopeExit" to the "object" class. Then you can override that in your own classes to do whatever you want. This won’t need to break old code because if you never overrode object.OnScopeExit, no functionally
is modified.
Of course the big problem here is that classes are ref objects, so them going out of scope might be difficult to pinpoint, especially when you can pass that ref along to something else. But there might be a way to determine from the runtime when the
last ref goes out of scope (or not).
Then again, it sounds like a can of worms. Any better ideas?
Another wish list item: Any word of getting edit-and-continue to work around anonymous methods? I use anonymous methods a lot and hate the fact that as soon as there is an anonymous method in sight, edit-and-continue is disabled. I love the fact that
I can create an empty stub method, put a breakpoint at its start, run, hit the breakpoint and write/debug the whole method without restarting once. But not so much with anonymous methods...
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.