Welcome to MSDN Blogs Sign in | Join | Help

Josh Heitzman's Blog

Visual Studio SDK: Senior C++ Developer

Syndication

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

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).

Published Friday, March 31, 2006 3:07 PM by Josh Heitzman

Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Sample Code Size Comparison (part 2): C++ vs. C# @ Friday, March 31, 2006 6:56 PM

But which is faster to read and understand properly when you haven't wrote it? The size argument used alone supports using PERL...

zzz

# re: Sample Code Size Comparison (part 2): C++ vs. C# @ Friday, March 31, 2006 7:26 PM

That's a pretty subjective question.  I believe ease of reading really depends on what coding style(s) the reader is used to and how closely the code in question matches what they are used too.  Both C++ and C# offer a lot of flexibility in terms of coding style.  Perl actually offers even more implementation sytle flexibility then either C++ or C# due one of PERL's core principles being that there is no one way to do any given thing (and there is frequently more then 2 ways to do it as well).  So if the goal is to maximize readability and minimize code, Python might actually a better bet the Perl, as whitespace has meaning, thus reducing the varation in coding style.

That being said, nearly all Visual Studio Integration Packages are written in either C++ or C#, so those two languages are what are interesting to compare here.  C++ and C# are both also considered system programming languages, where as Perl and Python are not considered system programming languages.

Josh Heitzman

# re: Sample Code Size Comparison (part 2): C++ vs. C# @ Wednesday, June 07, 2006 11:06 AM

Please send me the source code,How we calculated the size of one excel sheet to multiple excel sheet.

please....................

amit

Leave a Comment

(required) 
required 
(required) 
Page view tracker