views:

312

answers:

4

With new features in .NET 3.5 (such as var, Lambda, linq, etc), and more on its way, we can conclude that C# not only statically typed language, but also Dynamically typed ?

Why or Why not?

Edit#1

As many posters below claim, .net 4.0 will add the dynamical type-ness to the language. Will this slow down the language?

With every release csharp takes something from different languages. In so far as .Net1.1, our forefathers didn't intend to even make it functional language....

Edit#2

I think many of you misunderstood the question; as I am referring to C# language overall, including the upcoming release 4.0. Thus, it is fair to say that the language is dynamically typed...

+8  A: 

C# is not dynamically typed - all types are statically inferred in the examples you mentioned. The next version of C# will include some dynamic features though for working with COM and truly dynamic languages.

[Edit #1] Yes C#'s new dynamic feature will be slower as everything using it will require late-binding. However it will only slow down your application if you use it - it is not a change to the core language itself. C# 4 will be a statically typed language with the capability of working with late-bound types.

[Edit #2] No C# 4 will not be a dynamically typed language. C# 4 introduces a new dynamic type which will substitute late-binding on type members in lieu of static type checking. Dynamic capabilities will only be available on these dynamic types. C#'s underlying type system has not changed.

Andrew Hare
+2  A: 

No, it is still statically typed, var/lambda/linq all use inferance by the compiler so the type is known at compile time, dynamic/duck typing will come with c# 4.0

Quintin Robinson
it should read: "No, it is still statically typed, var/lambda/linq all use inferance by the compiler so the type is known at **compile time**, dynamic/duck typing will come with c# 4.0"
Mehrdad Afshari
+1  A: 

Dynamically typed?! Nope. Technically, C# is a statically typed language. It has dynamic method dispatching capabilities through CLR reflection services provided by .NET runtime (which has been available since v1.0 and has nothing to do with .NET 3.5 features, C# 3.0 features are still statically typed). C# 4.0 will have true dynamic typing.

Mehrdad Afshari
A: 

Commenters: Are you that sure that dynamic types can be so easily contained? I've got a feeling that their effects will spread.

brianary
Interesting, in what ways do you think the effects will spread?
Andrew Hare
At a glance, I think it may affect method signatures or overload choices. It will be interesting to look back at this question in a couple of years, though.
brianary