What do you want in the next version of VS/C# (part 3)

Ok, a day passed and there were very few updates made so I thought I'd push this forward.  Now it's time for everyone to vote to help get an idea about how interested people are in these features.  Use the contact link to send your votes in.  I'll tabulate them and let everyone now what the results.  Of course, this doesn't mean we'll definitely do them, but it will help us understand better how people feel. 

Here's how I'd appreciate the votes to come in:

  1. Put the word "voting" in the title of the message (like "voting on c# features"). It will help make sure that i don't miss any messages
  2. Break the features into things you definitely want and things you definitely don't want.  If you leave something out I'll assume it's something you don't care about.  I'd also appreciate comments on this as well.  If you want something, why you want it.  If you don't want it, why you don't want it.  Those of you who already gave reasons in the thread are exempt from this.  This part is totally optional, but it will help tremendously in understanding the reasons why people want the feature.  The “why” part is really important for us so that we can examine everything we're doing and determining if they're things that will help you.

  3. For the features you want rank them in the order of how important they are to you.  Make the feature you want to see the most as '1', then the one you'd want to see next with '2', etc.

That's it.  Just pick the features and then rank them πŸ™‚

If you don't see what you want in the list just include it in the email.

Comments (46)
  1. Kees van Sighem says:

    I want a "with" statment in C#.

    Missing it is the only thing that sometimes makes me whish I was progrmamming in Pascal again

  2. Kees, what would you do with the "with" statement.

  3. Please, no "with" statement. In theory a good idea, I simply have read too much bad code MISusing "with".

  4. Laura T. says:

    I’d like to see something like forall(<collection>|<array>) do function(<object_param>). It would cut code and mabye more efficient than foreach() { call fn() }.

  5. Max Battcher says:

    If we’re talking language features, I’m not sure about the forall() idea… but, I think it comes up often enough (and is in a few other languages), and could even be something that can be optimized between compiler and collection classes, but I would propose an optional where clause for foreach:

    foreach (int num in myCollection) where (num > 3) {


    I had also (falsely) assumed that foreach did type-checking before casting and skipped members of other types, as that’s something I’ve needed, but that could be accomplished with:

    foreach (SomeType thing in aCollection) where (thing is SomeType) {


    I know Generics will help some, but in the particular case where foreach’s current behavior became a hassle was when I was storing (for example) Apples and Oranges in a Fruit Collection and wanted to iterate over just the Apples or just the Oranges. Using Apple for SomeType would cause Casting exceptions (can’t cast Orange to Apple), and so I would have to iterate with some base class (in one particular case having to go all the way up to object), if (thing is Apple) and then use thing as Apple… Again, I would think it would be possible to allow non-Generic Collections to optimize this sort of a foreach ("give me just the Oranges").

    Another quick example: "give me just the Buttons in the Form’s Components".

  6. kevin white says:

    What do I want in the next version of VS?

    An espresso maker powerful enough to land a donkey on the Moon.

  7. My biggest pet peeve with VS right now is how slow the Forms designer gets with a complicated GUI. I’m on a reasonably fast machine (Pentium 4, 1.8 GHz) and sometimes it’s taken up to 30 seconds to go between the designer and the code because it is updating. (Although on one hand it does force you to separate as much stuff from the GUI as possible πŸ™‚ )

    One thing I like in Snippet Compiler is when you select or highlite a bracket of some kind (ie. { [ () ] } ) it outlines both the opening and closing bracket for that set. I don’t necessarily like the way Snippet Compiler highlites the bracket (a red outline), and prefer just a simple bold like VS uses when a bracket is closed.

    Speaking of brackets, the ability to collapse a region from the ending bracket would be awesome.

    Another thing would be an easier way to create modeless dialog boxes.

    Thanks for the ability to vocalize this!

  8. Sam Wu says:

    Did somebody already mention Aspects? like AspectJ?

  9. Andreas says:

    tail recursion

  10. Laura: How is:

    forall (collection) do function(blah) better than.



    That’s supported with the new Whidbey generic collections

  11. Max: How is that better than:

    foreach (int num in myCollection)

    if (num > 3) {



    Also, you could do this.

    myCollection.Filter(delegate (Fruit f) { return f is Orange; })

  12. Kevin: We can land a haiku on the moon. will that work?

  13. Scott: Working on performance in the forms designer is very improtant and something I know I’m going to work very hard on. It’s a tough problem (of could I know you don’t want excuses), but we’re committed to making the experience much better in VS 2005.

    Also, we know highlight the matching brace when you are next to one. We use a very fine grey highlight (which you can configure if you want). It stays out of the way when you don’t want to be distracted, but you can find it when you want it.

    we’ve thought about support for collapsing brackets, maybe as an option.

    wht’s a modeless dialog box?

  14. Sam: Yes, we’ve been discussing aspects. What are you interested in aspects for? We’re thinking about more powerful systems that would be able to do more than aspects are currently capable of.

  15. Andreas: Tail recursion is supported in the runtime.

  16. adam says:

    please say no to the vb style with statement. There are already enough code obfuscators available.

  17. Aleksei Guzev says:

    Right-click close to a brace and select command "Select block" or "Highlight block". This could inclusively select everything from the brace to the matching one.

  18. Laura T. says:

    > Laura: How is:


    > forall (collection) do function(blah) better than.

    > collection.ForAll(function);


    > ?


    > That’s supported with the new Whidbey generic collections

    Sorry, I did not read the docs very well. I missed the ForAll() method.

    But still I’d see forall()..do a better, first of all for readability. For me (IMHO) the collection.ForAll reads ‘collection, do this’. forall() I’d read ‘for every x in y do this’, which describes better what I’m doing. For me. Also forall() doesn’t imply only collections..?

    Also, with forall() (as I’d imagine it), i could put a function inside the forall() to return a filtered collection, forall(getXCollection(baseCollection)) do x().

  19. Laura: Whoops. I meant to say:


    not ForAll. ForAll takes a predicate and returns true if teh predicate is true for every element in the collection.

    Does that name work better for you?

  20. Aleksei: ctrl-shift-] will do what you’re asking. It will inclusively select everything from the brace to the matching one πŸ™‚

  21. mike says:

    If you want to iterate over a filtered collection, you should just be able to do something like this:

    //using the fruit example from earlier

    collectionOfFruit.ForAll(delegate(Fruit f) {

    return f is Orange;

    }).ForEach(delegate(Orange o) {



    (i think)

  22. Mike: Yup. Except that it’s:

    collectionOfFruit.Filter(delegate(Fruit f) { return f is Orange; }).ForEach(delegate(Orange o) {



    i.e. Filter instead of ForAll.

  23. Laura T. says:


    I still think that the method style is quite specialized and in some cases not so readable:

    To say this:

    collectionOfFruit.Filter(delegate(Fruit f) { return f is Orange; }).ForEach(delegate(Orange o) {



    I could say:

    forall(typeof(Fruit) in collectionOfFruit) do Squeeze();


    forall(GetOranges(collectionOfFruit)) do Squeeze();

    I think it’s a little bit readable and also more optimizable by the compiler, or am I missing something?

    (I’d prefer to avoid foreach as a name as it’s also a c# keyword)

    forall(<expression yielding object(s)>) <function|method>, for me, would be more general form and more open for future enhancements. Within an expression, I could turn almost any union of objects (not implementing IEnumerable) into an enumerable collection when needed, only temporarly (temp var instead of declared). This could optimize things more?


  24. Laura: You’re absolutely write. The syntax leave a lot to be desired. Anders and the other language designers are working hard to make these kind of things easier in the future.

    You should talk to Orion and AT. They also would like to see language improvments in this area and have also made some excellent suggestions as to how to go about doing it.

    I see your conern with the ForEach. With the API i wrote i named it "Iterate" instead since it indicated that it would allow you to iterate over all the elements in the collection.

    I’m ok with ForEach though. When you see:

    foreach (A a in c)



    It means execute the following block "for each" element "a" in the collection "c". When you see:

    c.ForEach(delegate (A a) { })

    Then it means the exact same thing and so ForEach is an appropriate name for it.

    Luke and I were talking about syntax and I’d like it show up as:

    c.ForEach((A a) { }).

    Very compact and useful.

    Yours is still more readable though πŸ™‚

  25. Laura T. says:


    I see your point with foreach. Yes, it means exactly the same, but doesn’t the "exactly the same" leave a doubt "are they the same?". I mean, it’s overloading the semantics. That leaves space for controversials, like should I use Convert.xxx or (cast). Which is better? (ok, they are not exactly the same, but that’s not the point). If I yield the same result, why should I decide. As you see, I’m a fan of ‘one-way to do it’. This helps also to standardize the coding, and also learning. That’s why i liked to name the keyword ForAll, so that I can sy ‘whey you need to do x in this way, use forall, otherwise use foreach. Just my _humble_ opinion.

    I like the syntax a lot. Hope to see it soon.

    I would certainly talk to Orion and AT if you could give me details how to contact them.

    For other improvements, I’ll use your vote email. Think it’s easier for you too. Getting tons of them? πŸ˜‰



  26. Laura: Too true…

    What’s funny is that I’m usually the one voting for "let’s just have one way to do this!!"

    The problem is when you have the existing feeatures that you’d like to get rid of. For example, I’d just prefer to get rid of "foreach" and have "ForEach" instead. πŸ™‚

    However, with the blog I like to play devil’s advocate a lot. If you can convince me, then I’m going to definitely push for those features more.

  27. Laura: Too true…

    What’s funny is that I’m usually the one voting for "let’s just have one way to do this!!"

    The problem is when you have the existing feeatures that you’d like to get rid of. For example, I’d just prefer to get rid of "foreach" and have "ForEach" instead. πŸ™‚

    However, with the blog I like to play devil’s advocate a lot. If you can convince me, then I’m going to definitely push for those features more.

  28. Oh, and yes, lots of responses so far. When it dies down I’ll give out the results.

  29. Laura T. says:

    Cyrus: I know, existing base is quite often a sad story.

    I might not have convinced you (?) but at least we do agree.

    Hopefully the release date remains the same. πŸ˜‰


  30. ShadowChaser says:

    I’d really like to see improvements to the tasks system, namely:

    * The ability for // TODO:, // HACK: and // UNDONE: items to show up in the task list even when the document is not open. ( I heard this was already added? )

    * A new task-list tag called // BUG: would be nice, for those known bugs that you just don’t have time to do yet…

    * "Normal" tasks (the ones you add using the task editor and not enter into code) do not synchronize with the source control server. If I ever need to pull down a new copy of my project, all of my tasks vanish. This is probably a difficult one to fix though, and maybe already is addressed with the new Team System. Make sure that Team System integrates with the existing task list – it would be horrible having two seperate locations.. πŸ™

    * The ability to have optional "FxCop" style warnings appear in the output (or task) window at compilation time. (for C# that is, C++ already has a few optional warnings)

    * This might be out of the scope of the IDE, but I think many developers (including myself) desperately need a CLR-Compliant, *redistributable* "minidump" generator that can be shipped with applications. The one with the DDK(?) is non-redistributable, rendering it effectively useless for end-user debugging.

    * Please please please contact whoever wrote the "Binding class" and try to get them to fix some of its serious bugs:

    * Make PushData/PullData public (or at least protected)

    * Null values get turned into DBNull.Value (which promptly crashes a business object since business objects do not understand DBNull.value – they are strongly typed!)

    * Format/Parse events do not execute when bound to a control’s property declared as object.

    * For example, try binding a custom business entity to a ComboBox’s "SelectedObject" property – it can’t be done! πŸ™

    * Binding class is not sealed, yet there are no virtual or protected methods – no reason to subclass it.

    I’ve spent the past 3 or so weeks writing workarounds since due to these bugs I can effectively only bind simple types like string or int :/

  31. ShadowChaser says:

    I like the idea of a "filtered" for all, but I understand why the syntax could get confusing.

    How about a "foronly" ? I agree with mike, I had the exact same problem when I first started using the forall command.

    foronly (MyCustomObject blah in TheCollection)


    // No type check!


    I brought this one up before, but I think it is *very* important to have an "ObjectCreated" event that is automatically executed after the object is fully constructed. It would give a place to call virutal methods right after construction.

    Cyrus mentioned earlier that I should probably have a public virtual Initialize method that the caller would call immediately after contruction (usefull in a factory pattern, I imagine), but that doesn’t help when writing custom controls – If I am shipping a component to someone else, I can’t guarantee they will call my initialize method. The only way I can think of to have this work perfectly would be to add it into the CLR.

    Right now, when I *really* need to call a virtual function during construction and there is no other way, I just call it from the constructor and do a little prayer that it won’t crash πŸ˜‰ (and also seal all of my descendant classes). I’d really like a way around that mess πŸ˜›

    Sorry about the double post!

  32. Shadow: I completely understand the need for such an event. My comment about the virtual "Initialize" was prompted by teh current state of affairs (plus my experience with Objective-C). I believe that this is something the CLR is considering for this exact reason.

  33. Sam Wu says:

    Cyrus: Regarding Aspects, in my current project, I have an MVC Controller in which every method basically does

    public void DoSomething()


    // enter monitor

    // acquire read lock

    // check some state

    // release read lock

    // exit monitor


    I have about 20 different methods which repeat this pattern. I couldn’t think of any way to refactor this further other than creating some sort of before/after/around Aspect. I managed to wrap up all that logic in a using{} statement but Aspects would still be cleaner I think.

  34. Sam: I am intrigued by this. The normal use of an aspect it to provide some orthogonal concept to your code that isn’t related to the core idea. Like logging. I’ve never heard of threadsafety as part of that orthogonal concept.

    (BTW. Why do you need the monitor and the read lock?)

    I’m curious… with an aspect, it would be completely unclear to a reader of your code that it was threadsafe. Is that a good idea? (seriously)

    I’m quite curious…

    IMO (which could be very wrong), i would actually prefer to see:

    public void DoSomething()


    using (thingThatMakesThisThreadSafe.Acquire())





    That way it’s completely clear what’s going on.

  35. Sam Wu says:

    Cyrus: I have to admit that clear code hasn’t been a top priority since I’m pretty much working on a one-man project (web application). When I said "cleaner" before, I might’ve been thinking "shorter".

    With both the monitor and the read lock, let me give some more detail on what the code is doing.

    public void DoSomething()


    // enter monitor

    // acquire read lock on global data

    if ( checkSomeState() ) then


    // do something that accesses global data


    // release read lock

    // exit monitor


    The read lock is on global data. I have a background process which periodically refreshes the global data. When any updates are encountered, the background process gets a write lock on the global data and updates.

    In order to have the conditional execution of the body of the method, I used a (very) ugly hack of throwing an exception from my IDisposable object to jump over the whole thing. Possibly I could conditionally execute using an anonymous method instead, when C# 2.0 comes out.

    If i were to get rid of the monitor enter/exit with just a lock statement, I still need to repeat the read lock and the state check, conditional execution in every method. Based on what little I know about aspects (from just reading), I could use around advice for that.

  36. Sascha Lehmann says:

    Microsoft.CSharp.CSharpCodeProvider.CreateParser should return a working CodeDom parser instead of null.

  37. I saw this comment on Slashdot today:

    "But even for Windows work, by far and away the most annoying ‘feature’ of DevStudio is the retarded context sensitive help. I’ve lost count of the number of times that I’ve hit F1 over something in a Win32 C++ project to be taken to a help page for Windows CE. I’m not sure what context it seems to be using, but it has nothing to do with what I’m doing. "

    Ahem. Anyway, disregarding his bitterness, the comment holds: I very very often find myself bombarded with docs for Windows CE although I’ve never ever needed to use them. Maybe there could be a way to simply uninstall the whole WinCE portion of the docs? (Maybe there is and I just don’t know about it?)

  38. Rick: I’ve sent this feedback to our User Education team. They’re trying very very hard in this area to make the docs correspond to what you intended.

  39. Sascha: Yup, lots of people have asked for that as well

  40. Concure with Microsoft.CSharp.CSharpCodeProvider.CreateParser and CreatParser

    but same for…




    Hay, do you see a pattern here…


    Regex should support working with Streams natively (don’t just load the whole thing in memory, heck I can do that). Thus allowing Regex to be run against really large files.

Comments are closed.

Skip to main content