Results 1 to 9 of 9

Thread: [VB5/6] Quick lines of code count

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    [VB5/6] Quick lines of code count

    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.
    Attached Files Attached Files

  2. #2
    PowerPoster Ellis Dee's Avatar
    Join Date
    Mar 2007
    Location
    New England
    Posts
    3,530

    Re: [VB5/6] Quick lines of code count

    Very cool.

  3. #3
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: [VB5/6] Quick lines of code count

    I use MZTools, but I agree this is cool.

  4. #4
    New Member
    Join Date
    Mar 2007
    Posts
    9

    Re: [VB5/6] Quick lines of code count

    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

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [VB5/6] Quick lines of code count

    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.
    Last edited by si_the_geek; Jun 10th, 2008 at 10:53 AM.

  6. #6
    New Member
    Join Date
    Mar 2007
    Posts
    9

    Re: [VB5/6] Quick lines of code count

    Thanks for the answer!!

  7. #7

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [VB5/6] Quick lines of code count

    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.
    Attached Files Attached Files

  8. #8

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [VB5/6] Quick lines of code count

    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


    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!
    Last edited by dilettante; Jun 10th, 2008 at 10:53 PM.

  9. #9
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: [VB5/6] Quick lines of code count

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width