(picture)

March 22, 2004

.NET rocks (at last)

Finally, I wrote some proper C# code. Some random observations.

Let's get JScript.NET out of the way first. As I may have mentioned before, I think JavaScript is a great language: it's maybe not quite bendy enough (lacking lisp- or CodeDOM-style macros and the ability to define real first-class syntax elements), but incredibly flexible, elegant, concise. Objects are hashtables, functions are closures, classes are instances, datatypes aren't strict. With lint, who needs a compiler?
JScript.NET is JavaScript minus the good bits. I can think of no reason to use it. If you want a .NET language, use C# or managed C++ instead.

C#, now, is a nice enough language. But more importantly, the framework is great.

  • The framework includes the compilers. ("csc.exe", the command-line C# compiler; and the others).
  • ASP.NET compiles and installs code on the fly. You can write an ASP.NET page in NotePad, with server-side C# code, and the just-in-time compilation will build and deploy the appropriate DLLs whenever it needs to.
  • Writing a web service (.asmx) is even easier than writing a Web page. Again, you can just write your class as half-dozen lines of code in NotePad and put it onto your web server; the framework will automatically compile the code, deploy it to the GAC, build WSDL on the fly, and implement HTTP GET/POST and SOAP interfaces.
  • Reflection is quite nice. Custom attributes are really really awesome. It's cool that typeof returns a Type, too.
Anyhow: I'm hooked.