The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Hanselminutes is a weekly audio talk show with noted web developer and technologist Scott Hanselman and hosted by Carl Franklin. Scott discusses utilities and tools, gives practical how-to advice, and discusses ASP.NET or Windows issues and workarounds.

Text transcript of show #147 January 23, 2009

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
Scott is on campus this week and bumps into Noah Richards, a "lowly" (his word) dev on the new editor in Visual Studio 2010. They sit down and Scott gets an education on how it's put together, built, componentized and shared.

(Transcription services provided by PWOP Productions)

Our Sponsors

http://www.telerik.com

http://www.nsoftware.com

http://dotnet.sys-con.com

Copyright © PWOP Productions Inc.

Transcription by PWOP Productions, http://www.pwop.com

Page 1 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Lawrence Ryan: From hanselminutes.com, i t 's Hanselminutes, a weekly discussion with web developer and technologist, Scott Hanselman, hosted by Carl Franklin. This is Lawrence Ryan, announcing show #147, recorded live Wednesday, January 21, 2009. Support for Hanselminutes is provided by Telerik RadControls, the most comprehensive suite of components for Windows Forms and ASP.NET web applications, online at www.telerik.com, and by .NET Developers Journal, the world's leading .NET developer magazine, online at www.sys-con.com. In t h i s e p i s o d e , Scott talks with developer Noah Richards about the new WPF-based text editor in Visual Studio 2010. Scott Hanselman: Hi, this is Scott Hanselman and this is another episode of Hanselminutes. I'm up here hanging out for a couple of days on the Redmond campus of Microsoft. I come up here every month or so and wander down the hallways and every once in a while I just pop into an office and find out what someone is working on and I fit them on a load today because I'm talking with software developer engineer Noah Richards who is one of the, how many developers? Noah Richards: About eight developers.

Noah Richards: So for Visual Studio 2010, we started over and we wrote the Editor from the ground up with extensibility in mind. So like you said the Editor, it uses WPF now which is, of course, different and we are on managed code, we write almost entirely in C# and we used something called the Managed Extensibility Framework, MEF... Scott Hanselman: Noah Richards: Scott Hanselman: Yeah, Glenn Block's MEF. Yeah, Glenn Block's MEF. I love that guy.

Noah Richards: For our extensibility story. So do you just want me to sort of hop into this, maybe talk about... Scott Hanselman: I want to understand like a couple of things about this Editor. So we say the Editor, we're talking about all of the typing of text, the rendering of text, the scroll bar, that whole kind of area that lives inside of Visual Studio. Noah Richards: about. Yes, that's what we're talking

Scott Hanselman: Eight developers working on the new Editor for Dev Visual Studio 2010. Noah Richards: Scott Hanselman: Visual Studio 2010. Noah Richards: Yes. You call it Dev 10, we call it

Scott Hanselman: So somebody used to looking at a Solution Explorer and they double click on a file and somehow Visual Studio decides that this is a file that you're going to be handling, and then what happens? Is it Text Editor, is it a DLL, I mean I imagine it from the point of I've got the Visual Studio IDE open, I double click on it on a CS file... Noah Richards: Scott Hanselman: Sure. What happens?

We call it Dev 10.

Scott Hanselman: You call it Dev 10, but you the listener, you don't get to call it that. Noah Richards: No.

Scott Hanselman: So why would I want to talk about a Text Editor? I think this is pretty interesting and I wanted to talk to the actual -- you called yourself earlier a lowly... Noah Richards: coders as they say. Yeah, I'm just one of the lowly

Noah Richards: So there are two pieces to the Editor. There's what we call the platform piece or the rehostable piece and you might have noticed if you use Expression Blend or if you downloaded the new Win 7.0 beta and you open up the PowerShell ISE, the Integrated Scripting Environment, you'll see that's our Editor, in both applications that's our Editor and we're kind of being hosted, and more than that, those are just the ones on the top of my head but... Scott Hanselman: And that's just like a DLL that they've kind of like copied local... Noah Richards: It's a set of DLLs. They're a couple separated for various reasons, but they are a couple of DLLs and then inside the Visual Studio we have a package that takes care of loading us up and then provides what we call a SHIM layer on top of the hostable part that allows old native clients to continue calling the Editor as if it was still the old Editor.

