Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lines of Code in all project files
Message
De
13/07/2004 14:41:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00923721
Message ID:
00923908
Vues:
31
I don't agree; however, as I said, use the code as you like.

My reasoning, why I don't agree: If it is convenient to split a command into several lines, then it should also count like several lines.

Take a typical SELECT statement, for instance:
select (field list);
  from (table list);
  order by ...;
  group by ...;
  [nofilter];
  ...
Counting that as a single command doesn't consider the complexity of a SQL command; it is nice to be able to do lots of things in a single command, but we have to think about each and every line:
  • What fields do I need to include?
  • How should the result be sorted?
  • Is the NOFILTER clause relevant in this case?
  • How should records be combined?

    Each of these questions requires some thought from the programmer!

    What I really meant by the inaccuracies I mentioned was that for a report, for instance, the scctext tool creates quite a few lines of "code" for every single report object.


    Additional adjustments might be made for empty lines, and comments - at least, to count them separately. The ratio, lines with comments / total lines in the program, might give you a rough idea about the quality of the documentation.


    Ultimately, any decision in this respect is arbitrary to some degree.


    Regards,

    Hilmar.

    >Hilmar
    >
    >I added one line of code to remove continuation lines and make it a little more accurate.
    >
    >lnLineCount = occurs(chr(13), lcFileContents)
    >lnLineCount = lnLineCount - occurs(chr(59), lcFileContents) && Subtract continuations (;)
    >
    >
    >>>Hilmar
    >>>
    >>>Thanks. At least it gives me a ball park fiqure.
    >>
    >>Which, IIRC, is ridiculously high for some file types (for instance, for menus), and perhaps somewhat low for others. I was considering using some adjustment factors, based on the file type - but I didn't pursue the idea further.
    >>
    >>Feel free to use the code in any way that suits you. If you come up with some improvements, perhaps you, or I, can publish it eventually as a FAQ or download.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Précédent
    Suivant
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform