• Re: Clair Grant on VMS code base

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dan Cross on Tue Apr 1 13:52:56 2025
    On 4/1/2025 1:42 PM, Dan Cross wrote:
    In article <vsh5m5$3is6e$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    Wow. That's a lot smaller than I had expected.

    It must be some of the bigger ones.

    409/15 * 1.9 MLOC would be over 50 MLOC, which is way too
    high, so "representative of identifiable components of
    the system" must have skewed selection towards
    bigger ones.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Tue Apr 1 18:08:24 2025
    In article <vsh95o$3is6e$2@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/1/2025 1:42 PM, Dan Cross wrote:
    In article <vsh5m5$3is6e$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    Wow. That's a lot smaller than I had expected.

    It must be some of the bigger ones.

    409/15 * 1.9 MLOC would be over 50 MLOC, which is way too
    high, so "representative of identifiable components of
    the system" must have skewed selection towards
    bigger ones.

    I assume these were chosen because they represent the bulk of
    what one would consider to be the "core" of VMS.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Tue Apr 1 19:41:03 2025
    On 4/1/2025 6:36 PM, Lawrence D'Oliveiro wrote:
    On Tue, 1 Apr 2025 13:52:56 -0400, Arne Vajhøj wrote:
    409/15 * 1.9 MLOC would be over 50 MLOC, which is way too
    high, so "representative of identifiable components of
    the system" must have skewed selection towards
    bigger ones.

    That must be including a bunch of userland components, not just the OS kernel.

    The calculated number that is way bigger than the real
    number does not really include or exclude anything.

    Clair's list of 15 selected areas does include DCL and
    PCSI.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Apr 1 12:53:25 2025
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Tue Apr 1 17:42:57 2025
    In article <vsh5m5$3is6e$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    Wow. That's a lot smaller than I had expected.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Tue Apr 1 22:36:23 2025
    On Tue, 1 Apr 2025 13:52:56 -0400, Arne Vajhøj wrote:

    409/15 * 1.9 MLOC would be over 50 MLOC, which is way too
    high, so "representative of identifiable components of
    the system" must have skewed selection towards
    bigger ones.

    That must be including a bunch of userland components, not just the OS
    kernel.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Thu Apr 3 18:15:13 2025
    On 2025-04-01, Arne Vajh°j <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/


    How the hell does DCL have 30,000+ lines of code ? :-)
    (Even allowing for the fact most of it is in Macro-32)

    Also, regarding those BLISS/Macro-32 figures across the various modules
    in general, I wonder how much smaller the code would have been if it had
    been written in C ?

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Thu Apr 3 14:33:16 2025
    On 4/3/2025 2:15 PM, Simon Clubley wrote:
    On 2025-04-01, Arne Vajhøj <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    How the hell does DCL have 30,000+ lines of code ? :-)
    (Even allowing for the fact most of it is in Macro-32)

    Just for fun I downloaded bash and counted. 117 KLOC.

    Also, regarding those BLISS/Macro-32 figures across the various modules
    in general, I wonder how much smaller the code would have been if it had
    been written in C ?

    C is a relative high LOC/FP language.

    Most LOC/FP tables have C in the 100-125 range and macro-assembler
    in the 200-250 range.

    If we adjust for VAX instructions being more powerful/complex
    than average ISA, add a random number and subtract wind speed I
    will estimate the Macro-32 / C ratio to be around 1.5-1.75.

    If you buy that then the DCL 33 KLOC would be 19-22 KLOC in C
    to be compared with bash 117 KLOC.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Fri Apr 4 18:00:53 2025
    On 2025-04-03, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/3/2025 2:15 PM, Simon Clubley wrote:
    On 2025-04-01, Arne Vajh°j <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    How the hell does DCL have 30,000+ lines of code ? :-)
    (Even allowing for the fact most of it is in Macro-32)

    Just for fun I downloaded bash and counted. 117 KLOC.


    Wow. I had no idea it was now that big. OTOH, bash has got a _lot_ more functionality in it than DCL does.

    Also, regarding those BLISS/Macro-32 figures across the various modules
    in general, I wonder how much smaller the code would have been if it had
    been written in C ?

    C is a relative high LOC/FP language.

    Most LOC/FP tables have C in the 100-125 range and macro-assembler
    in the 200-250 range.

    If we adjust for VAX instructions being more powerful/complex
    than average ISA, add a random number and subtract wind speed I
    will estimate the Macro-32 / C ratio to be around 1.5-1.75.

    If you buy that then the DCL 33 KLOC would be 19-22 KLOC in C
    to be compared with bash 117 KLOC.


    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given.
    That is something which can be implemented a lot more easily and concisely
    in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Alderson@21:1/5 to Simon Clubley on Fri Apr 4 15:24:48 2025
    Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:

    On 2025-04-03, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/3/2025 2:15 PM, Simon Clubley wrote:
    On 2025-04-01, Arne Vajh°j <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    How the hell does DCL have 30,000+ lines of code ? :-)
    (Even allowing for the fact most of it is in Macro-32)

    Just for fun I downloaded bash and counted. 117 KLOC.

    Wow. I had no idea it was now that big. OTOH, bash has got a _lot_ more functionality in it than DCL does.

    Also, regarding those BLISS/Macro-32 figures across the various modules
    in general, I wonder how much smaller the code would have been if it had >>> been written in C ?

    C is a relative high LOC/FP language.

    Most LOC/FP tables have C in the 100-125 range and macro-assembler
    in the 200-250 range.

    If we adjust for VAX instructions being more powerful/complex
    than average ISA, add a random number and subtract wind speed I
    will estimate the Macro-32 / C ratio to be around 1.5-1.75.

    If you buy that then the DCL 33 KLOC would be 19-22 KLOC in C
    to be compared with bash 117 KLOC.

    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given.
    That is something which can be implemented a lot more easily and concisely
    in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    That also depends on the operating system environment.

    TOPS-20, on later PDP-10 systems including clones, has a built in system call COMND% which is a fully capable command parser which includes context sensitive help, switch parsing, etc.

    High-level languages on TOPS-20 have COMND% calls in their run time systems.

    --
    Rich Alderson news@alderson.users.panix.com
    Audendum est, et veritas investiganda; quam etiamsi non assequamur,
    omnino tamen proprius, quam nunc sumus, ad eam perveniemus.
    --Galen

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Sun Apr 6 20:34:54 2025
    On 4/4/2025 2:00 PM, Simon Clubley wrote:
    On 2025-04-03, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/3/2025 2:15 PM, Simon Clubley wrote:
    On 2025-04-01, Arne Vajhøj <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/

    How the hell does DCL have 30,000+ lines of code ? :-)
    (Even allowing for the fact most of it is in Macro-32)

    Just for fun I downloaded bash and counted. 117 KLOC.


    Wow. I had no idea it was now that big. OTOH, bash has got a _lot_ more functionality in it than DCL does.

    6 times more?

    Also, regarding those BLISS/Macro-32 figures across the various modules
    in general, I wonder how much smaller the code would have been if it had >>> been written in C ?

    C is a relative high LOC/FP language.

    Most LOC/FP tables have C in the 100-125 range and macro-assembler
    in the 200-250 range.

    If we adjust for VAX instructions being more powerful/complex
    than average ISA, add a random number and subtract wind speed I
    will estimate the Macro-32 / C ratio to be around 1.5-1.75.

    If you buy that then the DCL 33 KLOC would be 19-22 KLOC in C
    to be compared with bash 117 KLOC.


    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given.
    That is something which can be implemented a lot more easily and concisely
    in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    It is not obvious to me that:

    (LOC/FP for Macro-32) / (LOC/FP for C)

    is a lot higher for a shell than for the average application - data
    structures are not anything special for shells.

    But maybe.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Sun Apr 6 20:58:43 2025
    On 4/6/2025 8:34 PM, Arne Vajhøj wrote:
    On 4/4/2025 2:00 PM, Simon Clubley wrote:
    It basically parses, validates, and executes commands it has been given.
    That is something which can be implemented a lot more easily and
    concisely
    in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    It is not obvious to me that:

    (LOC/FP for Macro-32) / (LOC/FP for C)

    is a lot higher for a shell than for the average application - data structures are not anything special for shells.

    But maybe.

    And Macro-32 can be used to work with data structures.

    Many have worked with FAB and RAB in Macro-32. :-)

    To illustrate:

    $ type ds.c
    #define MAX_LEN 80

    struct data
    {
    int v;
    int slen;
    char s[MAX_LEN];
    };

    void m(struct data * d)
    {
    d->v = d->v + 1;
    d->s[d->slen] = 'X';
    d->slen += 1;
    }

    $ type ds.mar
    .title ds
    MAX_LEN=10
    V=0
    SLEN=V+4
    S=SLEN+4
    X=88
    .psect $CODE quad,pic,con,lcl,shr,exe,nowrt
    .entry m,^m<>
    movl 4(ap),r0
    addl2 #1, V(r0)
    movab S(r0), r1
    addl2 SLEN(r0), r1
    movb #X, (r1)
    addl2 #1, SLEN(r0)
    ret
    .end
    $ type dstest.for
    program dstest
    structure /data/
    integer*4 v
    integer*4 slen
    character*80 s
    end structure
    record /data/buf
    buf.v = 123
    buf.s = 'ABC'
    buf.slen = len('ABC')
    call m(buf)
    write(*,*) buf.v, buf.s(1:buf.slen)
    end
    $ for dstest
    $ cc ds
    $ link dstest + ds
    $ run dstest
    124 ABCX
    $ macro ds
    $ link dstest + ds
    $ run dstest
    124 ABCX

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Mon Apr 7 08:14:03 2025
    On Mon, 7 Apr 2025 07:40:16 -0000 (UTC), I wrote:

    On Sun, 6 Apr 2025 20:34:54 -0400, Arne Vajhøj wrote:

    ... bash has got a _lot_ more functionality in it than DCL does.

    6 times more?

    ldo@theon:~> man bash | wc -w
    52159

    I think that’s considered about novel-length.

    How many words are there in the DCL reference?

    I suppose the reference is the “DCL Dictionary”. And that is a lot longer. But then, it includes docs for a lot of commands that are not built into
    DCL itself. You’d have to take those out for a fair comparison.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Mon Apr 7 07:40:16 2025
    On Sun, 6 Apr 2025 20:34:54 -0400, Arne Vajhøj wrote:

    ... bash has got a _lot_ more functionality in it than DCL does.

    6 times more?

    ldo@theon:~> man bash | wc -w
    52159

    I think that’s considered about novel-length.

    How many words are there in the DCL reference?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Mon Apr 7 15:26:44 2025
    On 4/7/2025 4:14 AM, Lawrence D'Oliveiro wrote:
    On Mon, 7 Apr 2025 07:40:16 -0000 (UTC), I wrote:
    On Sun, 6 Apr 2025 20:34:54 -0400, Arne Vajhøj wrote:
    ... bash has got a _lot_ more functionality in it than DCL does.

    6 times more?

    ldo@theon:~> man bash | wc -w
    52159

    I think that’s considered about novel-length.

    How many words are there in the DCL reference?

    I suppose the reference is the “DCL Dictionary”. And that is a lot longer.
    But then, it includes docs for a lot of commands that are not built into
    DCL itself. You’d have to take those out for a fair comparison.

    VMS 9.2-3

    VERB dump
    take everything with CLIROUTINE
    add :=, =, @ and lexical
    foreach
    HELP/OUT=Z.Z whatever...
    APPEND Z.Z HELP.HLP

    64431 words

    Not sure that really means anything.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Tue Apr 8 08:29:15 2025
    On 4/8/2025 8:20 AM, Simon Clubley wrote:
    On 2025-04-06, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/4/2025 2:00 PM, Simon Clubley wrote:
    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given. >>> That is something which can be implemented a lot more easily and concisely >>> in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    It is not obvious to me that:

    (LOC/FP for Macro-32) / (LOC/FP for C)

    is a lot higher for a shell than for the average application - data
    structures are not anything special for shells.

    But maybe.

    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort)
    do you think it would take to implement it in Macro-32 compared to C ?

    Still not obvious to me that it would not follow normal LOC/FP
    ratios.

    Effort is a different issue. If someone said:

    x1.6 LOC
    x16 hours for initial write of code
    x160 hours for maintenance of code

    then I would consider it likely.

    It has been hinted a few time that the DCL code is not easy to
    understand and modify.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Tue Apr 8 12:20:49 2025
    On 2025-04-06, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/4/2025 2:00 PM, Simon Clubley wrote:

    Wow. I had no idea it was now that big. OTOH, bash has got a _lot_ more
    functionality in it than DCL does.

    6 times more?


    It wouldn't surprise me, in addition to the higher-level constructs that
    bash has when compared to DCL.


    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given.
    That is something which can be implemented a lot more easily and concisely >> in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    It is not obvious to me that:

    (LOC/FP for Macro-32) / (LOC/FP for C)

    is a lot higher for a shell than for the average application - data structures are not anything special for shells.

    But maybe.

    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort)
    do you think it would take to implement it in Macro-32 compared to C ?

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From abrsvc@21:1/5 to All on Tue Apr 8 16:21:16 2025
    As someone that ported a CLI from VAX to Alpha that replaced DCL, I can
    attest that the code is not the easiest to understand _/or modify
    correctly.

    Dan

    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Tue Apr 8 17:27:06 2025
    On 2025-04-08, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/8/2025 8:20 AM, Simon Clubley wrote:
    On 2025-04-06, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/4/2025 2:00 PM, Simon Clubley wrote:
    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given. >>>> That is something which can be implemented a lot more easily and concisely >>>> in a HLL with abstracted data structure capabilities (which includes
    even C) than an assembly language with no such capabilities.

    It is not obvious to me that:

    (LOC/FP for Macro-32) / (LOC/FP for C)

    is a lot higher for a shell than for the average application - data
    structures are not anything special for shells.

    But maybe.

    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort)
    do you think it would take to implement it in Macro-32 compared to C ?

    Still not obvious to me that it would not follow normal LOC/FP
    ratios.


    Try implementing one, especially with a reasonably sized grammar, and
    you will very rapidly understand that it is not as simple as you seem
    to think it is. :-)

    Effort is a different issue. If someone said:

    x1.6 LOC
    x16 hours for initial write of code
    x160 hours for maintenance of code

    then I would consider it likely.

    It has been hinted a few time that the DCL code is not easy to
    understand and modify.


    As I mentioned above, this is no longer about DCL. I picked the above standalone example, a LL(1) RD parser, because it's a really good example
    of the different scale of effort involved in writing it in Macro-32
    instead of in C.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Reagan@21:1/5 to Simon Clubley on Wed Apr 9 16:01:02 2025
    On 4/3/2025 2:15 PM, Simon Clubley wrote:
    On 2025-04-01, Arne Vajhøj <arne@vajhoej.dk> wrote:
    He looks at size 6.2 -> 7.2 -> 8.2 -> 9.2 and .mar vs .c 6.2 -> 9.2.

    https://vmssoftware.com/resources/blog/2025-03-31-how-big-is-vms/


    How the hell does DCL have 30,000+ lines of code ? :-)
    (Even allowing for the fact most of it is in Macro-32)

    Also, regarding those BLISS/Macro-32 figures across the various modules
    in general, I wonder how much smaller the code would have been if it had
    been written in C ?

    Simon.

    I'm not sure how Clair counted.

    I just looked at the largest MAR file in DCL. It has 10,000 lines but
    many are comments and many are macro definitions. Not actual VAX
    instructions.

    And if you look at the listing line numbers (in both MAR and C)
    listings, the listing line numbers reflect all the macro expansions (in
    Macro) or include files (in C).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to John Reagan on Wed Apr 9 21:10:10 2025
    On Wed, 9 Apr 2025 16:01:02 -0400, John Reagan wrote:

    I just looked at the largest MAR file in DCL. It has 10,000 lines but
    many are comments and many are macro definitions. Not actual VAX instructions.

    I would count macro definition bodies in full, and each macro expansion as
    one line. After all, macros are code written once and used multiple times,
    just like function calls as far as source code is concerned.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Fri Apr 11 15:05:09 2025
    On 4/9/2025 5:10 PM, Lawrence D'Oliveiro wrote:
    On Wed, 9 Apr 2025 16:01:02 -0400, John Reagan wrote:
    I just looked at the largest MAR file in DCL. It has 10,000 lines but
    many are comments and many are macro definitions. Not actual VAX
    instructions.

    I would count macro definition bodies in full, and each macro expansion as one line. After all, macros are code written once and used multiple times, just like function calls as far as source code is concerned.

    That definitely makes sense.

    But there are still multiple possible counts:
    - lines in files
    - non-comment and non-blank lines in files
    - non-comment and non-blank and non-continued lines in files

    ; Macro-32 demo

    .title loc
    $SSDEF
    .psect $PDATA quad,pic,con,lcl,shr,noexe,nowrt
    fmt: .ascid "!SL !SL !SL"
    .psect $LOCAL quad,pic,con,lcl,noshr,noexe,wrt
    buf: .ascid " "
    .psect $CODE quad,pic,con,lcl,shr,exe,nowrt
    .entry loc,^m<>
    pushl #20
    pushl #22
    pushl #24
    pushab buf
    pushl #0
    pushab fmt
    calls #6, -
    G^LIB$SYS_FAO
    pushab buf
    calls #1, -
    G^LIB$PUT_OUTPUT
    movl #SS$_NORMAL, r0
    ret
    .end loc

    But in the C vs Macro-32 discussion I think it about evens out. C got
    more blank lines, but Macro-32 (hopefully!) has more comments.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Fri Apr 11 15:34:06 2025
    On 4/11/2025 3:29 PM, Arne Vajhøj wrote:
    On 4/8/2025 1:27 PM, Simon Clubley wrote:
    As I mentioned above, this is no longer about DCL. I picked the above
    standalone example, a LL(1) RD parser, because it's a really good example
    of the different scale of effort involved in writing it in Macro-32
    instead of in C.

    I have not made any claim about effort either.

    Are you sure that you have understood the topic??

    The classic assumptions are:

    LOC = a * FP
    effort = b * LOC**c = a * b * FP**c

    where a, b and c are language specific and c > 1.

    The topic is whether the first one is true (strictly speaking
    it does not need to be linear for my original claim to be
    true - it would be true for any LOC = a * f(FP) where f
    does not depend on language).

    Whether a[Macro-32] * b[Macro-32] * FP**c[Macro-32] is at a different
    scale than a[C] * b[C] * FP**c[C] does not say anything about that.

    But of course one thing is theory - something else is reality.

    Are there anybody in the audience that has a VAX with C and 5 minutes
    to spare?

    If so could you grab:

    https://raw.githubusercontent.com/brookewerner/Recursive-Descent-Parser/refs/heads/master/recursiveDescentParser.c

    and do a CC/LIST/MACH and count Macro-32 lines?

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Fri Apr 11 15:29:55 2025
    On 4/8/2025 1:27 PM, Simon Clubley wrote:
    On 2025-04-08, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 8:20 AM, Simon Clubley wrote:
    On 2025-04-06, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/4/2025 2:00 PM, Simon Clubley wrote:
    The problem with that analysis is what DCL does.

    It basically parses, validates, and executes commands it has been given. >>>>> That is something which can be implemented a lot more easily and concisely
    in a HLL with abstracted data structure capabilities (which includes >>>>> even C) than an assembly language with no such capabilities.

    It is not obvious to me that:

    (LOC/FP for Macro-32) / (LOC/FP for C)

    is a lot higher for a shell than for the average application - data
    structures are not anything special for shells.

    But maybe.

    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort)
    do you think it would take to implement it in Macro-32 compared to C ?

    Still not obvious to me that it would not follow normal LOC/FP
    ratios.

    Try implementing one, especially with a reasonably sized grammar, and
    you will very rapidly understand that it is not as simple as you seem
    to think it is. :-)

    I have not made any claim about it being simple.

    I have made a claim that the ratio for LOC/FP for Macro-32
    and LOC/FP for C for such a problem would not be significantly
    different from other application types.

    Effort is a different issue. If someone said:

    x1.6 LOC
    x16 hours for initial write of code
    x160 hours for maintenance of code

    then I would consider it likely.

    It has been hinted a few time that the DCL code is not easy to
    understand and modify.


    As I mentioned above, this is no longer about DCL. I picked the above standalone example, a LL(1) RD parser, because it's a really good example
    of the different scale of effort involved in writing it in Macro-32
    instead of in C.

    I have not made any claim about effort either.

    Are you sure that you have understood the topic??

    The classic assumptions are:

    LOC = a * FP
    effort = b * LOC**c = a * b * FP**c

    where a, b and c are language specific and c > 1.

    The topic is whether the first one is true (strictly speaking
    it does not need to be linear for my original claim to be
    true - it would be true for any LOC = a * f(FP) where f
    does not depend on language).

    Whether a[Macro-32] * b[Macro-32] * FP**c[Macro-32] is at a different
    scale than a[C] * b[C] * FP**c[C] does not say anything about that.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to arne@vajhoej.dk on Mon Apr 14 12:45:57 2025
    On 2025-04-11, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/8/2025 1:27 PM, Simon Clubley wrote:
    On 2025-04-08, Arne Vajh°j <arne@vajhoej.dk> wrote:
    On 4/8/2025 8:20 AM, Simon Clubley wrote:

    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort)
    do you think it would take to implement it in Macro-32 compared to C ?

    Still not obvious to me that it would not follow normal LOC/FP
    ratios.

    Try implementing one, especially with a reasonably sized grammar, and
    you will very rapidly understand that it is not as simple as you seem
    to think it is. :-)

    I have not made any claim about it being simple.

    I have made a claim that the ratio for LOC/FP for Macro-32
    and LOC/FP for C for such a problem would not be significantly
    different from other application types.


    That claim is clearly incorrect.

    The amount of Macro-32 code required for something higher-level such
    as a RD parser that can be concisely expressed in C compared to assembly language is clearly greater than, say a device driver, where the device
    access and programming sequence is the same regardless of whether it
    is done in C or assembly language.

    You cannot even optimise the register access sequence in a C device driver
    to reduce the amount of code, (and you even have to use volatile variables
    so the compiler doesn't do it for you behind your back.)

    Effort is a different issue. If someone said:

    x1.6 LOC
    x16 hours for initial write of code
    x160 hours for maintenance of code

    then I would consider it likely.

    It has been hinted a few time that the DCL code is not easy to
    understand and modify.


    As I mentioned above, this is no longer about DCL. I picked the above
    standalone example, a LL(1) RD parser, because it's a really good example
    of the different scale of effort involved in writing it in Macro-32
    instead of in C.

    I have not made any claim about effort either.

    Are you sure that you have understood the topic??


    Yes, but it's not clear if you have Arne.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Mon Apr 14 09:34:25 2025
    On 4/14/2025 8:45 AM, Simon Clubley wrote:
    On 2025-04-11, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 1:27 PM, Simon Clubley wrote:
    On 2025-04-08, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 8:20 AM, Simon Clubley wrote:

    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort)
    do you think it would take to implement it in Macro-32 compared to C ? >>>>
    Still not obvious to me that it would not follow normal LOC/FP
    ratios.

    Try implementing one, especially with a reasonably sized grammar, and
    you will very rapidly understand that it is not as simple as you seem
    to think it is. :-)

    I have not made any claim about it being simple.

    I have made a claim that the ratio for LOC/FP for Macro-32
    and LOC/FP for C for such a problem would not be significantly
    different from other application types.


    That claim is clearly incorrect.

    The amount of Macro-32 code required for something higher-level such
    as a RD parser that can be concisely expressed in C compared to assembly language is clearly greater than, say a device driver, where the device access and programming sequence is the same regardless of whether it
    is done in C or assembly language.

    You cannot even optimise the register access sequence in a C device driver
    to reduce the amount of code, (and you even have to use volatile variables
    so the compiler doesn't do it for you behind your back.)

    Effort is a different issue. If someone said:

    x1.6 LOC
    x16 hours for initial write of code
    x160 hours for maintenance of code

    then I would consider it likely.

    It has been hinted a few time that the DCL code is not easy to
    understand and modify.


    As I mentioned above, this is no longer about DCL. I picked the above
    standalone example, a LL(1) RD parser, because it's a really good example >>> of the different scale of effort involved in writing it in Macro-32
    instead of in C.

    I have not made any claim about effort either.

    Are you sure that you have understood the topic??


    Yes, but it's not clear if you have Arne.

    Simon.


    I'd argue that such comparisons can be misleading. As a simple example, specifying some arguments and invoking some routine. In either case, the arguments must be specified, then invoking the routine. Is each PUSH of an argument in assembler a separate instruction, or, just specification of an argument? One must still specify the arguments in either case.

    An example of a style I favor:

    Stat% = SYS$QIOW( , ! Event flag &
    ListenCh% By Value, ! VMS channel &
    IO$_SETCHAR By Value, ! Operation &
    IOSB::Stat%, ! I/O status block &
    , ! AST routine &
    , ! AST parameter &
    ListenOpt::Protocol%, ! P1 &
    , ! P2 &
    ServerItemLst::Len%, ! P3 - local socket na^
    BackLog% By Value, ! P4 - connection back^
    SockOptItemList::Len%, ! P5 - socket options &
    ) ! P6

    Ok, how many lines of code?

    :-)

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to Dave Froble on Mon Apr 14 17:06:15 2025
    On 2025-04-14, Dave Froble <davef@tsoft-inc.com> wrote:

    An example of a style I favor:

    Stat% = SYS$QIOW( , ! Event flag &
    ListenCh% By Value, ! VMS channel &
    IO$_SETCHAR By Value, ! Operation &
    IOSB::Stat%, ! I/O status block &
    , ! AST routine &
    , ! AST parameter &
    ListenOpt::Protocol%, ! P1 &
    , ! P2 &
    ServerItemLst::Len%, ! P3 - local socket na^
    BackLog% By Value, ! P4 - connection back^
    SockOptItemList::Len%, ! P5 - socket options &
    ) ! P6

    Ok, how many lines of code?


    Exactly one line of code.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dave Froble on Tue Apr 15 19:03:20 2025
    On 4/14/2025 9:34 AM, Dave Froble wrote:
    On 4/14/2025 8:45 AM, Simon Clubley wrote:
    On 2025-04-11, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 1:27 PM, Simon Clubley wrote:
    On 2025-04-08, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 8:20 AM, Simon Clubley wrote:
    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing
    of the results from the parser, how much code (and how much effort) >>>>>> do you think it would take to implement it in Macro-32 compared to >>>>>> C ?

    Still not obvious to me that it would not follow normal LOC/FP
    ratios.

    Try implementing one, especially with a reasonably sized grammar, and
    you will very rapidly understand that it is not as simple as you seem
    to think it is. :-)

    I have not made any claim about it being simple.

    I have made a claim that the ratio for LOC/FP for Macro-32
    and LOC/FP for C for such a problem would not be significantly
    different from other application types.


    That claim is clearly incorrect.

    I'd argue that such comparisons can be misleading.  As a simple example, specifying some arguments and invoking some routine.  In either case,
    the arguments must be specified, then invoking the routine.  Is each
    PUSH of an argument in assembler a separate instruction, or, just specification of an argument?  One must still specify the arguments in either case.

    An example of a style I favor:

            Stat% = SYS$QIOW(       ,                       !  Event flag &
                                    ListenCh% By Value,     !  VMS channel &
                                    IO$_SETCHAR By Value,   !  Operation &
                                    IOSB::Stat%,            !  I/O status block &
                                    ,                       !  AST routine &
                                    ,                       !  AST parameter &
                                    ListenOpt::Protocol%,   !  P1 &
                                    ,                       !  P2 &
                                    ServerItemLst::Len%,    !  P3 - local socket na^
                                    BackLog% By Value,      !  P4 - connection back^
                                    SockOptItemList::Len%,  !  P5 - socket options &
                                    )                       !  P6

    Ok, how many lines of code?

    The question about line counting has already been raised
    by Lawrence.

    On 4/11/2025 3:05 PM, Arne Vajhøj wrote:
    On 4/9/2025 5:10 PM, Lawrence D'Oliveiro wrote:
    On Wed, 9 Apr 2025 16:01:02 -0400, John Reagan wrote:
    I just looked at the largest MAR file in DCL. It has 10,000 lines but
    many are comments and many are macro definitions. Not actual VAX
    instructions.

    I would count macro definition bodies in full, and each macro
    expansion as
    one line. After all, macros are code written once and used multiple
    times,
    just like function calls as far as source code is concerned.

    That definitely makes sense.

    But there are still multiple possible counts:
    - lines in files
    - non-comment and non-blank lines in files
    - non-comment and non-blank and non-continued lines in files

    ; Macro-32 demo

    .title loc
    $SSDEF
    .psect $PDATA quad,pic,con,lcl,shr,noexe,nowrt
    fmt: .ascid "!SL !SL !SL"
    .psect $LOCAL quad,pic,con,lcl,noshr,noexe,wrt
    buf: .ascid " "
    .psect $CODE quad,pic,con,lcl,shr,exe,nowrt
    .entry loc,^m<>
    pushl #20
    pushl #22
    pushl #24
    pushab buf
    pushl #0
    pushab fmt
    calls #6, -
    G^LIB$SYS_FAO
    pushab buf
    calls #1, -
    G^LIB$PUT_OUTPUT
    movl #SS$_NORMAL, r0
    ret
    .end loc


    But then maybe you did not like my Macro-32.

    :-)

    There is no question that it is most accurate to only
    count the continued line as one in your example.

    But I suspect that a lot of LOC counters just count
    non-blank and non-comment.

    Anything else requires language knowledge.

    And while it for Fortran, Basic, Macro-32 may be relative
    simple, then for other languages it can become more tricky.

    Let us take 4 times Pascal:

    if a = 1 then b := 2 else b := 3;

    if a = 1 then
    b := 2
    else
    b := 3;

    if a = 1 then begin
    b := 2;
    end else begin
    b := 3;
    end;

    if a = 1 then
    begin
    b := 2;
    end
    else
    begin
    b := 3;
    end;

    How many lines? I would say that the most correct is 3 in
    all 4 cases. But coding the line counter to return that
    would require it to have Pascal knowledge.

    And what about the fluent style that are so modern?

    o = f.create();
    o.add(1);
    o.add(2);
    o.add(3);

    o = f.create()
    .add(1)
    .add(2)
    .add(3);

    o = f.create().add(1).add(2).add(3);

    1 1 1 or 4 1 1 or 4 4 1 or 4 4 4??

    So I think counters go for the simple approach and assume
    that for large code bases with many developers then total
    converge towards an "average" style.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Simon Clubley on Tue Apr 15 20:55:55 2025
    On 4/14/2025 1:06 PM, Simon Clubley wrote:
    On 2025-04-14, Dave Froble <davef@tsoft-inc.com> wrote:

    An example of a style I favor:

    Stat% = SYS$QIOW( , ! Event flag &
    ListenCh% By Value, ! VMS channel &
    IO$_SETCHAR By Value, ! Operation &
    IOSB::Stat%, ! I/O status block &
    , ! AST routine &
    , ! AST parameter & >> ListenOpt::Protocol%, ! P1 &
    , ! P2 &
    ServerItemLst::Len%, ! P3 - local socket na^
    BackLog% By Value, ! P4 - connection back^
    SockOptItemList::Len%, ! P5 - socket options &
    ) ! P6

    Ok, how many lines of code?


    Exactly one line of code.

    Simon.


    Indeed! However, some utilities used to count lines of code might count more than one. So, the entire exercise should be considered subject to errors.

    Perhaps looking at the size of object files, or executables, might be a better measure?

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to davef@tsoft-inc.com on Thu Apr 17 01:25:03 2025
    In article <vtmv72$ubo2$1@dont-email.me>,
    Dave Froble <davef@tsoft-inc.com> wrote:
    On 4/14/2025 1:06 PM, Simon Clubley wrote:
    On 2025-04-14, Dave Froble <davef@tsoft-inc.com> wrote:

    An example of a style I favor:

    Stat% = SYS$QIOW( , ! Event flag & >>> ListenCh% By Value, ! VMS channel & >>> IO$_SETCHAR By Value, ! Operation &
    IOSB::Stat%, ! I/O status block &
    , ! AST routine & >>> , ! AST parameter & >>> ListenOpt::Protocol%, ! P1 &
    , ! P2 &
    ServerItemLst::Len%, ! P3 - local socket na^
    BackLog% By Value, ! P4 - connection back^
    SockOptItemList::Len%, ! P5 - socket options &
    ) ! P6

    Ok, how many lines of code?


    Exactly one line of code.

    Indeed! However, some utilities used to count lines of code might count more >than one. So, the entire exercise should be considered subject to errors.

    There are utilities that are designed to count lines of code
    that account for that sort of thing. Whether those can handle
    VMS BASIC (let alone Macro-32) is, of course, a question, but
    most people trying to analyze large codebases are aware that
    they need special tools to do it.

    Perhaps looking at the size of object files, or executables, might be a better >measure?

    That's usually not a great measure, as lots of things can go
    into this that do not directly reflect code: consider unrolled
    loops that might artificially increase the size of program text,
    large but mostly static tables of data, etc.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Thu Apr 17 01:29:59 2025
    In article <67fee5b8$0$708$14726298@news.sunsite.dk>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/14/2025 9:34 AM, Dave Froble wrote:
    On 4/14/2025 8:45 AM, Simon Clubley wrote:
    On 2025-04-11, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 1:27 PM, Simon Clubley wrote:
    On 2025-04-08, Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/8/2025 8:20 AM, Simon Clubley wrote:
    It's a lot more complicated than that.

    For example, take a LL(1) RD parser. Even ignoring the processing >>>>>>> of the results from the parser, how much code (and how much effort) >>>>>>> do you think it would take to implement it in Macro-32 compared to >>>>>>> C ?

    Still not obvious to me that it would not follow normal LOC/FP
    ratios.

    Try implementing one, especially with a reasonably sized grammar, and >>>>> you will very rapidly understand that it is not as simple as you seem >>>>> to think it is. :-)

    I have not made any claim about it being simple.

    I have made a claim that the ratio for LOC/FP for Macro-32
    and LOC/FP for C for such a problem would not be significantly
    different from other application types.


    That claim is clearly incorrect.

    I'd argue that such comparisons can be misleading.  As a simple example,
    specifying some arguments and invoking some routine.  In either case,
    the arguments must be specified, then invoking the routine.  Is each
    PUSH of an argument in assembler a separate instruction, or, just
    specification of an argument?  One must still specify the arguments in
    either case.

    An example of a style I favor:

            Stat% = SYS$QIOW(       ,                       !  Event flag &
                                    ListenCh% By Value,     !  VMS channel &
                                    IO$_SETCHAR By Value,   !  Operation &
                                    IOSB::Stat%,            !  I/O status block &
                                    ,                       !  AST routine &
                                    ,                       !  AST parameter &
                                    ListenOpt::Protocol%,   !  P1 &
                                    ,                       !  P2 &
                                    ServerItemLst::Len%,    !  P3 - local socket na^
                                    BackLog% By Value,      !  P4 - connection back^
                                    SockOptItemList::Len%,  !  P5 - socket options &
                                    )                       !  P6

    Ok, how many lines of code?

    The question about line counting has already been raised
    by Lawrence.

    Lawrence is a troll, and most of us have plonked him.

    On 4/11/2025 3:05 PM, Arne Vajhøj wrote:
    On 4/9/2025 5:10 PM, Lawrence D'Oliveiro wrote:
    On Wed, 9 Apr 2025 16:01:02 -0400, John Reagan wrote:
    I just looked at the largest MAR file in DCL. It has 10,000 lines but >>> many are comments and many are macro definitions. Not actual VAX
    instructions.

    I would count macro definition bodies in full, and each macro
    expansion as
    one line. After all, macros are code written once and used multiple
    times,
    just like function calls as far as source code is concerned.

    That definitely makes sense.

    But there are still multiple possible counts:
    - lines in files
    - non-comment and non-blank lines in files
    - non-comment and non-blank and non-continued lines in files

    ; Macro-32 demo

    .title loc
    $SSDEF
    .psect $PDATA quad,pic,con,lcl,shr,noexe,nowrt
    fmt: .ascid "!SL !SL !SL"
    .psect $LOCAL quad,pic,con,lcl,noshr,noexe,wrt
    buf: .ascid " "
    .psect $CODE quad,pic,con,lcl,shr,exe,nowrt
    .entry loc,^m<>
    pushl #20
    pushl #22
    pushl #24
    pushab buf
    pushl #0
    pushab fmt
    calls #6, -
    G^LIB$SYS_FAO
    pushab buf
    calls #1, -
    G^LIB$PUT_OUTPUT
    movl #SS$_NORMAL, r0
    ret
    .end loc


    But then maybe you did not like my Macro-32.

    :-)

    There is no question that it is most accurate to only
    count the continued line as one in your example.

    But I suspect that a lot of LOC counters just count
    non-blank and non-comment.

    Anything else requires language knowledge.

    And while it for Fortran, Basic, Macro-32 may be relative
    simple, then for other languages it can become more tricky.

    Let us take 4 times Pascal:

    if a = 1 then b := 2 else b := 3;

    if a = 1 then
    b := 2
    else
    b := 3;

    if a = 1 then begin
    b := 2;
    end else begin
    b := 3;
    end;

    if a = 1 then
    begin
    b := 2;
    end
    else
    begin
    b := 3;
    end;

    How many lines? I would say that the most correct is 3 in
    all 4 cases. But coding the line counter to return that
    would require it to have Pascal knowledge.

    And what about the fluent style that are so modern?

    o = f.create();
    o.add(1);
    o.add(2);
    o.add(3);

    o = f.create()
    .add(1)
    .add(2)
    .add(3);

    o = f.create().add(1).add(2).add(3);

    1 1 1 or 4 1 1 or 4 4 1 or 4 4 4??

    So I think counters go for the simple approach and assume
    that for large code bases with many developers then total
    converge towards an "average" style.

    Most modern code-counting tools _are_ language aware. Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    Cf, https://github.com/XAMPPRocky/tokei?tab=readme-ov-file https://github.com/AlDanial/cloc?tab=readme-ov-file#recognized-languages- https://github.com/boyter/scc/blob/master/LANGUAGES.md

    etc.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dan Cross on Thu Apr 17 08:37:11 2025
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    In article <67fee5b8$0$708$14726298@news.sunsite.dk>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    There is no question that it is most accurate to only
    count the continued line as one in your example.

    But I suspect that a lot of LOC counters just count
    non-blank and non-comment.

    Anything else requires language knowledge.

    And while it for Fortran, Basic, Macro-32 may be relative
    simple, then for other languages it can become more tricky.

    Let us take 4 times Pascal:

    if a = 1 then b := 2 else b := 3;

    if a = 1 then
    b := 2
    else
    b := 3;

    if a = 1 then begin
    b := 2;
    end else begin
    b := 3;
    end;

    if a = 1 then
    begin
    b := 2;
    end
    else
    begin
    b := 3;
    end;

    How many lines? I would say that the most correct is 3 in
    all 4 cases. But coding the line counter to return that
    would require it to have Pascal knowledge.

    And what about the fluent style that are so modern?

    o = f.create();
    o.add(1);
    o.add(2);
    o.add(3);

    o = f.create()
    .add(1)
    .add(2)
    .add(3);

    o = f.create().add(1).add(2).add(3);

    1 1 1 or 4 1 1 or 4 4 1 or 4 4 4??

    So I think counters go for the simple approach and assume
    that for large code bases with many developers then total
    converge towards an "average" style.

    Most modern code-counting tools _are_ language aware. Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    Cf, https://github.com/XAMPPRocky/tokei?tab=readme-ov-file https://github.com/AlDanial/cloc?tab=readme-ov-file#recognized-languages- https://github.com/boyter/scc/blob/master/LANGUAGES.md

    etc.

    Their language awareness consist of recognizing comments.

    They are examples of some of those tools that simply count
    non-blank non-comment lines.

    (SCC also know some keywords but that is used for complexity
    calculation not for line counting)

    C:\Work>type demo.c
    // C demo

    #include <stdio.h>

    int main()
    {
    int a[] = {
    1,
    2,
    3
    };
    printf("%d %d %d\n",
    a[0],
    a[1],
    a[2]);
    return 0;
    }

    C:\Work>cloc-1.96 demo.c
    1 text file.
    1 unique file.
    0 files ignored.

    github.com/AlDanial/cloc v 1.96 T=0.01 s (67.5 files/s, 1147.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment
    code ------------------------------------------------------------------------------- C 1 2 1
    14 -------------------------------------------------------------------------------

    C:\Work>scc demo.c ───────────────────────────────────────────────────────────────────────────────
    Language Files Lines Blanks Comments Code
    Complexity ───────────────────────────────────────────────────────────────────────────────
    C 1 17 2 1 14
    0 ───────────────────────────────────────────────────────────────────────────────
    Total 1 17 2 1 14
    0 ───────────────────────────────────────────────────────────────────────────────
    Estimated Cost to Develop (organic) $305
    Estimated Schedule Effort (organic) 0.63 months
    Estimated People Required (organic) 0.04 ───────────────────────────────────────────────────────────────────────────────
    Processed 200 bytes, 0.000 megabytes (SI) ───────────────────────────────────────────────────────────────────────────────

    C:\Work>tokei-x86_64-pc-windows-msvc demo.c ===============================================================================
    Language Files Lines Code Comments
    Blanks ===============================================================================
    C 1 17 14 1
    2 ===============================================================================
    Total 1 17 14 1
    2 ===============================================================================

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to bill on Thu Apr 17 08:38:10 2025
    On 4/17/2025 8:21 AM, bill wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    Most modern code-counting tools _are_ language aware.  Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC?  :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?

    Given that they count non-blank non-comment lines then ...

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Dan Cross on Thu Apr 17 08:46:09 2025
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    In article <67fee5b8$0$708$14726298@news.sunsite.dk>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/14/2025 9:34 AM, Dave Froble wrote:
    I'd argue that such comparisons can be misleading.  As a simple example, >>> specifying some arguments and invoking some routine.  In either case,
    the arguments must be specified, then invoking the routine.  Is each
    PUSH of an argument in assembler a separate instruction, or, just
    specification of an argument?  One must still specify the arguments in
    either case.

    An example of a style I favor:

            Stat% = SYS$QIOW(       ,                       !  Event flag &
                                    ListenCh% By Value,     !  VMS channel &
                                    IO$_SETCHAR By Value,   !  Operation &
                                    IOSB::Stat%,            !  I/O status block &
                                    ,                       !  AST routine &
                                    ,                       !  AST parameter &
                                    ListenOpt::Protocol%,   !  P1 &
                                    ,                       !  P2 &
                                    ServerItemLst::Len%,    !  P3 - local socket na^
                                    BackLog% By Value,      !  P4 - connection back^
                                    SockOptItemList::Len%,  !  P5 - socket options &
                                    )                       !  P6

    Ok, how many lines of code?

    The question about line counting has already been raised
    by Lawrence.

    Lawrence is a troll, and most of us have plonked him.

    It is very fine if people simply don't read posts from
    and replies to whomever they don't consider worth reading.

    But if such people replies then it means that other people
    start to see duplicate questions/comments.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to bill on Thu Apr 17 12:50:02 2025
    On 2025-04-17, bill <bill.gunshannon@gmail.com> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:


    Most modern code-counting tools _are_ language aware. Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC? :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?


    3 lines of code.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Thu Apr 17 12:56:59 2025
    In article <vtqt6g$j0ll$2@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    In article <67fee5b8$0$708$14726298@news.sunsite.dk>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/14/2025 9:34 AM, Dave Froble wrote:
    I'd argue that such comparisons can be misleading.  As a simple example, >>>> specifying some arguments and invoking some routine.  In either case, >>>> the arguments must be specified, then invoking the routine.  Is each
    PUSH of an argument in assembler a separate instruction, or, just
    specification of an argument?  One must still specify the arguments in >>>> either case.

    An example of a style I favor:

            Stat% = SYS$QIOW(       ,                       !  Event flag &
                                    ListenCh% By Value,     !  VMS channel &
                                    IO$_SETCHAR By Value,   !  Operation &
                                    IOSB::Stat%,            !  I/O status block &
                                    ,                       !  AST routine &
                                    ,                       !  AST parameter &
                                    ListenOpt::Protocol%,   !  P1 &
                                    ,                       !  P2 &
                                    ServerItemLst::Len%,    !  P3 - local socket na^
                                    BackLog% By Value,      !  P4 - connection back^
                                    SockOptItemList::Len%,  !  P5 - socket options &
                                    )                       !  P6

    Ok, how many lines of code?

    The question about line counting has already been raised
    by Lawrence.

    Lawrence is a troll, and most of us have plonked him.

    It is very fine if people simply don't read posts from
    and replies to whomever they don't consider worth reading.

    But if such people replies then it means that other people
    start to see duplicate questions/comments.

    Rather, if people have plonked the guy and you choose to
    continue to interact with him, despite the fact that he is
    obviously acting in bad faith 95% of the time, then don't be
    surprised when people who aren't start to ask duplicate
    questions.

    Saying that he already asked the same question isn't
    particularly useful or relevant, since most of us are choosing
    not to feed the troll.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Simon Clubley on Thu Apr 17 08:56:17 2025
    On 4/17/2025 8:50 AM, Simon Clubley wrote:
    On 2025-04-17, bill <bill.gunshannon@gmail.com> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    Most modern code-counting tools _are_ language aware. Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC? :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?

    3 lines of code.

    Other replies cover what the tools actually does.

    If we discuss what is the "right" answer, then I would
    actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
    writeln(i)

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for i := 1 to 10 do
    begin
    writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
    printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
    printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
    printf("%d\n", i);
    }

    I would say 2 for all.

    And unless Basic next has some subtle functionality I am not
    aware of then I would say 2 for Basic as well.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to arne@vajhoej.dk on Thu Apr 17 12:58:26 2025
    In article <vtqslm$j0ll$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    In article <67fee5b8$0$708$14726298@news.sunsite.dk>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    There is no question that it is most accurate to only
    count the continued line as one in your example.

    But I suspect that a lot of LOC counters just count
    non-blank and non-comment.

    Anything else requires language knowledge.

    And while it for Fortran, Basic, Macro-32 may be relative
    simple, then for other languages it can become more tricky.

    Let us take 4 times Pascal:

    if a = 1 then b := 2 else b := 3;

    if a = 1 then
    b := 2
    else
    b := 3;

    if a = 1 then begin
    b := 2;
    end else begin
    b := 3;
    end;

    if a = 1 then
    begin
    b := 2;
    end
    else
    begin
    b := 3;
    end;

    How many lines? I would say that the most correct is 3 in
    all 4 cases. But coding the line counter to return that
    would require it to have Pascal knowledge.

    And what about the fluent style that are so modern?

    o = f.create();
    o.add(1);
    o.add(2);
    o.add(3);

    o = f.create()
    .add(1)
    .add(2)
    .add(3);

    o = f.create().add(1).add(2).add(3);

    1 1 1 or 4 1 1 or 4 4 1 or 4 4 4??

    So I think counters go for the simple approach and assume
    that for large code bases with many developers then total
    converge towards an "average" style.

    Most modern code-counting tools _are_ language aware. Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    Cf, https://github.com/XAMPPRocky/tokei?tab=readme-ov-file
    https://github.com/AlDanial/cloc?tab=readme-ov-file#recognized-languages-
    https://github.com/boyter/scc/blob/master/LANGUAGES.md

    etc.

    Their language awareness consist of recognizing comments.

    They are examples of some of those tools that simply count
    non-blank non-comment lines.

    (SCC also know some keywords but that is used for complexity
    calculation not for line counting)

    C:\Work>type demo.c
    // C demo

    #include <stdio.h>

    int main()
    {
    int a[] = {
    1,
    2,
    3
    };
    printf("%d %d %d\n",
    a[0],
    a[1],
    a[2]);
    return 0;
    }

    C:\Work>cloc-1.96 demo.c
    1 text file.
    1 unique file.
    0 files ignored.

    github.com/AlDanial/cloc v 1.96 T=0.01 s (67.5 files/s, 1147.0 lines/s) >-------------------------------------------------------------------------------
    Language files blank comment
    code
    -------------------------------------------------------------------------------
    C 1 2 1
    14
    -------------------------------------------------------------------------------

    C:\Work>scc demo.c >───────────────────────────────────────────────────────────────────────────────
    Language Files Lines Blanks Comments Code >Complexity >───────────────────────────────────────────────────────────────────────────────
    C 1 17 2 1 14
    0
    ───────────────────────────────────────────────────────────────────────────────
    Total 1 17 2 1 14
    0
    ───────────────────────────────────────────────────────────────────────────────
    Estimated Cost to Develop (organic) $305
    Estimated Schedule Effort (organic) 0.63 months
    Estimated People Required (organic) 0.04 >───────────────────────────────────────────────────────────────────────────────
    Processed 200 bytes, 0.000 megabytes (SI) >───────────────────────────────────────────────────────────────────────────────

    C:\Work>tokei-x86_64-pc-windows-msvc demo.c >===============================================================================
    Language Files Lines Code Comments
    Blanks >===============================================================================
    C 1 17 14 1
    2
    ===============================================================================
    Total 1 17 14 1
    2
    ===============================================================================

    You are aware that there are other tools, correct? These are
    just examples of a handful that have _some_ language awareness.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to bill on Thu Apr 17 10:07:34 2025
    On 4/17/2025 9:53 AM, bill wrote:
    On 4/17/2025 8:38 AM, Arne Vajhøj wrote:
    On 4/17/2025 8:21 AM, bill wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    Most modern code-counting tools _are_ language aware.  Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC?  :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?

    Given that they count non-blank non-comment lines then ...

    Yes, but which is it?
    Would it be three in one case and one in the other even though it is the exact same snippet?

    There are 3 and 1 non-blank non-comment lines in the two snippets.

    There are lies, damn lies and statistics.

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to bill on Thu Apr 17 13:04:41 2025
    On 4/17/2025 10:08 AM, bill wrote:
    On 4/17/2025 8:56 AM, Arne Vajhøj wrote:
    On 4/17/2025 8:50 AM, Simon Clubley wrote:
    On 2025-04-17, bill <bill.gunshannon@gmail.com> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    Most modern code-counting tools _are_ language aware.  Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC?  :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?

    3 lines of code.

    Other replies cover what the tools actually does.

    If we discuss what is the "right" answer, then I would
    actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
        writeln(i)

    for i := 1 to 10 do begin
        writeln(i)
    end;

    for i := 1 to 10 do
    begin
        writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
         printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
         printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
         printf("%d\n", i);
    }

    I would say 2 for all.

    And unless Basic next has some subtle functionality I am not
    aware of then I would say 2 for Basic as well.

    Interesting concept.  But the NEXT is a requirement of the
    language, does take time to type and if it is left out does
    require debugging to fix the problem.  So, if we are counting
    lines in some attempt to determine the cost of writing and
    maintaining the program it seems it would have to count as
    a line.

    Programming is more about thinking than about typing.

    The thinking part is about adding two constructs:
    - having i iterate from 1 to 10 => Basic FOR loop
    - printing a line with i => Basic PRINT statement

    The specific language syntax requirement and the developers
    formatting preference is not a thinking problem (unless
    the developer does not know the language well, but
    that is a more general problem).

    Which is why I consider it two.

    But all this goes back to my original point. Counting
    non-blank and non-comment lines is simple while trying to
    count "right" end up in having to make dozens maybe
    hundreds of decisions on how to count various constructs
    in various languages. Several posts back I brought up
    fluent style - not an easy one to count in my opinion.

    If we instead of those few lines you provided took an entire
    application and asked everybody here to count, then I would not
    be surprised if everybody came up with a different number.

    Which is why I have been talking about "right" answer and not
    right answer.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to bill on Thu Apr 17 18:05:52 2025
    On 2025-04-17, bill <bill.gunshannon@gmail.com> wrote:
    On 4/17/2025 1:48 PM, Simon Clubley wrote:

    Number of statements, not number of lines. That makes it 3 statements
    following my reasoning or 2 with Arne's reasoning. Either way, it's
    still the exact same number of statements in both cases.


    But I thought we were talking LoC - Lines of Code and the ability of
    a machine to make that determination in order to provide accurate
    statistical information.


    We are, but you are counting physical lines of code and I am counting
    the actual number of statements (which is more robust against different
    coding styles). I've just looked around for a write-up explaining the
    various approaches and the Wikipedia one looks pretty good:

    https://en.wikipedia.org/wiki/Source_lines_of_code

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Clubley@21:1/5 to bill on Thu Apr 17 17:48:10 2025
    On 2025-04-17, bill <bill.gunshannon@gmail.com> wrote:
    On 4/17/2025 8:38 AM, Arne Vajh°j wrote:
    On 4/17/2025 8:21 AM, bill wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    Most modern code-counting tools _are_ language aware.á Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC?á :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?

    Given that they count non-blank non-comment lines then ...


    Yes, but which is it?
    Would it be three in one case and one in the other even though it is the exact same snippet?


    Number of statements, not number of lines. That makes it 3 statements
    following my reasoning or 2 with Arne's reasoning. Either way, it's
    still the exact same number of statements in both cases.

    Simon.

    --
    Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
    Walking destinations on a map are further away than they appear.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to bill on Thu Apr 17 14:19:58 2025
    On 4/17/2025 1:58 PM, bill wrote:
    On 4/17/2025 1:04 PM, Arne Vajhøj wrote:
    On 4/17/2025 10:08 AM, bill wrote:
    On 4/17/2025 8:56 AM, Arne Vajhøj wrote:
    On 4/17/2025 8:50 AM, Simon Clubley wrote:
    On 2025-04-17, bill <bill.gunshannon@gmail.com> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    Most modern code-counting tools _are_ language aware.  Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    I wonder how they would handle BASIC?  :-)

    10 FOR X = 1 TO 10
    20 PRINT X
    30 NEXT X

    10 FOR X = 1 TO 10:PRINT X:NEXT X

    Is the snippet above one line of code or three?

    3 lines of code.

    Other replies cover what the tools actually does.

    If we discuss what is the "right" answer, then I would
    actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
        writeln(i)

    for i := 1 to 10 do begin
        writeln(i)
    end;

    for i := 1 to 10 do
    begin
        writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
         printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
         printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
         printf("%d\n", i);
    }

    I would say 2 for all.

    And unless Basic next has some subtle functionality I am not
    aware of then I would say 2 for Basic as well.

    Interesting concept.  But the NEXT is a requirement of the
    language, does take time to type and if it is left out does
    require debugging to fix the problem.  So, if we are counting
    lines in some attempt to determine the cost of writing and
    maintaining the program it seems it would have to count as
    a line.

    Programming is more about thinking than about typing.

    The thinking part is about adding two constructs:
    - having i iterate from 1 to 10 => Basic FOR loop
    - printing a line with i => Basic PRINT statement

    The specific language syntax requirement and the developers
    formatting preference is not a thinking problem (unless
    the developer does not know the language well, but
    that is a more general problem).

    Which is why I consider it two.

    But all this goes back to my original point. Counting
    non-blank and non-comment lines is simple while trying to
    count "right" end up in having to make dozens maybe
    hundreds of decisions on how to count various constructs
    in various languages. Several posts back I brought up
    fluent style - not an easy one to count in my opinion.

    If we instead of those few lines you provided took an entire
    application and asked everybody here to count, then I would not
    be surprised if everybody came up with a different number.

    Which is why I have been talking about "right" answer and not
    right answer.

    Once again, Arne, it seems in the end we actually agree.
    LoC is probably not easily extracted accurately.  And
    the actual value of that information is minimal if of any
    value at all.

    Counting non-blank and non-comment lines is easy. For
    a small piece of code it can vary greatly with coding
    style used. But if you look at large code bases written
    by many different developers then the coding style
    averages out.

    Let us say that you have files with one million
    file lines in. Counting non-blank and non-comment lines
    return 761951. Asking 100 people to count "right" number
    of lines give 100 different answers between 733887 and 745231.
    Counting non-blank and non-comment lines gives an objective
    result and is valid as a proxy for the code size.

    Is it useful to have such a value for estimation?
    Honestly I doubt it. It is not obvious to me that
    estimating LOC (or FP) is more accurate than
    estimating effort. I am not a big fan of
    COCOMO and the like.

    Is it useful to analyze what determines effort?
    I think so.

    Let us say that you have two approaches (could be
    programming language, development methodology or
    something else) and you based on historic data can
    estimate effort for the two as:

    effort = 2.5 * KLOC**1.2

    effort = 3.5 * KLOC**1.1

    Guess what - the optimal approach depend on the size
    of the project.

    All that really matters is:
    Does the program work?
    Does it do what it was intended to do?
    Does it do it without errors?

    There are some people that care about how much it cost
    to produce.

    :-)

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Lawrence D'Oliveiro on Thu Apr 17 19:41:55 2025
    On 4/17/2025 7:26 PM, Lawrence D'Oliveiro wrote:
    On Thu, 17 Apr 2025 08:56:17 -0400, Arne Vajhøj wrote:
    If we discuss what is the "right" answer, then I would actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
    writeln(i)

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
    printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
    printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
    printf("%d\n", i);
    }

    I would say 2 for all.

    How much difference would such distinctions make in real-world code,
    anyway? I suspect not much. Longer compound statements would dominate
    shorter ones in the line count.

    It is all based on averages.

    If person X write a tiny program and person Y write a the
    same tiny program, then the non-blank and non-comment line
    count may vary a lot.

    But if a team of a 100 developers write an application close to
    one million lines of code and another team of another 100 developers
    write the same application, then then the non-blank and
    non-comment line count will be relative close.

    Relative deviation decreases when the size increases.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Thu Apr 17 23:26:39 2025
    On Thu, 17 Apr 2025 08:56:17 -0400, Arne Vajhøj wrote:

    If we discuss what is the "right" answer, then I would actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
    writeln(i)

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
    printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
    printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
    printf("%d\n", i);
    }

    I would say 2 for all.

    How much difference would such distinctions make in real-world code,
    anyway? I suspect not much. Longer compound statements would dominate
    shorter ones in the line count.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dave Froble@21:1/5 to Dan Cross on Thu Apr 17 21:28:38 2025
    On 4/17/2025 8:58 AM, Dan Cross wrote:
    In article <vtqslm$j0ll$1@dont-email.me>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/16/2025 9:29 PM, Dan Cross wrote:
    In article <67fee5b8$0$708$14726298@news.sunsite.dk>,
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    There is no question that it is most accurate to only
    count the continued line as one in your example.

    But I suspect that a lot of LOC counters just count
    non-blank and non-comment.

    Anything else requires language knowledge.

    And while it for Fortran, Basic, Macro-32 may be relative
    simple, then for other languages it can become more tricky.

    Let us take 4 times Pascal:

    if a = 1 then b := 2 else b := 3;

    if a = 1 then
    b := 2
    else
    b := 3;

    if a = 1 then begin
    b := 2;
    end else begin
    b := 3;
    end;

    if a = 1 then
    begin
    b := 2;
    end
    else
    begin
    b := 3;
    end;

    How many lines? I would say that the most correct is 3 in
    all 4 cases. But coding the line counter to return that
    would require it to have Pascal knowledge.

    And what about the fluent style that are so modern?

    o = f.create();
    o.add(1);
    o.add(2);
    o.add(3);

    o = f.create()
    .add(1)
    .add(2)
    .add(3);

    o = f.create().add(1).add(2).add(3);

    1 1 1 or 4 1 1 or 4 4 1 or 4 4 4??

    So I think counters go for the simple approach and assume
    that for large code bases with many developers then total
    converge towards an "average" style.

    Most modern code-counting tools _are_ language aware. Whether
    they do a better or worse job for each given language may be a
    matter of debate, but most at least recognize different
    languages and have some knowledge of their semantics.

    Cf, https://github.com/XAMPPRocky/tokei?tab=readme-ov-file
    https://github.com/AlDanial/cloc?tab=readme-ov-file#recognized-languages- >>> https://github.com/boyter/scc/blob/master/LANGUAGES.md

    etc.

    Their language awareness consist of recognizing comments.

    They are examples of some of those tools that simply count
    non-blank non-comment lines.

    (SCC also know some keywords but that is used for complexity
    calculation not for line counting)

    C:\Work>type demo.c
    // C demo

    #include <stdio.h>

    int main()
    {
    int a[] = {
    1,
    2,
    3
    };
    printf("%d %d %d\n",
    a[0],
    a[1],
    a[2]);
    return 0;
    }

    C:\Work>cloc-1.96 demo.c
    1 text file.
    1 unique file.
    0 files ignored.

    github.com/AlDanial/cloc v 1.96 T=0.01 s (67.5 files/s, 1147.0 lines/s)
    -------------------------------------------------------------------------------
    Language files blank comment
    code
    -------------------------------------------------------------------------------
    C 1 2 1
    14
    -------------------------------------------------------------------------------

    C:\Work>scc demo.c
    ├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ
    ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓ
    Ç¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼
    Language Files Lines Blanks Comments Code
    Complexity
    ├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ
    ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓ
    Ç¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼
    C 1 17 2 1 14
    0
    ├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ
    ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓ
    Ç¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼
    Total 1 17 2 1 14
    0
    ├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ
    ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓ
    Ç¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼
    Estimated Cost to Develop (organic) $305
    Estimated Schedule Effort (organic) 0.63 months
    Estimated People Required (organic) 0.04
    ├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ
    ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓ
    Ç¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼
    Processed 200 bytes, 0.000 megabytes (SI)
    ├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ
    ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓ
    Ç¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼├óΓÇ¥Γé¼

    C:\Work>tokei-x86_64-pc-windows-msvc demo.c
    ===============================================================================
    Language Files Lines Code Comments
    Blanks
    ===============================================================================
    C 1 17 14 1
    2
    ===============================================================================
    Total 1 17 14 1
    2
    ===============================================================================

    You are aware that there are other tools, correct? These are
    just examples of a handful that have _some_ language awareness.

    - Dan C.


    I don't know compilers, but, I'd think a compiler might have the best idea of the statements, output code, and such. Perhaps they just aren't set up to tell us?

    --
    David Froble Tel: 724-529-0450
    Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
    DFE Ultralights, Inc.
    170 Grimplin Road
    Vanderbilt, PA 15486

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Cross@21:1/5 to davef@tsoft-inc.com on Fri Apr 18 03:01:42 2025
    In article <vts9sn$1sicb$1@dont-email.me>,
    Dave Froble <davef@tsoft-inc.com> wrote:
    [snip] These are
    just examples of a handful that have _some_ language awareness.

    I don't know compilers, but, I'd think a compiler might have the best idea of >the statements, output code, and such. Perhaps they just aren't set up to tell us?

    As with all things, "it depends." Consider C, for exmaples; IF
    a C compiler has a separate preprocessor, then presumably the
    compiler's frontend (which is in the best position to count,
    e.g., statements/expressions or otherwise compute the cyclotomic
    complexity of a program) would end up counting a lot of stuff
    from headers, since those have already been expanded. Multiply
    by number of files, and you may have something that's wildly
    off.

    Something that attempts to tokenize without expanding headers
    may fare better.

    - Dan C.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to All on Fri Apr 18 02:16:09 2025
    On Thu, 17 Apr 2025 19:41:55 -0400, Arne Vajhøj wrote:

    Relative deviation decreases when the size increases.

    Precisely my point.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to Lawrence D'Oliveiro on Sat Apr 19 13:25:25 2025
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
    On Thu, 17 Apr 2025 08:56:17 -0400, Arne Vajhøj wrote:

    If we discuss what is the "right" answer, then I would actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
    writeln(i)

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
    printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
    printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
    printf("%d\n", i);
    }

    I would say 2 for all.

    How much difference would such distinctions make in real-world code,
    anyway? I suspect not much. Longer compound statements would dominate
    shorter ones in the line count.

    I would expect about 20% difference. I saw a case when lead developer
    thought that code is "takes too much vertical space" and spent
    substantial effort to reformat it. IIRC on files having few thousends
    lines he made files shorter by about 10-15%. IIRC he changed code
    formatting, keeping comments mostly as-is. Also, he worked within
    mandated GNU brace placement rule, theoretically files could be
    shortened more by switching to more compact brace placement rule.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to arne@vajhoej.dk on Sat Apr 19 13:29:32 2025
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 4/17/2025 7:26 PM, Lawrence D'Oliveiro wrote:
    On Thu, 17 Apr 2025 08:56:17 -0400, Arne Vajhøj wrote:
    If we discuss what is the "right" answer, then I would actually say 2.

    for i := 1 to 10 do writeln(i)

    for i := 1 to 10 do
    writeln(i)

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for i := 1 to 10 do begin
    writeln(i)
    end;

    for(i = 1; i <= 10; i++) printf("%d\n", i);

    for(i = 1; i <= 10; i++)
    printf("%d\n", i);

    for(i = 1; i <= 10; i++) {
    printf("%d\n", i);
    }

    for(i = 1; i <= 10; i++)
    {
    printf("%d\n", i);
    }

    I would say 2 for all.

    How much difference would such distinctions make in real-world code,
    anyway? I suspect not much. Longer compound statements would dominate
    shorter ones in the line count.

    It is all based on averages.

    If person X write a tiny program and person Y write a the
    same tiny program, then the non-blank and non-comment line
    count may vary a lot.

    But if a team of a 100 developers write an application close to
    one million lines of code and another team of another 100 developers
    write the same application, then then the non-blank and
    non-comment line count will be relative close.

    I would expect 1M loc prohect to have rater strict code style rules.
    Individual differences between programmers should average out,
    but difference due to rule books will stay.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)