Scott Hanselman: The lowly coders. So you work on the WPF Editors. This means that the Editor in the Visual Studio 2010 is different, and we've seen things about this. If people are enthusiastic they can search around, they can find Channel 9 videos, they can piece together what's going on here. Noah Richards: Yeah.

Scott Hanselman: What's happening with the Editor, the Text Editor in Visual Studio 2010? Transcription by PWOP Productions, http://www.pwop.com

Page 2 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Scott Hanselman: So the SHIM, it's just that, it's a lie, it's IExtensibility too which says I'm still here, nothing has changed. Noah Richards: Scott Hanselman: It's IVS Text whatever IVS. Yes, some COM thing.

Noah Richards: Sure and then there's really two parts of that. There's the integration piece which talks to VS and then there's the SHIM piece which, like you said, is the lie that we tell to all the native clients but it’s there so that you'll have a more gradual path to move forward. Scott Hanselman: Right. So rewriting an entire Editor doesn't necessarily break some add-in that I wrote. Noah Richards: Right, absolutely.

Noah Richards: Yes, yes, it's all in proc. So yeah, so at the level of MEF, of this extensibility framework, we have all these different subsystems and so Classification is one of them. Things like this little squiggly you get in the Editor, that uses another subsystem to do that, and basically we have these services that we provide and we use them internally to build the application but they're all public, they're all services that you, as an extender, can come in and say well, I want to provide my own squiggles so you can implement this interface. Scott Hanselman: Okay.

Scott Hanselman: Okay, that's cool. So I double click on the CS file, Visual Studio says hey, it’s Text Editor time, your package shows up and then there's a lot involved here, there's the deciding of the view port, you know, whether this is really long file or not, maybe this is a megabyte of texts so there's memory management in text, and in Text Editor there's all the syntax highlighting. Is that your responsibility too? Noah Richards: Part of it. So we still use the language services that are provided, like the C# team as a language service and the VB team. We have subsystem that they talk to and that's how they provide coloring and that's also new in VS 10. We use something called Classification where people get to provide things and they say this span of text is a keyword, this span of text is a number. Scott Hanselman: saying? Noah Richards: Scott Hanselman: text? Noah Richards: Scott Hanselman: What's that word you're

Noah Richards: So one of the things about the new Editor, I'd like to think of this as kind of democratizing it, that you can write an extension that adds new colors to C# and plays along with the C# language service. You could add an extension that say you want to add spell checking to comments. You can do that. You can write an extension that's spell checking and then put the squiggle under the misspelled words, and that would all just work. Scott Hanselman: Okay, so then maybe I wasn't thinking about this right. Let's think about it in terms of a line of text. Noah Richards: Sure.

Scott Hanselman: So I've got a line of text. I've got a four loop or something like that. How many different things are involved in the ultimate rendering of the correct colors, a couple of squiggles on a single what you call a span of text. What's the lifecycle of that span? Noah Richards: There are three primary layers to the Editor. There's the data layer which is text buffers, and then when I say with things like span there are things called Span and so on and so forth and this refers to text in the text buffer. I'll pause for a second because I do want to say one of the cool things about the new Editor is that all the data structures in the buffer level are functional or immutable. So when text changes, the text that at any point in time is what's called a Text Snapshot, and you can grab this text snapshot, you can do stuff with it like if you're a language you can build an AST, you can see what's there without worrying about anybody coming in and changing it. So one other thing is there's not a lot of locking anymore. You don't have to lock, relock, read the thing make sure nobody edits. You just grab the snapshot. When somebody makes a change to the buffer, we generate a new snapshot and then move forward to that, and if you ask for the current snapshot, at that point you'll get a new one. Almost all the world of the Editor talks in terms of these snapshots.

Classification. No, no, no. Is it the span of

Span, span of text. Span. Okay, message.

Noah Richards: This span of text is such and such a thing and then we have another service sitting there which says oh well, keyword is equivalent to this WPF solid colored brush, and then that comes in on top of the UI layer and says oh, keywords are blue. Scott Hanselman: These services, you call them services so you have kind of service oriented architecture, but these are all in proc though.

