.Net 4.0 & C#4.0 Opinions
-
Yeah, ditto. It's one of those things that you think should work, but doesn't once you go try it:
var strings = new List() { "hello", "world" };
IEnumerable objectList = strings; // this works nowThe 3 big areas that affect me are
IEnumerable<T>
,Action<T, ...>
andFunc<T...>
Since C# 2.0, method group to delegate conversions can be implicit and covariant in their return types. This means that the following code is valid,
Func<Base> b = GetDerived;
You can see the contra-variance in argument types when usingAction(T)
. See the following code,Action<Derived> a = MethodTakesBase;
I have seen Eric Lippert explains this in his blog, but don't have the URL to provide. :)Navaneeth How to use google | Ask smart questions
-
martin_hughes wrote:
- A rewrite of WWF.
Why? Why not WPF?
Because the current WF is a steaming pile in certain scenarios, such as having to update existing persisted workflows. I hate they are re-writing it (and breaking everything existing), but it's proof that WF wasn't ready when they pushed it out the door. The fact that many Microsoft MVPs and support people scratch their heads when you deep-dive into WF problems says a lot. I've been wanting to get into WPF...played with it a tiny bit within and without the context of SIlverlight. Are the major bugs documented somewhere that can be eyeballed?
-
Yeah, I have popcorn ready for you and the release date. :laugh:
Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon
Surely you mean popfly
Multi famam, conscientiam pauci verentur.(Pliny)
-
Since C# 2.0, method group to delegate conversions can be implicit and covariant in their return types. This means that the following code is valid,
Func<Base> b = GetDerived;
You can see the contra-variance in argument types when usingAction(T)
. See the following code,Action<Derived> a = MethodTakesBase;
I have seen Eric Lippert explains this in his blog, but don't have the URL to provide. :)Navaneeth How to use google | Ask smart questions
N a v a n e e t h wrote:
method group to delegate conversions can be implicit and covariant in their return types.
Yes, but not delegate types themselves.
Func<string> f = null; Func<object> of = f;
won't compile.
Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro
-
WPF already has bugs, they were helping WWF catch up.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
"WTF is WWF?" I asked. From the back a voice suggested "World War Five?". Then the Gargoyle told me, "Its what you've been calling WF, they put some Windows in front of it so you can see the bugs"
Multi famam, conscientiam pauci verentur.(Pliny)
-
Well, Josh Fischer [^] has a decent article on the new features. Parallelization, when I looked at the TPL, it seemed cute, meaning it's easy to parallelize a for loop, but if you really need to work with threads to utilize processors and you really have real work that can be parallelized, then I think TPL is too simplistic, and really doesn't give you that much more. Sure, it hides some details, but so what? I'd rather work more closely with the API than have some additional layer wrap the management of threading. Optional parameters I've missed from the days of C++ since I started working with C#. About time. Dynamic variables seems pointless to me and probably a big performance hit, especially since it looks like the runtime is essentially using reflection to figure out if the object has the property. Everyone complains that declarative programming doesn't allow for compile-time type checking, yet "they" keep adding features to C# that move type checking into the runtime. :sigh: The co-contra variance looks very useful. Com Interop stuff looks like it'll be useful. I don't really care if they rewrite WWF, and am glad I'm not using it if that's the case. Entity Framework--why bother. There's better 3rd party solutions out there, and for anything real, the EF looks way to immature anyways. Marc
I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner
Marc Clifton wrote:
Dynamic variables seems pointless to me and probably a big performance hit, especially since it looks like the runtime is essentially using reflection to figure out if the object has the property.
1. Without them, using types from other dynamic languages (like Python) would be impossible. 2. They make COM Interop a lot less painful. 3. The perf hit is one time - the DLR generates code behind the scenes and caches it. Essentially like the JIT compiler. For the specific scenarios it enables, I think it is very useful. But yes, it can be abused.
Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro
-
Marc Clifton wrote:
Dynamic variables seems pointless to me and probably a big performance hit, especially since it looks like the runtime is essentially using reflection to figure out if the object has the property.
1. Without them, using types from other dynamic languages (like Python) would be impossible. 2. They make COM Interop a lot less painful. 3. The perf hit is one time - the DLR generates code behind the scenes and caches it. Essentially like the JIT compiler. For the specific scenarios it enables, I think it is very useful. But yes, it can be abused.
Regards Senthil _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro
S. Senthil Kumar wrote:
For the specific scenarios it enables, I think it is very useful. But yes, it can be abused.
Ah, thanks for the clarification. I can just imagine though, people using the "dynamic" keyword everywhere, just as they now use "var" everywhere, even when completely unnecessary. Marc
I'm not overthinking the problem, I just felt like I needed a small, unimportant, uninteresting rant! - Martin Hart Turner
-
Seeing as how we're still developing in .NET 1.0 where I work with no plans to upgrade any time soon, I don't really care about 4.0.
Work harder. Millions on wellfare depend on you.
omg that's one of the reasons i'm a freelancer now, i dont like walls ;)