Friday, July 15, 2011

Framework: .NET Dynamic Versus Static Typed Languages

This MSDN article discusses the new C# 4.0 "dynamic" keyword, but also helps illustrate dynamic versus static typing in .NET.

Short notes:
  1. Dynamic languages don't perform compile-time type checks and identify the type of objects at run time only. Code is faster and easier to write, but doesn't give the benefit of compile time errors.
  2. VB.Net can be made to be more strongly typed by including the "Option Strict" setting.
  3. While the level describing how strongly typed a language is certainly relative, a good definition I found in Stack Overflow is "if I can concatenate a string and an integer without casting then it's not strongly typed."

No comments: