Friday, May 20, 2011

Why Leaving .NET is Hard

A while back I read a very interesting blog entry about a developer who got fed up with the .NET developer community and posted an excellent critique of the environment. He has many valid points and correctly points out its deficiencies. However, there are two sides to every coin, so as a (former) .NET developer, allow me to explain the other side.

First, a disclosure is in order: I am an Apple fanboy. There, I said it. I'm as stubborn as they come, and I refuse to consider any other hardware or consumer software. I'll try to avoid ranting, but the tl;dr of it is that Apple focuses on the user experience and they have some of the best talent on the planet working on it. No other vendor does this. Instead, other vendors focus on packing the most tech in as cheap a package as possible, often resulting in shoddy, overheating/underpowered junk that's cumbersome and frustrating to use.

Why is this disclosure necessary? Well, notice how I said hardware or consumer software. That's an important distinction. As a developer, I've gotten to use the various tools and frameworks out there and I have to say that hands down Microsoft makes them the best. So, another full disclosure: I am also a Microsoft development fanboy. Do I wish there was a more vibrant, collaborative, and open community? Of course. But I gotta say, every time I step out of the .NET "bubble", I'm disappointed. Other than Java (which I'll critique later), there are generally two scenarios I find myself in when I start looking through source code and working on a project outside of .NET, neither of which are particularly pleasant.
  1. There are all these magic strings and magic typeless variables held together by magic bash scripts and magic commands that have me delving into countless man pages just so I can familiarize myself with all the -parameters. Didn't work? Oh, yeah, that's because you didn't pass the -o -m -f -g options to the "wtf" command before running the "rebuild.all" script. And don't forget to sudo it.
  2. The environment is generally no better than in the last scenario; it's loosely held together by magic scripts and makefiles. Everything is defined twice, each in a different place (h and c(pp)), because clearly they hadn't thought of compiler inference when the language was invented. There are yucky preprocessor directives at the top which define hideous #imports and MAGIC_MACROS. The code itself is covered in sweetgum balls: prickly eye-sore asterisks which make the code hard to follow. Much of the meaning of the code is obscured by low level, arcane memory management or bit-twiddling, miserly optimizations. Half of the code deals with this crap rather than the problem at hand. Rarely is there a pressing enough need for those last few ounces of performance-gaining contortions to make the code manageability worth sacrificing. It's 2011 people, use a garbage collected language and stop being your own janitor!
Enter the .NET experience:
  1. Install the latest edition of Visual Studio (there are even free versions).
  2. Open whatever project you need to work on.
  3. Done. That's it, it's that simple. Start debugging in the excellent debugger.
Here you may be thinking that the Java experience is similar.
It's not.
Java is a hideous language and I have yet to find a truly great IDE for it.

Most Java IDEs are rather cluttered and sluggish compared to VS (maybe because they were written in Java?), but that's not the worst of it: they’ll all install just fine without an actual version of Java configured for your project. Out of the box, your code will probably not compile because you have to know to pick a version of the JDK for your project. That step is for you to figure out. Things not working out of the box is a huge detractor in terms of first impressions. I've come to learn that it means that I need to brace myself for sysadmin-style work, because now before I can code I have to learn how to deal with the inner workings of the thing I'm using to code.

And even just looking at the Java language itself, it leaves much to be desired. It’s as if the people over at Sun (or Oracle?) put a fresh coat of paint on C++ 10 years ago and let all their language developers take an indefinite leave of absence. They then realized that there were still big things missing in Java, but without the language guys around they were forced to start ad hacking things like preprocessor-style annotations instead of more elegant constructs like attributes, auto (un)boxing of primitives for generics instead of just allowing primitives, no extensions, forced exception handling, and don't even get me started on the lack of functional-style constructs like list comprehensions or lambda expressions. .NET has all of these things in your choice of Basic, C++, C#, or F#, depending on what language style you prefer, and they all come preinstalled with VS and they all work out of the box. And the debugger in VS is the best one I've ever seen. It's not any one feature of the debugger that makes it better, it's just better polished than other debuggers I've seen… Try it, you'll see what I mean.

At the end of the day, we developers are also users, users of our development tools. Like Apple, Microsoft focuses on the user experience first and the tech second. The programming languages they make (notably C# and F#) are very innovative, with features that don't exist in any other mainstream typed languages that I've seen. Being typed here is important: I understand the pains of having a strict type system and the appeal of an untyped environment like RoR or PHP. The added burden of types has never been worth it to many developers, especially on the web where structure and behavior are very dynamic. Microsoft is working on this problem at a language level in a very innovative way. And if you really want sweetgum balls or magic typeless variables, you got it. They're still there and supported. As a bit of a language geek, I'm genuinely excited for the things planned for upcoming versions of .NET and their corresponding languages, despite likely not being an active user for quite some time to come (continuations for asynchronous code ftw!). I honestly can't say the same thing about any other language.

Are you a recent .NET departee? Do you miss it, or is it the best decision you've ever made? Other thoughts? Do tell.

No comments:

Post a Comment