VS: simply things which are incredibly hard

There are some very clear examples out there about what I mean when I talk about VS obscurity being a major pain for getting people extending the platform and trying to make my dream come true.

As a rule of thumb people should know that if demostrating incredibly basics things takes you more than a few words and a trivial code snippet then most probably something is wrong.

There is a post by Dr. Ex on how to detect when a toolwindow is closing, it's 52 paragraph and 509 words in length, pretty lengthly, ugh?

What this should have been instead?

mytoolwindow.Hide +=  new EventHander(hide_handler);

There is another post from Sara Ford that touches how to insert some text in the editor, it's 20 paragraphs and 300 words in length. If you have the estomatch to go throught it you will notice all sort of crazy stuff like you having to do your own memory managament (flashback to 1978!):

IntPtr pText = Marshal.StringToCoTaskMemAuto(text);

try

{

      textLines.ReplaceLines(0, 0, endLine, endCol, pText, len, null);

}

finally

{

      Marshal.FreeCoTaskMem(pText);

}

What this should have been instead?

myeditor.Text = "foo";

Luckily enough both, Dr. Ex and Sara, write their posts with a salt of humor which I don't think it's a coincidence but a technique for trying to eliminate the idea of suicide from their weblog readers while they're reading.

I'm fine with their approach as long as they understand that there isn't really anything funny about it and that this really, really, really begs for a change sooner than later.

Published Thursday, July 12, 2007 8:25 PM by vga
Filed under: , ,

Comments

# re: VS: simply things which are incredibly hard

Friday, July 13, 2007 12:19 AM by Vikram

hmmmm, Cant Imagine 300 words for providing a text property :)

# re: VS: simply things which are incredibly hard

Tuesday, July 17, 2007 9:38 AM by Matthew Manela

You are completely correct.  I wrote the post on Sara Ford's blog.  Figuring out the content of that post took me several weeks of my internship last summer.  I eventually had to talk with one of the architects behind Visual Studio IDE to figure some of it out.  I said that was ridiculous, but the problem is the VS is too far gone.  Ideally there would be a simple interface called ITextContainer which has all the properties of any object which contains text but the problem is its not done that way.  VS is a long and old code base and while it is still incredibly powerful and useful it is beginning to succumb to its own obscurity, as you pointed out.

# re: VS: simply things which are incredibly hard

Wednesday, July 18, 2007 10:56 PM by vga

Hi Matthew,

Thanks for sharing that!

-Victor.

Leave a Comment

(required) 
(required) 
(optional)
(required)