Click here to Skip to main content
15,885,216 members
Articles / Desktop Programming / MFC
Article

Counting version1.1

Rate me:
Please Sign up or sign in to vote.
4.76/5 (14 votes)
27 Jan 20042 min read 67.8K   767   24   14
A software to count lines in our source code.

Sample Image - main_en.gif

Introduction

In working, we often need to count how many lines our programmers have developed, including source code lines, comment lines and blank lines. This software, Counting ver1.1, is designed for that purpose. At first, I developed it to count my VC++ source code. Later, it was upgraded to count files such as VB, Java, ASP, JSP and so on. By comparison, I found Counting is more quick and more accurate, especially for some unfamiliar instances.

Advantages

  1. Accurate: This function is absolutely necessary for any line-counting software. For that purpose, I created one test file (test.cpp), in which I designed some reasonable code lines but can be easily wrong counted. Counting (ver1.1) can count lines in test.cpp accurately.
  2. More quick: Due to proper process and good algorithms, Counting can count lines very quickly.
  3. Easy to use: Counting is easy to use and doesn’t need to be installed.

How to use?

  • Input file name or extension in the “file or extension” (like .cpp;*.c;*.h or counting.cpp; setting.c; resource.h), separated by “: , :”. Click the combo box and you can select some extensions.
  • Input path in the “searching in” combo box.
  • You can select whether to count in subfolder.
  • Click “Count” button to begin counting, click again to stop counting.
  • You can click “Save” button to save the counting result to a text file, Excel file or CSV file.
  • Double click the control list to open the file.
  • If code and comment lie on the same line, you can select different method to count in Setting dialog box.

Statement of the Author:

This software is an open source. You can use it freely but don't remove any declaration about the author. Please let me know of any problems or improvements. Also you can download the latest version on my personal homepage. Thanks and good luck. My Email: xiaogi@sohu.com.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
BugThe executable in the release folder is infected with the Virus Pin
prcontact@hotmail.com30-Mar-21 8:56
prcontact@hotmail.com30-Mar-21 8:56 
QuestionResource leak Pin
rushiraj.jhala23-Mar-07 21:19
rushiraj.jhala23-Mar-07 21:19 
Generalanother source code file analyzer Pin
KingMarine27-Jan-05 17:17
KingMarine27-Jan-05 17:17 
GeneralRe: another source code file analyzer Pin
.dan.g.24-Mar-06 21:05
professional.dan.g.24-Mar-06 21:05 
GeneralLatest Version Pin
99agrawala29-Oct-04 10:45
99agrawala29-Oct-04 10:45 
GeneralDefinition of LOC Pin
Thomas Pfleger4-Feb-04 0:15
Thomas Pfleger4-Feb-04 0:15 
GeneralRe: Definition of LOC Pin
xiaogi15-Feb-04 3:02
xiaogi15-Feb-04 3:02 
QuestionTool for dumb managers? Pin
567890123429-Jan-04 1:26
567890123429-Jan-04 1:26 
AnswerRe: Tool for dumb managers? Pin
Heywood29-Jan-04 2:22
Heywood29-Jan-04 2:22 
GeneralCounting Program Lines? Pin
DavidFMayerPhD17-Nov-08 7:24
DavidFMayerPhD17-Nov-08 7:24 
AnswerRe: Tool for dumb managers? Pin
xiaogi29-Jan-04 13:32
xiaogi29-Jan-04 13:32 
AnswerRe: Tool for dumb managers? Pin
Thomas Pfleger4-Feb-04 0:05
Thomas Pfleger4-Feb-04 0:05 
Hi,

one shouldn't overestimate the meaning of a lOC number, but it can give some hints about the size of the monster. When estimating maintenance efforts of *similiar* systems it can be a first indicator of what's bigger than the other one. Of course there is verbose programming with a lot of copy and paste instead of cute refactoring and traces of the genius but the bottom line is that a bigger system is nearly always more cumbersome to maintain.
The lines of comment tell nothing about the semantic quality of the comments, but if the ratio between comments and code lines is considerably low I would take a closer look at such files to find out if there is a problem with the comments. So IMHO counting can give hints for spot check inspection of the code in larger systems. When reviewing a 75000 LOC system with some megabytes of source code, I found a homegrown counting tool very helpful to find the "hot spots". Not to my surprise we found a lot of bad techniques in the largest, poor commented files. Counting is not "the truth", but it is helpful.

By the way, I had to set another LANGUAGE definition in the resource file since I'm not running a chinese Windows. For use on CodeProject, English might be the better choice.

Happy programming,
Thomas
Generalbig resource-leak Pin
Dieter Hammer28-Jan-04 20:48
Dieter Hammer28-Jan-04 20:48 
GeneralRe: big resource-leak Pin
xiaogi29-Jan-04 13:36
xiaogi29-Jan-04 13:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.