A data type named dynamic

I was reading about theĀ  new features in C# 4.0, and what strikes me most are the effors to support dynamic typing.

There will even be a new type called dynamic. Variables of this type – and here it gets linguistically confusing – have no explicit type. In other words, the compiler can’t determine their type and check their use accordingly. It’s up to the runtime to find out what kind of beast the dynamic variable is really pointing to.

With this move, I guess that C# definitively gives up all hopes of ever winning an award for sparsity or elegance. The distinction between dynamically typed and statically typed languages has always been a rather radical one and a language not choosing one or the other feels like having two roofs on your house because the architect couldn’t make up his mind.

But well, C# has never pretended to be the most elegant or consistent language. Rather, it wants to be a multi-functional tool that supports different styles and lets you build a wide range of applications efficiently.

Still, I have my reservations about this novelty, mainly because C# is also a language that is used by programmers with very different degrees of knowledge/experience. I fully expect, at some point in the future, to be debugging codes where all variables are dynamic because that was the easiest way to get it all up and running. After all, that’s how GoTo got a bad rep.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.