Sample Code Size Comparison (part 2): C++ vs. C#

Follows is the data I previously posted here, with the addition of the new Single View Editor Reference samples:

 

Code Lines

Comment Lines

Characters

Semi-colons

Functions

Feature equivalent

 

 

 

 

 

C++ Tool Window

828

508

53,858

228

34

C# Tool Window

844

724

63,686

433

49

C++ Menus & Commands

178

222

18,996

38

11

C# Menus & Commands

227

201

20,498

90

10

C++ Services

315

320

28,230

78

15

C# Services

270

289

26,773

101

13

C++ Single View Editor

2,653

1,203

130,689

879

142

C# Single View Editor

3,253

1,620

251,990

1,147

276

Not feature equivalent

 

 

 

 

 

C++ Package

81

201

13,648

7

3

C# Package

204

261

22,284

72

17

 

Again the flexibility that VSL offers by being distributed as C++ header files, allows it to be added to and changed as needed, where as the MPF binaries are frozen along with the Visual Studio Platform binaries.  Another factor is the ability to use multiple inheritance to inherit the implementation for many of the necessary editor interfaces (22 interfaces excluding IUknown, IDispatch, and IConnectionPointContainer).