Results 1 to 7 of 7
  1. #1
    allenme
    Guest

    Count lines of code in Access2k project (Access/2000)

    Greetings! Does anyone have a utility for counting lines of (non-commentary/non-blank) code in an Access project?

    Thanks,
    Michael

  2. #2
    allenme
    Guest

    Re: Count lines of code in Access2k project (Access/2000)

    I actually do want to use this method as a measure of productivity. I understand that a lot of code is generated by wizards, but I am only planning on looking at the code that I wrote. I am now trying your suggestion and also looking for VB tools that will do what I want with the exported code.

    Thanks!

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Count lines of code in Access2k project (Access/2000)

    You said WHAT?? My code isn't generated by wizards and I'd be interested to hear about the high level language values that don't apply. There's very little difference between well-written code in any language except for those differences that are imposed by the structure of the language itself. There's almost no difference between my VB code and my VBA code except for what arises from differences in object behavior between executables. On the other hand, you can't apply the same production standards to COBOL and to VBA. When you come right down to it, programming is as much art as science. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

    Code modules and Access modules have CountOfLines and CountOfDeclarationLines properties, along with a Find method that can be locate particular text in a module. There is also a ProcCountLines property that returns the number of lines in a procedure once you find it. If you wanted to, you could step through each line examining it to see if it had a length greater than 0 when trimmed and incrementing a counter.
    Charlotte

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Count lines of code in Access2k project (Access/2000)

    OOPs - I apparently ignited a controversy. I made an assumption that this was a task initiated by management schooled in 20th century software development methodology. In that world, you were supposed to estimate the number of lines of code for a project, divide the number of lines by whatever productivity standard you liked, and then put whatever number of people on the project would get it done when you needed it done. In point of fact, it almost never worked.

    In the world of Access, code is only part of the picture. You also have to do table design, create queries, forms and reports. The amount of code in projects also varies widely depending on the project needs and the approach taken by the developer. For that reason, I avoid using measures like the count of lines of code. In fact we have recently been using a variation of the Extreme Programming paradigm, and it seems to work pretty well. There is a series of books on the subject, some of which make sense to me, and some which don't. The bottom line, in this context, is that you have an experience developer estimate the time it will take in actual development hours for small chunks of the project, do the small chunk, refine estimates, and do the next small chunk. It appears to work as well or better than any other approach I've seen.

    It's an interesting subject in it's own right - not sure we want to continue it in this forum. I will let you be the judge of that. <img src=/S/argue.gif border=0 alt=argue width=50 height=25>
    Wendell

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Count lines of code in Access2k project (Access/2000)

    I don't know of any utility that will do it for you, but you can export each module to a text file, concatenate the whole thing and exclude comment lines.

    On the other hand, if you are trying to use the number of lines of code to measure productivity, it doesn't work at all well with Access. Often code is generated by wizards of one sort or another, and typical high level language productivity standards don't apply to Access at all.
    Wendell

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Count lines of code in Access2k project (Access/2000)

    The only way that line counts every worked was if adequate specs had been created and all the preliminary work done first. Even in older languages, somebody still had to design screens and work out the spacing for print lines, etc., before the code could actually be written. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  7. #7
    allenme
    Guest

    Re: Count lines of code in Access2k project (Access/2000)

    Charlotte,

    Thanks for the pointers to the *Count* properties... sounds like this is a good utility to write in my spare time....

    Thanks again,
    Michael

Posting Permissions

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