Transcription by PWOP Productions, http://www.pwop.com

Page 3 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Scott Hanselman: Yes, that's as you're getting around the issues of concurrency with just the issue of you're getting a moment in time. Noah Richards: Right and this was a huge problem, or rather not a huge problem, there was a problem in Visual Studio in the past where language services and consumer, like third party extenders that do this too, if you wanted to get a copy of the text, you will take the entire text buffer and copy it into a string and look at it yourself just so you won't block it. Scott Hanselman: And that's where you'd see things like a 5-megabyte file, that might be fine, but then as soon as you put on Fred’s third party extension, things are just slowed down, turns out he is not dealing with that size of file. Noah Richards: And it was hard to do it. It's a little bit easier to do now. That's the data level and above that we have the logical level or things like classification mode. So i t ’ s something that Classification isn't really a UI concept. It's something that you add on top of the data. So just the fact that the text is a keyword has nothing to do with the fact that it's blue, that comes... Scott Hanselman: All right, this is metadata.

Noah Richards: Right. We try to keep that separate as much as possible just because it makes things cleaner and easier to work with, and yes that's the logic layer as we call it. Scott Hanselman: Okay. So when I heard that we were writing the whole thing over again, like you said in the beginning this has been done from scratch, it looks the same though. You know, it’s like, oh yeah, I saw the CTP... Noah Richards: Yeah.

Scott Hanselman: It's like oh we're writing, we doing all these work, it's totally written in from scratch and looks exactly the same. There's always that joke about rewriting stuff and you get exactly where you were a couple of years ago. So here we are and looks exactly the same. Noah Richards: Scott Hanselman: extensibility. Yup. And we did this so it was

Noah Richards: This is metadata that you add and we have basically two subsystems that kind of talk in terms of this, Classification and another one called Tagging which is similar. It's a way of saying like this piece of text is a squiggle. It's a type of tag that you get to put as an error, an error tag. On top of that is the UI layer and that's the layer that we have an implementation of this layer, it's kind of agnostic so you can UI without knowing that it's WPF. But then there's UI, the specific one, and so when you have a line of text, the text view what it does is it gets the current snapshot, when the snapshot is changed it goes through and it goes into WPF and renders some of these texts and then it asks for all the classifications over it, it asks for all the different tags over it. There is like squiggles, there is a thing called a Squiggle Visual Manager that... Scott Hanselman: Okay, so at the second layer, what I'm calling is this metadata layer you call it the data layer, that's where things like background compilation of errors that have showed up, spell check, that's where I hook in where I'm saying that this is wrong, I want to squiggle there to indicate something about this, but not necessarily saying I want a Visual Squiggle or I want to tag this with the information... Noah Richards: To say this is an error.

Noah Richards: Yes, so the way we look at it is that we wanted to be extensible. It's very extensible and it's built so that you can do wherever your mind takes you. You know, you can build a visualization in WPF that does whatever you want it to do, but in terms of when you talk about Dev 10 and delivering and shipping in Visual Studio, we had a priority that we certainly didn't want to degrade the experience. Scott Hanselman: Sure.

Noah Richards: So we tried very hard as best we could without sacrificing anything to maintain the same type of functionality that you're used to so that a guy sits down and just got VS 2010, or no, his company just switch to VS2010, he go type in the Editor and doesn't need to know that it's a different... Scott Hanselman: So he's not going to notice the difference if he doesn't actually go looking for anything. Noah Richards: Yeah, if he doesn't h a v e anything else, he might notice the one thing that everybody noti c e s , i t 's the selection box has a gradient in it. That's one of the only visible things, like the outlining might look a bit different, some of the glyphs... Scott Hanselman: The graphics.

Noah Richards: The graphics might look a little bit different, but the functionality we're trying to maintain. Scott Hanselman: So you're not trying to freak people out with some dramatic changes.

Scott Hanselman: This is an error, and visualization of that error is a totally separate thing.

Transcription by PWOP Productions, http://www.pwop.com

Page 4 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Noah Richards:

Right.

