C# - Initial impressions

djberg96 on 2002-05-09T12:52:56

For better or for worse I've decided to join the revenue assurance project and dig into C#. I'm at the tail end of online lesson 2 (of 5). The online lessons aren't bad, actually.

Well, anyway, here are my initial impressions:

  • It feels like a cross between C and Java, but closer to C.
  • The syntax is fairly easy, being very C-like, with the addition of a few new types (string).
  • Absolutely everything is a class and all methods are attached to a class. No global methods. Ok, I can live with that.
  • Some quirky semantic choices have been made. Your "two-dimensional array" is now a "rank two array". Uh, ok - whatever.
  • It still has that redundant feel that static languages give you. e.g. "ArrayList array = new ArrayList;". I feel like I'm declaring the type twice here, but that's a statically typed language for you.
  • The ability to use /// for inline XML documentation is nifty. Of course, if/when XML becomes a thing of the past, this feature will probably be mocked for some time.
  • They've added onto some traditional constructs. In addition to 'try/catch/throw', they've added 'finally'. This may be useful. Then again, it may be kruft.


      XML Comments

      ziggy on 2002-05-09T15:58:56

      The ability to use /// for inline XML documentation is nifty.
      I'm about as skeptical about this one as I was two years ago when it was first announced.

      Consider XML as a reasonable default syntax, much like the GPL is a reasonable default license (if you intend all users of your software to be on an even playing field). That's default, not universal. Over the years, I've found that the mindset when I'm writing a document (in XML, LaTeX, Pod, HTML, whatever), is different than the mindset when I'm programming.

      There's a benefit to using structured documentation conventions within code. But most comments aren't structured (and shouldn't be, or else they'd be documentation, not comments). The best solution I've seen is something like Pod, where the structure is expressly intuited (there are always some improvements that could be made, of course). Also, Pod works quite well as a documentation format that works when intermingled with the code, preceding or following the code (especially after __END__).

      Re:XML Comments

      koschei on 2002-05-09T17:54:24

      I think a more universal literate programming system is needed.

      All the existing ones tend to have some problem with some aspect (typically they're too tied to a particular language for either the doco part of the code part).