Deutsch English Français Italiano |
<vtrcb8$122ge$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> Newsgroups: comp.os.vms Subject: Re: Clair Grant on VMS code base Date: Thu, 17 Apr 2025 13:04:41 -0400 Organization: A noiseless patient Spider Lines: 98 Message-ID: <vtrcb8$122ge$1@dont-email.me> References: <vsh5m5$3is6e$1@dont-email.me> <vtj025$18n4d$1@dont-email.me> <vtj2tu$1cfo8$1@dont-email.me> <67fee5b8$0$708$14726298@news.sunsite.dk> <vtplin$9us$2@reader1.panix.com> <m6ca1qF8fe6U1@mid.individual.net> <vtqtdq$lmr6$1@dont-email.me> <6800fa70$0$709$14726298@news.sunsite.dk> <m6cgatF8fe6U3@mid.individual.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 17 Apr 2025 19:04:41 +0200 (CEST) Injection-Info: dont-email.me; posting-host="93a9aa36a2f13cfcd6229df4a1054f91"; logging-data="1116686"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MODliomO5cMCBMKKYQ36DC2GZXO+y9ec=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:xm7cpRSwwCUS16s1+XkbUrWqJbs= Content-Language: en-US In-Reply-To: <m6cgatF8fe6U3@mid.individual.net> 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