Scott Hanselman: But you said that earlier, speaking of frequent people out, you said you could do whatever you want as far as your imagination. What are some of the other wacky stuff that people have been writing to see how far they can push this? Noah Richards: There was a guy in one of our partner teams, he built Visualization, he used some of the existing Visual Studio stuff to figure out where methods were and then he made it so that when you click on the method it would highlight the method and then pop out this rich edit control that says like who last edited the method and code coverage numbers and... Scott Hanselman: Wow.

to being a port from Java and it's derived from platform innovations since .NET 1.0. Genome has LINQ since its CTP release in May of 2006. It offers several unique features such as encapsulation and reuse of LINQ Query and Expressions. You can really and fully harness the power of LINQ while benefiting from your database platform's unique features, compose complex LINQ Query, decompose the Query logic in your domain model. LINQ supports all the major database platforms you find in enterprise environments like SQL Server and also Oracle and IBM DB2. You can find out more about how Genome integrates tightly with Visual Studio and what tools Genome offers to reduce irrelevant time at tinyurl.com/tryGenome, G-E-N-O-M-E, where you can also download a free and fully functional trial version. I hope you enjoy it. So how do I get the notification? It's one thing to describe different layers that you discern. Noah Richards: Sure.

Noah Richards: I mean, the data for his presentation was all made up but the idea is that at the end of the day, the view is just a WPF element, it's just a UI element and you can hook into the Editor at various levels and like you said one thing you can do is you can provide these error tags but then on the top you can provide any type of visualization you want. We have ideas for things like let's pretend every time we say new solid colored brush, we replace whatever is in that constructor, a solid colored brush with a color picker, like we can do that, we can stick it right in the Editor, you can write that, you can write things that say... Scott Hanselman: Oh, okay, so hang on a second. Because we said you saw a colored brush before, but you're saying that you're writing some code, you're sitting down and you're going var a = new solid colored brush, open paren and at that moment you show a color. Noah Richards: You could write an extension that does any of the stuff, you can write an extension that says you create a UI element, why don't we just show it in the Editor. You can write an extension... Scott Hanselman: swash... Like it actually show like

Scott Hanselman: B u t i t 's another thing to be notified that it’s really my opportunity to jump in. Noah Richards: So this is why we have -- so we kind of separate these MEF components into two things. There are services that we kind of provide so there's a find service and a search service and there are extensions that will go and like grab over these people who provide these extensions at various points in time. So Classification is one of those. Every time a view comes up, we'll go in and say okay, this is a C# file, let me find all the people who say, well, I provide classification for C#. Likewise, you can say, well, tell me every time a view is created and the content type of the thing is VB or the content type of the thing is C#, and then you can sit and you can listen to, oh, the buffers have changed, oh, the view has changed, or I want to do, you know, my.... Scott Hanselman: that point? You just subscribe to Events at

Noah Richards: Sure. You can write an extension that effectively takes some piece of the Editor and says I want to represent it this way instead. Scott Hanselman: Hi, this is Scott coming at you from another place in time. Are you looking for an Object Relational Mapping Tool for mission critical projects using LINQ and .NET? I want to share with you Genome, it's specifically designed for developing .NET Enterprise Applications. Genome is a mature LINQ integrated ORM tool. It has been employed in numerous large scale projects in the last six years. Genome was created for the .NET platform as oppose Transcription by PWOP Productions, http://www.pwop.com

Noah Richards: You just subscribe to Event, you say just let me know whenever things happen and I can decide do I want to add my thing here. We have this general idea of things called adornments which are these UI things and you can say, well, I want to put this adornment here, I want to put think of like the three dots for when you have collapsed text in an outlining region and that's just an adornment that we stick in a text and you can write that. In fact, with the way outlining works, you can replace that if you don't like the three dots or you can provide your own outlining regions because outlining is yet another one of these things that under the covers uses these logic subsystems' tagging and I can go in and say, well, in my C# files, I want to be able to collapse such and such a thing, so you write a component that whatever

Page 5 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

C# files open up, you say this region is also collapsible. Scott Hanselman: I'm starting to think about what kinds of things that someone could do if they were designing like a language but they knew that an Editor that was extensible existed ahead of time like multidimensional rays are no fun. Noah Richards: Of course.

