Managed snobbery

by Matt 13. March 2007 17:17

Scott Hanselman has been accused of being a managed snob. Surprisingly for Mr Hanselman, he seems to revel in it:

If being a Managed Code Snob is wrong, I don't wanna be right.

I say "surprisingly" because I wouldn't expect Scott to fall into the "if all you've got is a hammer, everything looks like a nail" mentality.

Now, I'm being slightly oblique here, because Scott's really responding to FUD-like comments on poor performance. But I think it's important to remember that being a managed snob when it comes to addins has consequences. By implementing an addin as managed code when it doesn't explicitly support a managed API, you're changing the shape of the application. You're forcing that application to take a dependency on .net.

And if the user has explicit knowledge of this, knows and accepts the consequences, then more power to your elbow. But that's not for the developer to decide.

Here's a great example of how a COM object was implemented in .net and used in an application that didn't natively support .net, and how it caused serious problems and several days of frustration. Yes, that's another link to Scott's blog; let's just pause to appreciate the irony. How much did the .net productivity and maintainability help here?

Not everything's a nail. Pick the right tool for the job.

And for future reference - and because anyone who knows me knows I can't leave stuff like this alone - performance of .net is very impressive, but I've not yet seen a .net desktop app that starts up as quickly or is as responsive as a native app. And maintainability alone is never a good reason to write in .net. You can write bad code in any language. Maintainability comes from well structured code and lots of tests.

Tags:

Comments (6) -

Scott Hanselman
3/15/2007 3:20:09 AM #

RE: Managed snobbery

Just a little nit here:

   "By implementing an addin as managed code when it doesn't explicitly support a managed API, you're changing the shape of the application. You're forcing that application to take a dependency on .net."

Sure, but I'm *indirectly* forcing the dependency by writing a managed plugin. The Application doesn't care or know better. The app isn't dependent on .NET...just the (very optional) plugin. If the shoe pinches, don't wear it.

Yes, that COM/.NET post from last year WAS ironic (although it wasn't several days trouble, more like several hours) but in the end, both with that app, and with my silly Optimus hacking, the end result solved the problem and continues to work just lovely. Should/could both solutions have been solved in unamanged code? Could? Totally. Should? Eh, that's a religious argument. We pick our religions and all that is asked of us is to be excited about them.

I enjoy managed code, it gets the job done - until it totally doesn't get the job done, then I switch to unmanaged code. The last line of my blog post, and the first quote in yours, as you point out, me being jocular.

I can't speak to WinForms performance, but I surely don't think that we can say that .NET isn't fast because WinForms is slow any more than we can say Java isn't fast because Java UIs are slow. These are conclusions can than certainly can be drawn, but I think that they gloss over some pretty significant implementation details.

All this long comment said, I pretty much agree with you. But, remember you're talking to a guy who's trying to get video to play on a 96x96 OLED, so take everything I say with a huge head-sized grain of salt. I'm clearly insane. ;)

Reply

Matt Ellis
3/15/2007 4:54:41 AM #

RE: Managed snobbery

Hi Scott. Thanks for the comment. I'm not bashing on .net or managed code - I'm a big fan, use it daily, and have no qualms about performance. What I really meant with the performance comment is that I tend to think of WinForms apps as the modern day equivalent of VB apps - you can just TELL that they're .net.

The fact that you're indirectly forcing the app to take a dependency on .net is exactly the point I was trying to make. Because the app wasn't designed for this, you've just introduced something that COULD have consequences. Facetiously, I pointed out your asp/COM/.net issues (apologies for over-egging the pudding on the extent of the problem). I just want people to be aware that what they are doing isn't free and COULD cause themselves or others totally unexpected issues down the line. E.g. (as I understand it) if you have a couple of .net COM objects, they won't get unloaded until all of the references to all of the objects are gone. Obviously, this COULD be something of note to a long lived app, such as explorer. Just be sure it's appropriate before reaching for .net and interop.

(And I think a plugin to a program to control video on a keyboard is totally appropriate. Barking mad maybe, but appropriate. I just wanted to tackle "managed snobbism")

Other than that, totally agree with you.

Reply

best suv 2010
best suv 2010
7/20/2011 10:36:04 PM #

I wonder if he cheated on her? I remember he cheated on his previous wife with JLO so it wouldn’t be surprising.

Reply

Georgeanna Carrigg
Georgeanna Carrigg United States
1/15/2016 8:32:32 AM #

Hey, congratulations Neil. This site really is something special and it's been a pleasure to share it with my readership too. Looking forward to future awesome things, and I'll send any suggestions that are sufficiently awesome.

Reply

Andrew Sherman
Andrew Sherman United States
7/20/2016 7:43:04 AM #

You have an accurate point of view, thanks!

Reply

Evon Csaszar
Evon Csaszar United States
12/31/2016 1:16:23 PM #

Create a professional WHITEBOARD ANIMATION VIDEO and engage your audience!! Fiverr TOP RATED SELLER with over 9000 positive reviews with 3000+ happy customers!

Reply

Add comment

biuquote
  • Comment
  • Preview
Loading

Rel=Me

Month List

RecentComments

Comment RSS