tags:

views:

103

answers:

2

Possible Duplicate:
Why use dynamic typing in c#?

Should the new C# type 'dynamic' be used now much in place of Type safe variables that are compile safe? Or should it only be used in to integrate with dynamic languages like JavaScript or in areas where 'magic strings' where used to access data from XML ect.. which aren't type safe to begin with?

+3  A: 

"My personal belief is that dynamic typing will be relatively rarely useful in C# 4 - basically when you're dealing with data which is already only known dynamically, e.g. reflection, or navigating XML." - Jon Skeet here
For the elaborated version: try here

Oren A
+1 for qouting Jon Skeet ;)
Janko R
+1  A: 

I would say avoid it. Let the statically typed language remain statically typed. Unfortunately, some bloke is going to use it, and you're going to have to deal with their code. C# gave you compile time checking to use. It'd be a waste to let it go.

If you feel you want to use dynamic a lot, go write Ruby or Python. It's just the way you want to attack the problem, and there's definitely a language for that type of solution.

Mike