Click to See Complete Forum and Search --> : [VB5/6] Quick lines of code count
dilettante
Jun 8th, 2008, 09:13 PM
This WSH script can be kept in your project folder and just given a quick double-click when you want an approximate count of the lines of code in your saved project.
Ellis Dee
Jun 9th, 2008, 09:04 AM
Very cool.
DigiRev
Jun 9th, 2008, 04:15 PM
I use MZTools, but I agree this is cool. :cool:
2bRaistlin
Jun 9th, 2008, 05:56 PM
Thanks, very nice.. I was always curios to know how many i have written.. 44709 lines..
Question what is a small program a medium program a big program and a huge program in terms of lines?
I know its a 'silly' question, but maybe someone wants to answer..
have a nice day...
Raistlin
si_the_geek
Jun 10th, 2008, 10:48 AM
It is very subjective, and depends on your coding style.. if you tend to re-use code (loops, subs/functions, template forms, usercontrols, etc) I would probably say small/medium/big/huge would be about: under 5000/up to 20000/up to 50000/higher. If you don't code in that way, the numbers are much bigger.
My highest (using the first style) has been around 200000, but that was a mammoth project - covering the entire design/production/packing/testing for each component in a manufacturing process.
Of course the 'size' of a project is not just related to the number of lines, I've written some programs with under 10000 lines which, due to the complexity of what they do and the need for small/fast code, take a disproportionate amount of time to write (more than a 50000 line program).
edit: due to the way I organise my code files (separate sibling folder for files shared by multiple projects, and test/backup versions under the project folder), this particular method of counting wont work for me - I use the one in MZTools instead.
2bRaistlin
Jun 10th, 2008, 07:46 PM
Thanks for the answer!!
dilettante
Jun 10th, 2008, 10:16 PM
I agree, add-ins like MZTools are very powerful.
By writing this as a script customization should be easy too.
For example this version doesn't count blank lines or comment lines, and it counts "wrapped" (_) lines as one line.
As noted above both expect all of the project's modules to be in the project folder or in subfolders. It is quite possible to construct your project's "source tree" differently - which will produce incorrect results using this script.
dilettante
Jun 10th, 2008, 10:45 PM
You're right about the subjectivity of "big."
I think that 1500 lines of tested and debugged VB (by LOC2's measure) is pretty respectable. I might put the "small" boundary there because even 300 lines of code per 8 hour day is extremely productive work by industry measures. 1500 lines would represent a solid work week of effort.
That assumes you're writing the code and not just gluing together prewritten modules and counting them though. ;)
But there are many factors involved. As a program grows writing additional lines can cost more per line due to increasing complexity. Then there is the choice of tools as well as the problem space.
Vista was said to be 50M+ lines of code. The staff working on creating Vista (starting with XP SP 2 and 2003 R2 as a baseline) were said to have produced about 1000 lines of tested new/changed code per year.
The World As Best As I Remember It (http://blogs.msdn.com/philipsu/archive/2006/06/14/631438.aspx)
30 to 40 lines of working code per day is supposed to be typical for commercial programmers. At 40 LOC/day my 1500 line example would take over 7 work weeks!
Small? Don't forget the documentation! :D
DigiRev
Jun 11th, 2008, 10:58 AM
30 to 40 lines of working code is productive? I wish my boss knew that...
I write probably a few hundred each day, but most of my projects end up with anywhere from 5,000 to 10,000. Except the cases where I use 3rd party code which can easily add thousands more.
An instant messenger I'm making currently has over 50,000 and it is not even half-way done. And it is what I consider, very clean, neat, compact code that I have probably done about 100 lines a day on, since I am working very hard to keep it as short as possible.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.