Liste des Groupes | Revenir à co vms |
On 4/17/2025 8:56 AM, Arne Vajhøj wrote:Programming is more about thinking than about typing.On 4/17/2025 8:50 AM, Simon Clubley wrote:Interesting concept. But the NEXT is a requirement of theOn 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. WhetherI wonder how they would handle BASIC? :-)
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.
>
>
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.
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.
Les messages affichés proviennent d'usenet.