Scott Hanselman: And you're not an old dude not just in age but in that kind of like been here for 20 years kind of old dude kind of way. Noah Richards: Certainly.

Scott Hanselman: Is your team, is that seven or eight people who work on the Editor? Noah Richards: Scott Hanselman: Dev staffs, yes. It's certainly devs rather than...

Scott Hanselman: But tiny Excel spreadsheets embedded in your Editor are cool. Noah Richards: Sure.

Noah Richards: Yeah. There's probably, I'll feel bad if I give the wrong number of people... Scott Hanselman: No, seven or eight is a small part, you know, a handful of devs. Noah Richards: There's probably 20 people total, project managers, developers, testers that work on the Editor. Scott Hanselman: Are they mostly new Microsoft employees or are they old dudes? Noah Richards: We got one guy who got his 15th year not too long ago, but other than him it's mostly a bunch of young guys. Scott Hanselman: Okay.

Scott Hanselman: So why not do that. It will be interesting if third parties jump in and decide to like make the VS super crazy power pack thing. Remember when debugger visualizers came out and everyone went just nuts coming out with all sorts of visualizers, free things, they can do the same thing now. Noah Richards: The reason why I get so excited about the new Editor is because as we talk about the Editor is public surface area, it's not like there is this magical things that we use underneath and those are the powerful things and then we show you some little pieces at the top. We implement everything like you can write a classifier, we write classifiers. It's all the same. You write a tagger for something, we write a tagger for something. Scott Hanselman: Noah Richards: Scott Hanselman: Because you're using MEF. Right. I mean, you can't hide it.

Noah Richards: We got one, I mean an architect who playfully refers to me as one of those Open Source communists. Scott Hanselman: Yeah and this is where I'm kind of going at. All this stuff about like, oh yeah, let them go nuts, total extensibility seems kind of not Microsofty. Noah Richards: I've heard that.

Noah Richards: Right, right. So I mean of course there are some things that are implementation details of something or other, but you can provide any extension that we can provide. You can consume any service that we consume, and every one of our pieces are design in this way in that something that uses Classification, i t ’ s not part of Classification, it consumes the Classification service and uses it so everything is very loosely connected in that way. Scott Hanselman: This is random, but how long have you worked here? Noah Richards: About a year-and-a-half.

Scott Hanselman: I want to make sure that the listeners understand. When I say old dude, I'm not talking about old in age or even old in seniority. I'm talking about old in mind. Noah Richards: Right.

Scott Hanselman: I've met a lot of 23-year-olds that were old in their minds. Do you know what I mean? But this seems to be a very relaxed and mellow like, oh yeah, let him have that as an extensibility point. Noah Richards: You'd be surprised. I mean, so people are really excited about the community that we can create from this, about letting people have the power to create whatever they want and not restricting them.

Scott Hanselman: Okay. So let's just phrase it this way. You're not an old dude. Noah Richards: Yes.

Transcription by PWOP Productions, http://www.pwop.com

Page 6 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Scott Hanselman:

Yeah.

Noah Richards: I mean, our partners tell us the same thing. Our partners outside of Visual Studio like Blend, the Blend and PowerShell. They tell us they love that they can take this Editor and mold it into whatever they want it to be. Scott Hanselman: Well, you know, I think about my good friends at like DevExpress, like CodeRush, and CodeRush have been doing like what I can only describe as impossible stuff... Noah Richards: Yes, oh.

Noah Richards: Comparing it against like the new Dev, it's a bit slower start-up cost for .NET, but, man, really there's now a lot of difference once you get into it. Scott Hanselman: One of the other things I wanted to ask is that how do you develop an Editor in the same Editor? Are you using Dev 10 to build Dev 10? Noah Richards: Yeah.

Scott Hanselman: Do you have like host applications that host this thing or do you have two versions of Visual Studio running at the same time? Noah Richards: We have test harnesses type of things. Like I said, because it's rehostable we can run it, but because we rely on, like I said, these language services that have to be in Visual Studio, they depend on the Visual Studio ecosystem. Scott Hanselman: Right.

Scott Hanselman: For like, you know, half a decade with the old Editor and when the new Editor came out, I was like oh no, what does this mean for CodeRush. I'm starting to realize more and more as I dig into it that they're going to be able to go bonkers. Noah Richards: And we've been working with all these great companies that are making these and like you said it really is, the things they do are really very impossible. The hoops, the hurdles they have to jump over... Scott Hanselman: Yeah, to do it now.

Noah Richards: To get to what they have to do, for some of them like the really cool visualization it's painful, and you know, we shut on the stuff and personally I was wondering the same thing, are they going to be mad... Scott Hanselman: Mad at you.

Noah Richards: We do have to test a lot of our stuff in VS. So it does get hairy when somebody checks in the thing that breaks the whatever and now you can't use it anymore, but we try to be pretty good about making sure that we maintain quality. So one of the things we care a lot about is Unit Testing and Code Coverage on the Editor team and we get our daily Code Coverage build and it's important that we keep it at a certain level and we get a lot of benefit out of that. Scott Hanselman: Do you Development? Are you test first? Noah Richards: Scott Hanselman: No, not... Do you feel bad? do Test Driven

Noah Richards: That they were making it so easy, but no, they come around in there like this is so much fun, I mean we've heard from various people it's so much fun to work with, it's so much easier, they love that i t ’ s managed code, I mean that's one of those. Scott Hanselman: Like you said, it's as fast as it was before. I mean people still, years and years later, think that managed code can't run fast. Noah Richards: Scott Hanselman: anymore. Oh yeah. But that's just not the case

Noah Richards: No. Well, I was trying to think if anybody, I mean individual people might... Scott Hanselman: You know, the whole like watch it fail and the fix it and then watch it succeed. Noah Richards: I d o n 't know in terms of anybody individually, I don't think anybody individually does that but we do spent a lot of time on it, and because a lot of our stuff is functional, data search is immutable. It makes Unit Testing a lot easier because you tend to worry less. So when we get into testing the interface, Unit Interface testing and this Integration testing, it gets a little more complicated, but when we're testing like the buffer and snapshots and all these other things we built on there, and there's a wealth of things that we've built down in our data level for people to discover, but it’s so easy to test because i t ’ s just functional immutable data structures.

Noah Richards: I remember one of the things that I wrote when I first got here was the Differencing Service. I generalize differencing service when we do this text differencing in the Editor for various things and I wrote in C# and a lot of people were saying, oh well, if it's managed code, it's going to get horrible. Scott Hanselman: Yeah, I can't do that.

Transcription by PWOP Productions, http://www.pwop.com

Page 7 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

Scott Hanselman: How often are your tests really unit test versus integration test or orchestration test so you got a bug but it only happens when you've got these subsystems all working together and you bring it, you know...? Noah Richards: Part of the nice thing again above being functional and immutable is that our unit tests are pretty good coverage of what's going to happen even when you integrate. So we do have integration test effectively do the make sure when the selection moves here and you press delete or you press whatever, that all these things happen and all these subsystems work together. Scott Hanselman: Right.

unit test. The Editor Unit test and the Integration test , we split them out separately to like we have text test and language tests in various levels there, probably about 10 minutes, yeah. Scott Hanselman: I have a couple more questions as we wrap up here. So what did you work on today, like what code did you run today or what did you fix today? Noah Richards: Let's see, I fixed two different bugs and recently I've been working a lot on performance. Scott Hanselman: Okay.

Noah Richards: And make sure that this text turns blue when whatever, but we don't rely on those heavily. We rely mostly on our unit tests to tell us what's going on. Scott Hanselman: Do you test those kinds of things that for example, you know, hit delete this turns blue, hit delete again it turns black? Is that something that you can test at the data layer of your three layers or do actually have that orchestration and you watch it happen on the screen and an invisible hand is typing delete? Noah Richards: Some of our UI tests do bring up UI and you can see like IntelliSense, it opens up the thing and you can see the drop down open up but our data test, data test or data things, we can test, at the logic level we can test it, Classification does what it says. We can test that you have to read classifiers and they all provide things and at the top of all these buffers it comes out the way you expect and then at some level of the UI, on top of that is just, you know, we test to make sure that the translation from classification type to classification format is WPF and it works and it sticks them all together and it works. Scott Hanselman: You can get like if you have thousands of tests at this point? How long does it take to run all the tests? Noah Richards: maybe 10 minutes. Scott Hanselman: Noah Richards: To run all of our unit tests,

