Sep 10, 2007

Another post in the series RTFM :)

As I've said in my last post, I'm reading C# 3.0 specification. Well, it's amazing what you can learn when you do take the time to learn more about the tools (in this case, the language) you use all day long :). This time I've find out that it's possible to use reserved words as identifiers! Amazing! (and of course, dangerous as it make it harder to read your code.) But this isn't a new feature of C# 3.0; it works with C# 2.0 (.Net Framework 2.0)! Just copy the following sample and compile it using CSharp compiler from .Net Framework 2.0!
public class @class
   private static void Main()
      int @int = 10;
      int @delegate = @int + 30;;
      System.Console.WriteLine("Values {0} {1}", @int, @delegate);
What do you think about using reserved words as identifiers? Let the world know your opinion! :) Adriano

No comments: