4 ms·
Myths about Managed Code
- Maro 17y agoVisual Studio is implemented in managed code? What part(s)?
- wyday 17y agoNearly the whole thing. Visual Studio 2010 even goes as far as to use WPF (Windows Presentation Foundation) - a GUI layer entirely written in managed code. Of course, satellite dll's & exe tools aren't all written in managed code. It's silly to re-write everything. But the main Visual Studio application has been at least partially managed since the Visual Studio 2002 days. P.S. I don't work for MS, but I do know this for a fact.
- nearestneighbor 17y agoI remember watching an interview (on Channel9, probably), that mentioned that Visual C++ had code in it dating back to the 80s. Props to MS for eating its own dog food if they rewrote everything for .NET
- wyday 17y agoI didn't say they rewrote everything for .NET. There is managed C++ which uses the CLR while also support native C++ code. So they could use code written in the 80's with managed C++. I seriously doubt they rewrote Visual Studio to be completely managed. That would be incredibly stupid for more than one reason.
- nearestneighbor 17y agoBut you did authoritatively claim that nearly all of Visual Studio is managed. The conservatism of Visual C++ alone makes me doubt that.
- wyday 17y agoI wrote sloppily. I meant the GUI when I referred to Visual Studio, and not all the compilers, linkers, utilities, etc. I apologize.
- snprbob86 17y agoI work for MS and do Visual Studio integration work for XNA Game Studio. The whole of VS isn't even close to being mostly managed code. While it is true that 2010's GUI is mostly managed code, thanks to WPF, the internals are entirely COM. The project system, debuggers, command system, and many other large components are all C++/COM. Even many of the components which are managed read more like C++ than like C# due to all the QueryInterface and ref counting nonsense. Developer devision, commonly known as DevDiv, contains the VS team, programming language teams, and many other related teams. DevDiv is by far the company's largest consumer of managed code. I'd bet that there is more managed code in DevDiv's source tree than the rest of the company combined. That doesn't mean they threw out 30+ years of efforts and backwards compatibility all at once.
- wyday 17y agoI was referring to GUI of Visual Studio - but thanks for the clarification. I didn't mean to imply MS replaced 30 years of code in one go. I should've written more carefully.
- barrkel 17y agoFor VS2008 it's mostly the build engine, design surfaces / property inspectors, and various wrapper classes to permit managed code to interact with the older COM-oriented core. I did a dump of managed heap on VS2008 with a managed solution loaded. These are the Microsoft.* classes which were instantiated at the time of the dump: http://pastebin.com/f3010df3e http://pastebin.com/f3010df3e
- y0ghur7_xxx 17y ago"On the other hand, there are still scenarios in which managed code simply cannot be used today (such as building the CLR itself or the debugger)." I thought the Mono CLR is written in C#, as is the C# compiler which compiles itself. Did I misunderstand something?
- snprbob86 17y agoYou can write a self-hosting compiler for C# quite easily. However, the core of the runtime is going to be a major pain in the ass to write self hosting. The Mono guys came to the same conclusion, their tree contains oodles of C/C++: http://www.google.com/codesearch?as_package=mono&as_filename=\.h$ http://www.google.com/codesearch?as_package=mono&as_file...