T
Tom
isSelected in big DataGrids is very time-consuming. I would be nice to have
a property with some kind of list of currently selected rows.
a property with some kind of list of currently selected rows.
Tom said:isSelected in big DataGrids is very time-consuming. I would be nice to have
a property with some kind of list of currently selected rows.
3) Java-like enums (they're really, really great![]()
Daniel O'Connell said:Out of curiosity, what do you like about them over C# enums?
I personally stil want to see casting redesigned.
1) Get rid of the lock statement, replace it with "using" and an
appropriate Disposable type. See
http://www.pobox.com/~skeet/csharp/threads/alternative.shtml
2) A way of declaring a variable as being private to a property
3) Java-like enums (they're really, really great![]()
4) Classes being sealed by default
5) Changes to the behaviour of beforefieldinit:
http://www.pobox.com/~skeet/csharp/beforefieldinit.html
6) A simple way of declaring simple properties (i.e. properties which
just get/set values in the obvious way.) This could use suggestion 2...
7) In generics, I *think* the Java concept of '?' is useful, eg:
List<? extends ISomething> x = GetThisList();
foreach (ISomething : x)
{
...
}
cody said:What do you mean with that? What is wrong with casting in your eyes?
cody said:They could theoretically change the lock statement so that is internally
works exactly like your proposed solution but that could cause compatibility
problems, I think.
This would be a good idea.
yes they are more OO and more useful because you nearly always have to
associate humanfriendly and localizable names to the enum.
I do not agree with this one, because classes should alway be made
inheritable otherwise it wouldn't be really OO, if your class must not be
inheritable, due to security, compatibility or performance reasons you use
sealed but that should be a very rare exception, I never really needed it.
"any type with a static initializer or an explicit static constructor should
not (by default) be marked as beforefieldinit"
I do not agree with that. In almost all cases you do not care when exactly
the static fields are initialized, this is not worth the performance impact.
Having a attribute to specify the beforefieldinit is a great idea, Iam even
wondering if it would be possible to have tis attribute not per class but
per field, so the static field initializers are effectivly grouped in 2
static ctors - one with beforefieldinit, and one without.
You mean something like that:
public class Test
{
public property int Number;
}
which would create a property and a private variable named _number or
something like that.
Yup.
If I understand it correctly this won't work in .NET. In .NET specialized
classes are difference classes that is, you cannot cast IList<string> to
IList<object>, specialized classes doesn't even share the same static
variables, each specialisation get their own. Also in Java you cannot use
primitives like int as type parameter (you can but then the system uses the
integer class which is an object) , therefore I believe it won't work in
.NET.
ReturnValueImportantAttribute. If the return value was ignored the
compiler would throw a warning or something. It would catch some
common errors when using immutable classes.
That's not what that would be saying though. It would be saying "this
is a list of things which derive from ISomething". You wouldn't be able
to *add* to the list, but you'd be able to get anything out of the list
and treat it as an ISomething.
cody said:I'd vote for functionstyle casting.
MyType b = MyType(a);
This also has the advantage that you can "override" the casting operation
if
you create a method named MyType which returns MyType, others may see this
as disadvantage, however..
*converting*. () has complex rules as to what happens. This makes
determining what a cast will actually do difficult.
cody said:But this is a good thing, IMO. Maybe you have to refactor your code so
that some casts would be invalid now:
myEnum = (MyEnum)GetInt32();
If you change MyEnum from enum to a class or struct you just have to add a
userdefined conversion operator to that class/struct and the code would be
legal again.
If there would be a different syntax between conversion/cast you had to
change all lines from "cast GetInt32()to MyEnum" to "convert GetInt32() to
MyEnum" or something like that.
Jon said:8) AOP
Thomas Due said:It might be a stupid question, but what is AOP?
cody said:The question is: Is this just a syntax thing, which means that the variable
really is IList<CertainType> under the hood, but the compiler only allows
certain operations on the variable as if the type would be unknown (besides
the fact it is derived from ISomething)?
cody said:I'd vote for functionstyle casting.
MyType b = MyType(a);
This also has the advantage that you can "override" the casting
operation if you create a method named MyType which returns MyType,
others may see this as disadvantage, however..