Monday, September 24, 2007

C# Is Useful

For throwing together a GUI app, C#.NET is actually pretty handy. Here is my demo proving that C# isn't all bad - that is pretty quick and effective. Note that you don't need to use the visual designer at all, and that is what I would do for a larger scale project.
For larger scale projects, XAML is pretty interesting too. I used it at work this summer.
Why I like it:
  • Compilation step isn't a hindrance - it is fast and catches many mistakes.
  • GUI designer is helpful but it's easy to code your own layout.
  • .NET library comes with a lot.
  • Sweet language features make it feel more flexible and fun than Java.

On the other hand, here are the reasons why I still believe .NET is not the answer:
  • Not really portable to Linux. (Yes, Mono, but still).
  • Requires a huge framework. There isn't a way to "static link" your programs. This means that Joe User might have to download lots of megabytes to even run your program, which I know I would be reluctant to do. And what if he is on dial-up?
  • Memory management and performance - it's pretty good, but watch out for certain things (GC, deep inheritance, reflection, and UI drawing). It is sometimes hard for me to accept that: "My C# program looks and behaves the same as one written in C++. But it is slower and takes more memory." The only answer is developer time. Of course, I am glad that there are simpler languages like C#, and they have benefited me, but this tradeoff is probably partially responsible for today's software bloat.

No comments: