What language is the following code snippet using?
var person = new
{
Name = "Steve",
JobTitle = "National Assurance Orchestrator"
};
A) JavaScript
B) C# 3.0
C) COBOL.NET with WinFS extensions.
D) None of the above
For hints, see Steve Maine’s excellent post “On JSON” (JavaScript Object Notation), and Abhinaba’s informative rant “C# 3.0: I do not like Anonymous types”.
Comments
Seriously though it's a bad idea it makes for super hard to debug and maintain code. Ask anyone who has ever had to maintain or debug legacy Lisp code. They really need to solidify C# and stop trying to be everything to everyone before the language ends up more bloated than Java. Giving people this is very similar to giving them a Variant data type and we all know what a nightmare the VB6 morons turned that into. Just wait until those same folks get a hold of the ability to have lambda types and it will make Variant look like it was a good idea.