blogs.conchango.com

welcome to the conchango blogging site
Welcome to blogs.conchango.com Sign in | Join | Help
in Search

andyBlog [andy britcliffe]

My working life in an internet nutshell

Orcas C# Language Features. ScottGu introduces the first 2 and they're lost on me!!!

Ok. It feels like I'm heading on something of anti .Net direction recently, but I'd like to assure you I'm not....but I can't resist commenting on this latest blog post by ScottGu, who I may add have a lot of time for (anyone who invented asp.net is good with me).

So as you may well be aware, Orcas is due out this year (Q3/Q4) and Scott has now started a series on new language features. Now this is always interesting, so I read the post with great anticipation, and finished with great disappointment.

Ok so in summarisation the 2 new features are:

  • Automatic Properties - Syntactic sugar that saves you writing private members
  • Object Initializ(s)ers - A strangely similar looking syntax to Javascript to initalise Objects with properties

Ok so with automatic properties, I can see the  slight benefits of this if you're developing in notepad or Emacs. But with the emergence of tools like ReSharper and CodeRush this feature is just pointless as these tools do the work for you.

The same goes for Object Initaliz(s)ers where again they've invented a javascript esq syntax to instantiate your object with properties an example being:

Person person = new Person { FirstName="Andy", LastName="Britcliffe", Age=27 };

Or you could use a overloaded constructor which does the same thing!!

Person person = new Person ("Andy", "Britcliffe", 27 );

Again it just gives another way to do something that can already be achieved, and for me this breeds confusion.

Fine, if they want to keep up with the likes of Ruby to give C# an air of cool then sure, but I can't believe they would waste super clever highly paid Microsoft engineers time on features like this.

Lets hope Scott's further posts offer much more valuable features to the languages.
 

Published 09 March 2007 21:38 by Andrew.Britcliffe
Filed under: , , , ,

Comments

No Comments
Anonymous comments are disabled

About Andrew.Britcliffe

Senior Technical Consultant.
Powered by Community Server (Personal Edition), by Telligent Systems