tags:

views:

4551

answers:

11
+2  A: 

Any information for C# post-4.0 would be speculation and rumor at this point. Planning for the next release is in its infancy.

(edit) In addition, the language feature you mentioned is pure rumor.

Dustin Campbell
Understood. However, I would be willing to bet that the C# team already has a basic roadmap for the next few releases. Furthermore, it should be possible to quantify how speculative each piece of information is.
Robert Venables
As far as the roadmap notion goes, there are definitely certain problems that both the C# and VB language design teams hope to address in future releases. However, that doesn't really translate into "we're going to do feature X in version Y". *All* feature speculation at this point is pure, unadulterated speculation. :-)
Dustin Campbell
lol - speculate away! Don't let me stifle the fun!
Dustin Campbell
You'd lose that bet. From my perspective at least, we're mapless. Senior management might have a better idea of where they want things to go.
Eric Lippert
+1  A: 

I have heard that there will eventually be a shell, making it even closer to a scripting language. I don't recall the other items, but you can watch toward the end of The Future of C# interview with Anders.

James M.
I think this is a reference to the REPL prototype that Anders showed at the last PDC.
Dustin Campbell
+5  A: 

A good resource for musings and speculations about where the C# language is going (and why) is Eric Lippert's Fabulous Adventures in Coding blog. Eric is a senior developer on the Microsoft C# compiler team and a frequent contributor to this site.

Enjoy,

Robert C. Cartaino

Robert Cartaino
+5  A: 

I'm hoping for:

  • fieldof(string.Empty) (FieldInfo) and methodof(string.ToString) (MethodInfo) operators
  • Ability to use the initblk and cpblk IL instructions in unsafe code
280Z28
I agree that infoof be awesome. However, doing it right has always been too expensive, and we don't want to do it weakly: http://blogs.msdn.com/ericlippert/archive/2009/05/21/in-foof-we-trust-a-dialogue.aspx
Eric Lippert
I know you say that. I personally, however, would upgrade to C#4 if you'd done that even if you hadn't done anything else.
erikkallen
+9  A: 

In C# 5.0 we will see the opening up of the compiler with an API allowing you to call in to create pieces of code at run-time! This is something of the coolest and most powerful C# has gotten added with that I know of. It will take some time still before we see this addition but it will be here soon. I can’t wait! Anders showed you can make strings into runable code – a really powerful scripting engine that is – in the run time and execute them at will. This dynamic code will appear as needed and disappear when used to end. This is so awesome!

http://blog.noop.se/archive/2008/10/28/the-future-of-c-4.0-and-then-5.0.aspx

C# 5.0 Features: Well, the one thing we do know about C# 5.0 is that Microsoft is trying to deliver this concept of "Compiler as a Service". Building on the dynamic concepts of 3.0 and 4.0 this will introduce an "eval" capability.

http://www.matthewlefevre.com/blog/entry.php/c-40-and-c-50/368

Diadistis
If this is something you want, then your eyes will probably pop out when you see the C# Code Dom. http://msdn.microsoft.com/en-us/library/650ax5cx.aspx
Spence
See: http://msdn.microsoft.com/en-us/library/3y322t50.aspx
Robert Venables
None of that is a **language** feature; it is framework etc. Besides, there are at least 4 different ways of being to create code at runtime at the moment; ILGenerator, CodeDom, CSharpCodeProvider, Expression
Marc Gravell
+14  A: 

In pure, awesome speculation I predict there will be...

Partial function application

some_fun("Hello World", _, 42, _)

as shorthand for

(x, y) => some_fun("Hello World", x, 42, y)

Also works for member access, so you can write

pets.OrderBy(_.Age).Select(_.ToString())

instead of

pets.OrderBy(x => x.Age).Select(x => x.ToString())
dtb
The last part would be nice... I never know how to call the lambda variable. In the case of very simple lambdas like the ones in your example, it'd be great to just skip the lambda parameter declaration.
Meta-Knight
This is Scala! You'll find many desired features there.
Jordão
+3  A: 

I'm hoping they integrate Tuple's and pattern matching like: http://en.wikibooks.org/wiki/Erlang_Programming/Pattern_Matching It would make returning multiple things from a method cleaner. It would make multithreaded calls faster. It would be a non oo way of getting data across.

I'm also hoping for something that will never happen... switch case fall-through.

