Archive for January, 2008

Resharper

Ok, so I know the blog-o-sphere is covered with these kinds of posts, but I just had to say how amazed I am with ReSharper. It’s amazing! In a way it’s not really amazing at how much ReSharper does, it’s more amazing how much Visual Studio doesn’t do. It’s ridiculous.

Maybe it’s because I was born and raised on Eclipse, but I expect my IDE to do a lot for me. Code generation, refactoring, file renaming, unit tests: i want it all. Visual Studio does… not much. I finally got it running on my Vista box this morning (a pain), and I was shocked at how little Visual Studio let me do. I was talking to Tom and Shey while was getting my development environment setup, and the conversation pretty much went like this?

James: Can I do this?
Shey: No.
Tom: Get ReSharper.
James: What about this?
Shey: No.
Tom: Get ReSharper.

I’m sure you can see where this is going. I’ve been kind of paying attention to dialogs as I coded through the day (I started an open source project I hope to release soon so I could get back in the C# groove), and almost all the ones that are actually useful have the ReSharper icon in the upper left (good marketing btw).

In short, as far as I am concerned, Visual Studio without ReSharper is pretty much worthless.

PS- In my sickest most depraved daydreams I envision coding C# inside Eclipse with all it’s goodness. Actually, that desire reduced significantly as the day progressed (post-ReSharper installation), but I still think it’d be neat.

BTW- ReSharper won’t find your unit tests if your class isn’t explicitly marked public. It doesn’t give very helpful warnings to that effect either. Just so you know. It just says, “No unit tests found in file”. It makes sense, but neither Tom nor I caught it at first.

BTW2- No static members in interface declarations in C#? Seriously? I must be trying to do things the Java Way. I have ILoggerFactory, which SimpleLoggerFactory implements. Currently I have to instantiate SimpleLoggerFactory then call simpleLoggerFactory.GetLogger(this.GetType()). Any suggestions?

Comments off

On Democracy

So Visual Studio 2008 is out, and by all accounts it is pretty bling-tastic. LINQ is getting a lot of press since it’s release late last year. I just finished reading this article over at SD Times, and I wanted to comment.

Democracy is slow. Technology moves fast. I’m not sure they’re a good mating. I’ve heard it claimed that a negative part of Microsoft’s development platform is that it is constantly changing. Java hasn’t changed very much. They added some stuff in 5 and 6, but nothing like what MS is doing in every incremental revision of .NET. .NET is really impressive these days. It’s not one language that’s impressive, or one technology, or one tool, but the entire platform. There’s a lot of new technology that is put together really well.

I think this is due to the fact that there is someone, somewhere in Microsoft with “vision”. Maybe not just one person, but at least some smallish team leading development efforts. Java has implemented this sort of open democracy JSR proposal process, but I’m not convinced democracy belongs in software development. I feel that someone or a small group with a passionate vision can create new innovative things, while a large democracy oriented team just sort of takes so long that it’s always playing catch up. It’s probably “safer” to have a democracy, but taking risks is an important part of progress.

Maybe I’m wrong. What are your thoughts? Are there software projects where democracy created very innovative things that I’m not considering?

Comments off

On Exceptions

Since I just upgraded WordPress (It’s like it dreams of being as secure as bind or sendmail), I could write another article on why wordpress sucks, but that is boring and everyone has so instead I’ll write something about exception handling.

Code based on examples from sun javadocs on exceptions

try {
  doStuff();
} catch (ArrayIndexOutOfBoundsException e) {
  // Die Violently
} catch (IOException e) {
  // Die Violently
} catch (PuppyOnFireException e) {
  // Gasp in horror
} catch (MilkLeftOutOvernightException e) {
  // Become Annoyed
} catch (SuperNovaException e) {
  // Die Violently
} catch (BirdFluException e) {
  // Die Violently
} finally {
  // Oh make it stop make it stop!
}

Eww… I’m not impressed. There are some ideas floating around, and I’m sure I’m not the only one who has come up with this, but it seems like we already have a compressed syntax for these things. I present Case’d Exceptions:

try {
  doStuff();
} catch (e) {
  switch ArrayIndexOutOfBoundsException:
  switch IOException:
  switch SuperNovaException:
    // Die Violently
    break;
  switch PuppyOnFireException:
    // Gasp in horror
    break;
  switch MilkLeftOutOvernightException:
    // Become Annoyed
    break;
} finally {
    // Oh make it stop make it stop!
}

Ok now everyone argue about Fall Through and how horrible it is. And the syntax could probably be cleaned up.

It’s interesting, Python kind of irritates me with it’s “whitespace as syntax” (I was tempted to write “nonsense”), but I think it’s just because I’m getting old and grumpy. I actually tend to favor syntax with fewer {}’s all over the place. They’re not magical. In fact they’re kind of ugly and noisy and gross. There’s not a significant line savings with Case’d Exceptions, but to me it does look marginally cleaner.

And after all, cleanliness is next to godliness… and kittens… or something.

Coming soon: a blog entry on how the JVM handles polymorphism. Why? Because I got my ass thoroughly handed to me on an interview question on exactly that topic. Ow.

PS: I still frown on the following, I’m just lazy, and in this case it does make things a little less ridiculous:

try {
  // I hate when brackets are on the same line as syntax/code
}

Comments (2)