Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamics in .NET 4.0

0 views
Skip to first unread message

Nully Girl

unread,
Jun 24, 2009, 10:00:01 AM6/24/09
to
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?

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.

Hans Kesting

unread,
Jun 24, 2009, 10:47:54 AM6/24/09
to
Nully Girl used his keyboard to write :

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


Peter Duniho

unread,
Jun 24, 2009, 12:59:21 PM6/24/09
to
On Wed, 24 Jun 2009 07:00:01 -0700, Nully Girl <null...@hotmail.com>
wrote:

> 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

Gregory A. Beamer

unread,
Jun 29, 2009, 11:41:21 AM6/29/09
to
Nully Girl <null...@hotmail.com> wrote in
news:#ooFURN9...@TK2MSFTNGP04.phx.gbl:

> 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! |
*******************************************

0 new messages