Learning C# – Part 2
In Part 1 I discussed my reasons for this series and also introduced the book I’m using mainly to (re-) learn C#, Essential C# 4.0.
“Introducing C#”
Not much differences yet. Instead of main you use Main (but you can leave the String[] args param out and it still works in C#) and instead of String you use string and it is System.Console.WriteLine and not System.out.println.
It is nice though that composite formatting is right there in everything. In Java you would have to use MessageFormat.format or some other middle message stuff. But in C# you can write:
System.Console.WriteLine("There are {0} words in {1} lines. Remember: {0} words!", 10, 5);
Also there’s XML comments by using /** **/ and /// respectively. Nice generalisation of Javadoc comments.
There are some explainations around the CLI and how everything works, but that’s nothing new and not a 100% related to C# itself.
