Tuesday, April 12, 2005

C# Course day two

Not a single Java comment today. Amazing.


  • System.Globalization for i18n (internationalization)

  • String.Format does println kind-of functionality. The patterns are a bit different however "The value is {0,-10:f2}"

  • Did my first lab with Visual Studio. Struggled a bit with the syntax differences. Things like defining Properties in an Interface, or operator overloading, overriding methods (stupid virtual/override keywords), and defining an explicit cast operator.

  • Eclipse is a way better code editor than Visual Studio. Studio may have other advantages (like visual form editing) but Eclipse owns this one.

  • Can use syntax like @"c:\folder\folder2\file.txt" so that you don't have to escape each back slash. Well maybe if MS used a forward slash in the first place this wouldn't be an issue ;-)

  • C# supports regular expressions that are designed to be compatible with Perl 5.

  • IComparable = Java's Comparable interface and IComparerer = Java's Comparator

  • There is not equivalent of Java's Set collection in .NET. Seems like an odd omission

  • Can use the indexing syntax of square brackets (e.g., collection[2] ) with both hashmaps and lists.

  • ArrayList.ReadOnly(list) is an easy way to make an immutable collection

  • System.Collections namespace contains a StringCollection that is specially tuned for dealing with strings.

  • Can call delegates asynchronously with IASyncCallback

  • Can use += and -= instead of the methods Combine() and Remove() respectively for multicast delegates.

No comments: