Beginners' languages can have advanced features too
Posted at 20:39 on 13 September 2007
C# introduced some very useful concepts in version 2: generics, the yield
statement, and anonymous methods (which are similar to closures). However, VB.NET was largely left behind: it has generics, but it still misses out on both the yield
statement and anonymous methods, and it had to wait until version 2 to get the simple but convenient and frequently used syntactic sugar of C#'s using
statement.
C'mon, Microsoft, these are pretty useful language constructs. Sure, a lot of developers don't know what they are or how to use them, but once you've seen how powerful they can be, you wonder how you managed to get by without them. It seems that in .NET land, VB is definitely a second class citizen, perhaps more comfortable for novices to use, but with some gaps in the feature set that will irritate more advanced developers.
PHP suffers the same dumbing-down problem. It has seen massive improvements in version 5 since version 4, but there are still some fairly major gaps that are not likely to be filled in the foreseeable future. For example, apparently Rasmus Lerdorf is of the opinion that PHP is not likely ever to get closures because most PHP developers would not have a clue what to do with them.
This kind of thinking seems flawed to me. There are some language features such as these, which more advanced developers can use to write code that is much more concise, clearer and easier to understand, while the less experienced can use the language without being aware of them, albeit perhaps not as idiomatically and concisely. JavaScript is a good example of this: despite the insanities of cross-browser quirks, it is easy enough for most novice developers to achieve some results, yet it has some powerful functional features that make it potentially very expressive and idiomatic -- just look at what you can achieve with jQuery for instance.
Just because a language's core constituency is dominated by beginners doesn't mean you should leave out useful features that advanced developers can use. Don't forget that experienced coders often have to use VB and PHP too.