For programming junkies only: now that C# 2.0 is on the verge of becoming real (in late beta, with real release coming in a couple of months), they're starting to talk brass tacks about the 3.0 version of the language. It's fairly ambitious, although not everything I might wish. Info can be found at the C# Future Versions page.
Major things I notice in the preliminary language spec:
In sum, I'll look forward to it. (But not as much as to the generics that I'm about to get...)
Major things I notice in the preliminary language spec:
- They're starting to pick up serious elements of functional programming. (The C language family finally moves into the 1990s.) 2.0 gets anonymous methods; 3.0 gets lambda expressions. They're adding type inference, which is almost audacious for a C-family language, although this version still seems pretty simplistic compared to more serious functional languages. (Actually, I think the main point of the type inference is to simplify the syntax of the lambda expressions, and move a bit closer to higher-order functions.)
- New, intriguing concept called "extension methods", which allows class A to declare extensions to class B. Not really a true mix-in capability, but an interesting bit of syntactic sugar.
- Proper object member initializers, fixing a lack that's been conspicuous since 1.0. (They've always had initializers for attributes, but not for real objects; the discrepancy has always struck me as strange.)
- "Anonymous types", which are essentially strongly-typed property bags -- you initialize an object with a bunch of properties, and a new type is created based on those properties. Similarly, implicitly typed arrays, which infer the array type based on the initialized contents.
- A Query language, rather similar to SQL, built into the C# language. It's not specifically DB-based, although it's clearly optimized for that. The notion is basically that, if you have a collection that conforms to the queryable interface, you get a bunch of syntactic sugar for managing those queries.
In sum, I'll look forward to it. (But not as much as to the generics that I'm about to get...)
(no subject)
Date: 2005-09-15 07:30 pm (UTC)(no subject)
Date: 2005-09-16 07:21 pm (UTC)Coming from a different background, this looks to me a lot like parts of perl's AUTOLOAD system. In a number of ways this is more cleanly implemented, since it has built in both lexical scoping and multiple dispatch fall-through, which could mean a lot less fiddling. (Although, as with mix-ins this does raise some tricky cases of inheritance, particularly given precedence and multiple dispatch rules.) On the other hand, there are some design quirks I'm dubious about, e.g. importing EMs by namespace but defining them by object - if all static methods from all objects within a namespace are dumped together, it doesn't really make sense to put them in classes. They're doing a thing that works procedurally, but they're making the definition conform to OO syntax, which strikes me as a little kludgy.
Overall I'd say they seem to be moving C# closer to the neighbourhood of perl and ruby, but it remains to be seen where it will end up.
(no subject)
Date: 2005-09-16 10:23 pm (UTC)And I concur that having the EMs lumped into classes is a tad kludgy. But now that I'm understanding the basis better, I'm not wholly surprised. Like everything else in C# 3.0, they're really there to support the LINQ project, so they're tolerating a bit of kludginess in the name of getting the necessary functionality with minimal changes to the core language. This *may* come back to bite them in the ass later; we'll see...