Hi all. Over the last few months while working on projects, I have become... Frustrated, if you will, at a lack of some features from other languages, that can be put into C#.
- The My feature from VB. This is one handy little feature ;)
- The union keyword. Creating unions through attributes is just plain tedious.
- Default parameters. These save writing extra functions, especially when you have more than five or so default parameters.
Other than that, C# is a very sexy language :D

Things I would like to see in C# 3.0
newSB
Is the My-features the MyBase and MyClass I never used VB myself. Doesen't base and typeof(this) do the same thing
union would be nice. If i'd ever need it :D Well in native interop, it would be very handy since Windows API often requires structs with unions as a parameter (that is if the marshaling of those types would work without extra effort).
Default parameters are intentionally left out, since it makes proper method overloading hard. Also in many coding rules for C++ its not allowed to use default parameters for the very same reason. I'd not add this feature for C# (nor for any language). Same effect can be achieved with smart method overloading. The method with most parameters should only define functionality, and others just call that method, replacing some parameters with the default values.
And I agree with the latter point, I'm also totally in love with C# ;)
bnbkjj;k'l
No, the My feature is a language feature that encapsulates the computer. For example, My.Settings.Foo would be accessing the Foo setting, without explicitly creating a Settings class. I beleive that VB uses CodeDOM to generate the needed code; it's kind of like using the C preprocessor and #define.
With the default parameters one, this is not particuarly a good idea if you're trying to create a real-time 3d engine (which is what I'm doing), as it adds the overhead of another function call. Of course, the compiler may inline the manually called function, however, I'm not sure about that.
And Brian, thanks for the link :)
JimBoDH
> The union keyword. Creating unions through attributes is just plain tedious.
While unions are less safe, C# does support them. Why is making it easier to use an "evil" thing
Brian
MFZ
Yeah, i have to concur with you there. My reaction really was the strong use of "evil." None of the suggestions are "evil." If a feature doesn't make sense in C#, a justification is more educational.
Christian Hassa
wking1994
You can simply add the My functionality to C#, but can you explain why you want these things in C#
If you want to discusse this, please join the C# Language chat on April 20, 2006 1:00 - 2:00 P.M. Pacific time.
Bill T.
You can file a suggestion in MSDN Product feedback here:
http://lab.msdn.microsoft.com/ProductFeedback/makesuggestion/search.aspx
Also, a well-justified suggestion will be more likely to be given serious consideration.
Brian
RobertMC
I'm not VB programmer and don't know details about My, but accessing settings is C# is really simple - Properties.Settings.Default.Foo and if you don't like Properties namespace (I don't like it) - simply change default namespace in settings file properties. Or you can define own class:
class My{
public static Properties.Settings Settings{
get { return Properties.Settings.Default; }}
}
What else "My" have that you miss here
As mentioned before, default params are intentionally disabled, as multipe inheritance. Such features in language add complexity in exchange to what