|
do anybody suggest me any gud article on 4.0
And what is the raod map of 4.0
|
|
|
|
|
I'd like to have local static varibles.
|
|
|
|
|
How about the ability to partially set array values. For example, for an int array of length 10 with default values of 0..9 respectively, the following would be valid:
myArray[3..5] = (-3, -4, -5);
The contents would then be:
0, 1, 2, -3, -4, -5, 6, 7, 8, 9
Another idea is a composite Label (say Strings and Images). The display of CompositeLabel.Text would display a String followed by an Image then we could have things (using my mythical System.Text.SmileyFace namespace) like . . .
myCompositeLabel.Text = "Hello, World " + System.Text.SmileyFace.BigGrin.ToImage();
The display would then be:
Hello, World
Anthony
|
|
|
|
|
Reminds me of array slices in D, but that may be different.
|
|
|
|
|
|
I bet 99% of you disagree with this one!
I would like to see multiple inheritance and full operator overloading available in C#.
|
|
|
|
|
Ditto! While I seldom use multiple inheritance, it still would be great to have it availble for those times that I do.
|
|
|
|
|
alan.cooper wrote: multiple inheritance
Yes, or at least mixins.
It's my foot and I'll blow it off if I want.
|
|
|
|
|
I believe this is a programming question!
|
|
|
|
|
No it's not. I'm not asking how to solve anything. Simply a feature ideas request. And since you're the only one so far to suggest this is a programming question, you're the only one who thinks so.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
I think it would be easier to just make it an array of the two ints instead. How would you receive the values from the method call?
|
|
|
|
|
an IMaths interface so writing maths libraries with generics is simpler
|
|
|
|
|
I do sort of like the idea but isn't a function by definition a thing that only returns a single value?
Maybe we need anonymous returns instead so that you define a struct on the fly, thus returning a single entity that contains the multiple values.
public {Max int, Min int} MinMax(int[] numbers)
{
int min, max;
// Code to calculate min/max
return {min, max};
}
called with
var v= MinMax(myArray);
system.out.println(v.Min);
system.out.println(v.Max);
otherwise you'd end up having to create something wierd like this to get the values back
int min, max = MinMax(myArray);
Russell
|
|
|
|
|
You could consider the tuple to be a single value. The single value is the tuple as a whole thing.
public [int,int] MinMax(int[] numbers)
{
int min, max;
// Compute min and max
return tuple[min,max];
}
tuple[int,int] result = MinMax(new[] { 1, 2, 3, 5, 8, 13 });
If tuples were added to C# 4.0, I think they should be added properly, with a native syntax for defining them. Perhapse even support for "anonymous" tuples akin to var:
public [int,string,string,DateTime] TupleFunc()
{
return tuple[1, "String 1", "String 2", DateTime.Now];
}
tuple result = TupleFunc();
int number = result[0];
string firstString = result[1];
|
|
|
|
|
As I posted before, I agree with Ennis Ray Lynch, Jr. that programmers should first learn all features of .Net 2.0 before jumping on new and shiny stuff.
I would personally like to see static interfaces and inheritance from multiple classes.
|
|
|
|
|
Well, I'll be satisfied if C# will become sometime, in the future, as good as Java already is today...
|
|
|
|
|
Yep, that would be handy!
|
|
|
|
|
How about a way to check against all values in an array or enumerabale at once with perhaps the keyword 'any' like below.
int[] supportedValues = new int[] { 3, 4, 5 }
int x = 4;
if (x == any supportedValues)
{
}
Instead of:
int[] supportedValues = new int[] { 3, 4, 5 }
int x = 4;
bool xIsSupported = false;
foreach (int value in supportedValues)
{
if (x == value)
xIsSupported = true;
}
if (xIsSupported)
{
}
Good idea?
|
|
|
|
|
foreach (int value in supportedValues)
{
if (x == value)
{
xIsSupported = true;
break; //why keep on when you are done?
}
}
|
|
|
|
|
lol, it was late and I definately could have used a break, so I just didn't bother with the break. Or should I say didn't bother editing the post and fixing the bug when I realized I had forgotten to throw in the break.
All the more reason the change would be so useful. Not only could it make for less coding, less bugs too.
|
|
|
|
|
Use a HashSet instead of an array.
|
|
|
|
|
I don't want to use a HashSet. The whole point of the change suggestion is flexibility to use with any type of enumerable without having to write the code to iterate through it or convert it. That and a HashSet would only be able to handle the == or != operators. What if I want to use >, <, <= or >=?
|
|
|
|
|
Why not use the Contains extension method? It's almost similar to your syntax.
IEnumerable<int> arr = new int[] { 1, 2, 3 };
int x = 4;
if (arr.Contains(x))
{
Console.WriteLine("Present");
}
</int>
|
|
|
|
|
Perhapse this (.NET 3.5 IEnumerable extensions):
int[] supportedValues = new int[] {3,4,5};
int x = 4;
if (supportedValues.Any(v => v == x))
{
// Do something
}
|
|
|
|
|
The idea is so good they already implemented it in 3.5!
Perhaps I should stop using 2.0. I played with 3.5 briefly to check out WPF and Linq and didn't particularly see much use for them so I decided to stay away because of the performance drawbacks that came with WPF and didn't want to be tempted to use it. I missed the IEnumerable extensions and probably many more features that could come in handy.
Am I the only one that WPF runs like molasses for? If not are there any other features to stay away from in order to perform decent on lowend and older machines?
P.S. - Thanks for the Line Counter add-in! I've been using it for a couple months now.
modified on Friday, October 3, 2008 2:30 AM
|
|
|
|