Leaving the political things out, for good reason ...
IMHO, the number of lines of a program can only be a very rough first
guess on program complexity.
As others pointed out, the programming languages have very different
levels of information density,
for example a language which has powerful builtin functions or string
processing etc. needs much
less statements to do the same as another language which lacks such
features.
OTOH, even if we only talk about COBOL,
you can have very large programs with little complexity, say a program
which handles hundreds
or thousands of cases in a large switch statements (PL/1: SELECT, COBOL:
EVALUATE), where every case
consists of only, say, 20 statements. May add up to 20.000 lines but can
be very simple. On the contrary,
a program with only some hundred lines but very complex due to nested
looping, sorting, array processing,
complex data structures, many input files processed concurrently, you
name it ... hard to understand
(I have to maintain such programs in my everyday job, 30 years old, the
original author long gone, this is not much fun).
Anyway, if I get an unknown program on the table, I always check the
lines of code first,
and 200, 2000 or 20000 makes a big difference, of course.
HTH, kind regards
Bernd
Am 23.08.2021 um 00:37 schrieb Bill Johnson:
The number of lines of code is absolutely a good way to determine complexity.
...
Sent from Yahoo Mail for iPhone
On Sunday, August 22, 2021, 6:25 PM, Jeremy Nicoll
<jn.ls.mfrm...@letterboxes.org> wrote:
On Sun, 22 Aug 2021, at 19:49, Bill Johnson wrote:
You claim to know of a 1 line APL super complex program but when
asked to prove it can’t.
What I actually said was:
"A good case in point is that in APL a useful program can be written
in one line."
I /did not/ say that I knew of a (specific) 1 line super complex program,
just indicating that useful one-liners exist in APL.
I was merely suggesting that the number of lines in a program was not
a good way of estimating complexity.
The two examples I pointed you at on the APL wikipedia page are both
(I think) good examples of how a single line of code can (a) do a lot,
and (b) be hard to understand at a glance. Even if the individual APL
operators (all those greek characters) were represented by operator
names, or even function names (though they are not functions) I do not
think anyone could guess what those lines do.
There's a short line of code (only 17 characters!) that determines "all
the prime numbers up to R". Search (for the text in quotes) on the
quite long webpage at
https://computerhistory.org/blog/the-apl-programming-language-source-code/
to see it, with an explanation there of how that program works.
It's a whole lot less easy to understand than the equivalent written in, say
COBOL.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN