The C# situation with dynamic is analogous. It's for people who like working in a static language, but want a particular piece of code dynamically typed because it happens to be very convenient for the task at hand. Obviously, there are a fair number of such tasks; mostly whenever you're dealing with a piece of structured but unpredictable data that lives outside your static bubble, like XML or external unmanaged libraries.
And var isn't really worth mentioning; it's just very simplistic type inference on declarations. It's just (very good) syntax sugar and doesn't have any special semantic meaning at all.
I think this also has to do with language expectations, express-tivity, and maintainability. A project already using a dynamic language will have some sort method to deal with the nature that certain calls will or will not exist. The addition annotations/conditions seem like optimizations, but doesn't fundamentally change how a programmer would go about using that dynamic language. C#, on the other hand, the language is more constrained to begin with. A (C#) programmer would normally expect certain things such as an interface having a certain number of methods with certain types. Just imagine a library exposing an api with expandos... =p
His answer was basically your concern, that they didn't want to get in the habit of exposing dynamic things all over the place, since they felt it was sort of an unexpected thing to be doing in a language like C#. Hopefully third-party library programmers will be equally judicious.
Just so as not to scare people off.
The use of .NET and C# (and Java) is often mandated by management levels, specially in large companies. For those unlucky folks, even a tiny little progress is a move in the right direction.
Even if you want a .NET-like environment, you could use JRuby, Jython or Clojure and have a far better programming experience on top of the JVM.
I really see no reason to even consider C# or .NET.
Would whoever modded this down please explain how this is worth modding down instead of writing why you disagree with it?
Saying those things are "far better" is just flamebait. If you're going to write such criticism, it's up to you to justify your statements, not up to other people to defend against a non-existent argument.
EDIT: Stop modding me up, holy shit. This is off-topic and it's not important. Why do you want to highlight this self-evident comment so much that you're giving it a bunch of points? If I could have just messaged jacques instead of posting, I would have done that.
That does make sense. When it comes to things like, say, desktop application development, Clojure probably isn't there yet, even though it's backed by all the Java libraries. C# and .NET, on the other hand, were designed with this purpose in mind (among other things). If I had to write a Windows desktop app, I probably would choose C# over Clojure any day, even though I like Clojure better as a language. But, as they say, programming languages don't operate in a vacuum...
None of this based on objective facts or stuff that you could measure. His truth to me is as good as your truth.
But he got modded in to the ground and you got modded up.
I wouldn't have modded me up, either; in fact, I would have modded me down, because this whole discussion is off-topic and doesn't deserve attention. I think the majority of moderation on here seems awful and is rarely even vaguely proportional to the quality of the comments, and I agree that this is an example of awful moderation. So you're arguing with the wrong fellow.
EDIT: I amended my comment above to be irritating and sarcastic toward people who modded me up.
Classy! My email is in my profile by the way, in case you ever want to take something 'offline'.
The image that got conjured in my mind when reading that post was one of a teenage girl on the phone going, "C#? What. everrrr."
"I really see no reason to even consider C# or .NET."
This looks like an exhibition of the classic blub fallacy.
> he's sounding like a smug dynamic language weenie
I'll give you that. I have a strong opinion on the overall usability of statically-typed languages. I have been writing Java code for the past month and I really feel less productive than the month before, despite the very smart tools that take away most of the drudgery. I am also not anti-static-typing: I like C a lot. I don't like C++ that much because of Smalltalk-induced bias.
> It pulls the "mandated by management" straw man
I am yet to witness a C# project that's not born out of a corporate IT department. I have never seen someone move from dynamic languages to static ones for other reason than execution speed, and, even then, only after careful profiling.
> This looks like an exhibition of the classic blub fallacy.
Name 5 reasons to consider C# as your development language and I'll concede you another point. While you are at it, name 1 area where C# is considered the best language.
No, let's not. How about you keep your condescending attitude offline.
What? My comment makes sense, even if C# is worse than Python, etc.
"As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down. Languages less powerful than Blub are obviously less powerful, because they're missing some feature he's used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub."
The "paradox" (or "fallacy", as you called it) here refers to looking at a language that is more powerful, but not realizing that it is. By contrast, when looking at a language that is less powerful, this is usually obvious.
> By contrast, when looking at a language that is less powerful, this is usually obvious.
You mean like how when I look at Python, its deficiencies relative to C# are obvious? Or are you talking about how when you look at C#, its deficiencies relative to Python are obvious? The blub paradox goes both ways.
To illustrate the value of such a thing, I invite you to look at the ADO.NET libraries for data access, which provided a verbose, painful "dynamic property bag" experience as far back as .NET 1.0; you had DataTables with columns that you would pass a type to, and then you had DataRows that you indexed into with strings to put objects in and get them out, and you had to cast them back and forth as you did it -- all of it ugly, none of it checked at compile-time. The value of C# dynamic (besides interop) is that now you can have such a thing in a fairly concise form with syntax that doesn't make you sob uncontrollably when you use it.
It's down to the old "with great power comes great responsibility" idea.