maxfridbe
Just end your switch case with a goto that goes where you want.
Eric Lippert
The BCL that we're about to ship will have a standard tuple type. It's unclear whether that warrants a special syntax in the language though.
Eric Lippert
F#-style deconstruction of tuples would certainly be convenient. Something like `var a, b = GetATuple();`. In my opinion at least that much special syntax would be more than worth it.
Joel Mueller
+27  A: 

As others have said, it's all pure speculation at this point. We have not even shipped C# 4.0 yet, and we have not announced that there will be anything past that. Any discussion of hypothetical features of hypothetical future versions should be taken as "for entertainment purposes only" and not as a promise of any particular feature on any particular schedule.

All that said: it is probably best to assume that the hypothetical next version of C# will concentrate more on "tooling" features than "language" features. Many of the language features we would consider doing in the future, many of the IDE features we would consider doing in the future, and many of the IDE extension features that third parties would like to do, all depend upon being able to treat the compiler as an "analysis engine" rather than as a traditional "code generator".

We have only limited budgets here, and so any work we do on improving the tooling infrastructure is work we're not doing on language features.

This is of course not to say that we don't have a LONG wish list of language features. I've hinted on my blog that we are well aware that metaprogramming, asynchronous programming, parallel programming and immutable data programming are all increasingly important in the industry. But those themes are huge and how they translate into specific features is unclear. We understand that there is a lot of work to do in the tools space that adds value to the language, and so it is entirely possible that the hypothetical next release will concentrate more on that.

But again, this is all speculation. We'll see what feedback we get, what the budget situation is like, and so on.

Eric Lippert
Eric, can you please consider giving us a keyword we can use to specify the type of "this" as a generic parameter?To explain what I mean:I want to be able to have a field:IList<type_of_me> ListOfOthersLikeMe;That would have MANY uses.Oh, and "friend class" would be nice... so we can force the will of Demeter better on all those Morts who have NO idea...
Turing Complete
@Turing Complete: Suppose you are in a method of base class B, and you are calling the method via a receiver of derived type D. You would want the list to be a list of D? How then would you be able to add anything other than "this" to the list and still maintain static type safety?
Eric Lippert
Thank you for your reply... the case I had in mind was of course something different than the list - example.I was thinking about the SessionManager - thing that is useful with (the a bit complex) duplex WCF - services, where one could use the "type of this" - keyword to get the right SessionManager - multiton - instance.Looks like this:public sealed class SessionManager<T> where T : DuplexServiceBaseand in DuplexServiceBase:SessionManager<type_of_this>.Current.Connect(this);This is the case I REALLY had in mind.
Turing Complete
Oh, and one other thing... I'm very glad you created C# at Microsoft. It's basically the programming language I was waiting for all of my life, it has replaced everything else I ever used. It's not perfect (yet), but nothing else gets closer to perfection. :-)
Turing Complete
+11  A: 

I hope they will add something like the "Elvis Operator" (?:) and "Safe Navigation" (?.) from Groovy. Examples how it could look like:

The Elvis Operator is a more compact way to set a default value instead of using a null-check and the standard ternary operator.

rockstar = rockstar != null ? rockstar : "Elvis Presley";

would become

rockstar = rockstar ?: "Elvis Presley";

The Safe Navigation operator keeps you from writing multiple chained null-checks.

User user = User.find("admin");      // might be null if 'admin' does not exist
String streetName = null;
if (user != null && user.address != null) {
    streetName = user.address.street;
}

can be simplified to

User user = User.find("admin");      // might be null if 'admin' does not exist
String streetName = user?.address?.street;

streetName will be null if any one of user, user.address or user.address.street is null. No NullPointerException will be thrown.

Claes Mogren
Your first theoretical example is already in the language: rockstar = rockstar ?: "Elvis Presley";Can be written in 3.5 as: rockstar = rockstar ?? "Elvis Presley";
Will
+1 for the 'safe dereferencing operator' (or 'safe navigation operator' as you call it). Will's right about the 'Elvis Operator' though.
jeroenh
@Will, actually it's already there in 2.0, it was introduced at the same time as nullable types
Thomas Levesque
A: 

I Agree with Claes Mogren. That Safe-Navigation operator is a must!

Néstor Sánchez A.
+5  A: 

mixins must have mixins!

mixins
Skeet has a great suggestion for this here: http://stackoverflow.com/questions/255553/is-it-possible-to-implement-mixins-in-c/255621#255621
Schneider