Noah Richards: So a lot of profiling and trying to figure out, making sure like I said that we maintain your expectations in Visual Studio 2010. Scott Hanselman: Are those expectations like things like I opened a 55-meg text file and it was slow. Is it that kind of thing? Noah Richards: Sure, yeah. Those large file scenarios are absolutely some of the things that we looked at and we're very careful that the relative performance of some component isn't relative to file size, it's either relative to what's visible or relative to what changed or relative to things like this. A lot of it is just, you know, trying to localize and minimize the impact of various actions that you've taken in the Editor. Scott Hanselman: Very cool and I assume it will be like a whole -- at some point in the future, it will be a whole STK and anyone who is interested in this can get involve and people can start writing plug-ins. Noah Richards: Oh absolutely, and like you said, if you get the CTP, the editor is there now. Scott Hanselman: Okay, so they can start, a n d then with using MEF in the CTP you can start doing that now. Noah Richards: Yeah, yeah, you can use MEF to start building your extensions. We have some samples in there so they show you... Scott Hanselman: Oh really, your extensibility samples are all ready in the CTP. Noah Richards: Scott Hanselman: Yeah, yeah, yeah, we have... Oh okay.

So there are a lot of tests. Yeah.

Scott Hanselman: It's not like you d o n 't like to build, test, build, test, build, test because it takes 10 minutes to run them all. Noah Richards: Right. I mean, because everything is very localized to make change to classification, it's really easy to run the classification Transcription by PWOP Productions, http://www.pwop.com

Noah Richards: We have various things. I know one of the things we showed, one of the apps we built is a differencing application where it shows -it's an in line difference so, you know, a difference in

Page 8 of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev January 23, 2009

two things and you can edit it and type in it and you get IntelliSense, you get... Scott Hanselman: Inside, in the middle of the diff.

into components. We're going to separate as we need to, and so MEF was kind of just the next iteration in the stuff we have been working with for so long. Scott Hanselman: Cool. All right, well, thanks so much, Noah Richards, for talking to me today about new WPF-based Editor in Dev 10 in Visual Studio 2010. Noah Richards: Thanks very much.

Noah Richards: In the middle of your diff, you get it all like that. I mean, something like that is a little more complicated but these are all things that we absolutely want people to download and try like for me that's the value of a platform i s how much it enables people to build on it. Scott Hanselman: Y e s , I 've always wanted to have – a buddy of mine named Travis built a thing called documenter that basically takes the XML help and shows you what it would look like if you ran it through like end doc or scan Sandcastle. I've always wanted to have a rich text MSDN style Editor overlaid over my XML docs or just type it and then it will just make the right XML underneath. Noah Richards: Absolutely, in fact that's something like people here have been like this is something we need to do, it's something we should play with. I mean people here, we have this Application Building Week and people just get, they get so excited like think about the cool things that you can build now that you don't have to worry about... Scott Hanselman: Yeah, it's nice to look at an API and not go, oh man, I can't do that. Do you know what I'm saying? Noah Richards: Yeah.

Scott Hanselman: This has been another episode of Hanselminutes and I'll see you again next week.

Scott Hanselman: But to see a whole object model, a series of subsystems, a nice plug-in management system like MEF, I think I'm going to have Glenn Block on the show next so he can talk about methods. Noah Richards: Scott Hanselman: Neat. Is it fun working with MEF?

Noah Richards: Yeah, we've gone through a few different like component systems as they've been building MEF. Scott Hanselman: push the... So they've read MEF, they

Noah Richards: Yeah, they've read MEF and we pick it up and we give them feedback and they're all great guys. Scott Hanselman: Was that a big deal to say we're taking a dependency on MEF? Noah Richards: No. From the beginning, the Editor has said we're going to be effectively using a component system. We're going to push ourselves Transcription by PWOP Productions, http://www.pwop.com

Page 9 of 9

Sign up to vote on this title
UsefulNot useful