http://www.hd720i.com/Future-of-CSharp-vs-future-of-VB-274987.aspx
http://www.hd720i.com/Visual-Basic-is-Dead-267983.aspx
Thanks for all your help and time.
As I understand it, you shouldn't use it to connect to classes within
your project. For that, the "old fashioned way" is best.
The "dynamic" works best when you want to execute code that is not
available at compile-time, such as COM objects or javascript routines
(from within a Silverlight application). *Then* you would have a much
easier syntax due to late-binding, then now, where you need to use
various "tricks" to make it work.
Hans Kesting
> I dont see why dynamics in .NET 4.0 is "a big thing". I dont see why
> this is a great step forward. I which cases is it good to use dynamics?
> Maybe someone can help me to understand?
As I understand it, the main motivation for optional arguments and
"dynamic" in C# (note that VB.NET has had both of these features for some
time) is to improve the COM interop situation, especially as it relates to
Office.
Another big win, however, is that it enhances the ability to mix C# with
the .NET-enabled versions of Python and Ruby (IronPython and IronRuby
respectively).
Whether this is literally "a great step forward" or not probably depends
on one's point of view.
No doubt if you spend some time with Google, you can find a number of
discussions of specific examples of how the new .NET 4.0 features will be
used. But hopefully the above gives you a nudge in the right direction.
Pete
> I dont see why dynamics in .NET 4.0 is "a big thing". I dont see why
> this is a great step forward. I which cases is it good to use
> dynamics? Maybe someone can help me to understand?
>
Dynamics allow you to more loosely couple your dependencies, which
allows for greater flexibility. I agree with Hans, however, that
dynamics will be most beneficial with unmanaged resources, but this may
change as I play with them. The other reason for them is to reduce
complexity, as you no longer have to write tedious reflecting code.
I am sure they will end up being a new hammer, however, and wrongly
used. But then I get paid to fix that type of code, so I am not that
upset. ;-)
I see this as one more tool that expands your ability to get things done
without writing a huge amount of code. It is not a one-size fits all
improvement, however, and should be used wisely.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com
*******************************************
| Think outside the box! |
*******************************************