Hello fellow programmers,
A professor here at Western Michigan University recently put the question
shown below (or one very similar) on the final exam for an introductory
computer course. Besides the fact that usage of only the BASIC
language was discussed to any degree of depth, what is your opinion to, and
what do you think the answer is to the question? Please expound. Send
E-Mail to: ········@gw.wmich.edu. Thanks in advance for the input!!
Question:
If you were writing a program, which of the following languages would
require to most lines?
A) COBOL
B) BASIC
C) FORTRAN
D) PASCAL
_____________________________
From: ········@gw.wmich.edu
Newsgroups: comp.lang.lisp,comp.lang.misc
Date: 23 Apr 92 19:44:01 EST
If you were writing a program, which of the following languages would
require to most lines?
A) COBOL
B) BASIC
C) FORTRAN
D) PASCAL
[Note: Before this gets into the whole Lines Of Code discussion that's
been hashed over a million times before, please remove comp.lang.lisp
unless it's specifically related to the Lisp language. (Why was c.l.l
even included if Lisp isn't one of the choices?)]
My answer would be:
1) What do you want the program to do?
2) What's a line of code?
3) Lines of code before, or after macroexpansion? :-)
-Carl
From: Geoff Lane
Subject: Re: TEST: Which lang. needs least lines?
Date:
Message-ID: <4875@mccuts.uts.mcc.ac.uk>
In article <·····················@gw.wmich.edu> ········@gw.wmich.edu writes:
>Question:
>If you were writing a program, which of the following languages would
>require to most lines?
>
> A) COBOL
> B) BASIC
> C) FORTRAN
> D) PASCAL
And just how long is a piece of string anyway?
This has to be one of the most open ended questions that has ever been asked
in any exam (except possibly for the old Chinese civil service exam that
consisted of only one question/request: Write everything you know.)
--
Geoff. Lane. Janet: ·······@uk.ac.mcc.uts
UTS Sys Admin, Manchester Computing Centre, Oxford Rd, Manchester, M13 9PL
Date: Thu, 23 Apr 1992 20:44 EDT
From: ········@gw.wmich.edu
Hello fellow programmers,
A professor here at Western Michigan University recently put the question
shown below (or one very similar) on the final exam for an introductory
computer course. Besides the fact that usage of only the BASIC
language was discussed to any degree of depth, what is your opinion to, and
what do you think the answer is to the question? Please expound. Send
E-Mail to: ········@gw.wmich.edu. Thanks in advance for the input!!
Question:
If you were writing a program, which of the following languages would
require to most lines?
This is potentially an asinine question. It depends entirely on the
problem that you are trying to solve. For example, TECO is a great
language for text editing applications, but I wouldn't use it for much
else. I don't see Snobol in the list -- what if I wanted to do hairy
string-based pattern manipulations?
If this professor's intent was that the question be answered with a
long essay that discusses the relative strengths and weaknesses of the
languages in particular problem domains, then this is actually a very
interesting question. In fact, it is one of the very basic questions
in the field of software engineering. Unfortunately, many people
always arrive at the same answer to the question "what language should
I use?" based on their current religion; a common answer these days is
"I use C or C++ for everything".
If the professor's intention was that you should choose one of A, B, C,
or D no matter what the circumstances, then he is being a bozo.
A) COBOL
B) BASIC
C) FORTRAN
D) PASCAL
Here's a counter-question. Given that I have used all of the above
languages (yes, even including Cobol) to do non-trivial tasks, why do
you think that I have concluded that of them, only Pascal is unsuitable
for anything? (Hint: it's not just because I am a contrarian.)
----
Just out of curiosity, how did you happen to choose Comp-Lang-Lisp when
Lisp is not one of the choices?
From: Peter da Silva
Subject: Re: TEST: Which lang. needs least lines?
Date:
Message-ID: <id.RA9P.NTA@ferranti.com>
In article <·····················@gw.wmich.edu> ········@gw.wmich.edu writes:
> If you were writing a program, which of the following languages would
> require to most lines?
> A) COBOL
> B) BASIC
> C) FORTRAN
> D) PASCAL
That depends on the program.
If I was generating a report, COBOL would be shortest.
If I was writing a self-listing program, BASIC would be shortest.
If I was doing complex numbers, FORTRAN would be shortest.
If I was working with lists, PASCAL would be shortest.
Alternatively, FORTRAN would require the most lines because it's the only one
that doesn't let you put multiple statements on a line.
--
Peter da Silva `-_-'
Programmer, network firefighter, thrillseeker 'U`
Ferranti International Controls Corporation Have you hugged
Sugar Land, TX 77487-5012 +1 713 274 5180 your wolf today?
·····@ferranti.com (Peter da Silva) writes:
> If I was generating a report, COBOL would be shortest.
> If I was writing a self-listing program, BASIC would be shortest.
> If I was doing complex numbers, FORTRAN would be shortest.
> If I was working with lists, PASCAL would be shortest.
^^^^^^
Are you serious? Any LISP dialect will be better, and I think Miranda
or any other lazy functional language with list comprehensions would
be even better. In some cases FP would win.
As for work on complex numbers (especially arrays of such) I think APL
would win hugely over FORTRAN. Unless you count "10 LIST" as a
self-listing BASIC program I can write shorter self-listing programs
in other languages. Here's one for Miranda:
self = x ++ show x where x = "self = x ++ show x where x = "
Torben Mogensen (·······@diku.dk)
From: Peter da Silva
Subject: Re: TEST: Which lang. needs least lines?
Date:
Message-ID: <id.V4BP.XLL@ferranti.com>
In article <······················@odin.diku.dk> ·······@diku.dk (Torben AEgidius Mogensen) writes:
> ·····@ferranti.com (Peter da Silva) writes:
> > If I was working with lists, PASCAL would be shortest.
> ^^^^^^
> Are you serious? Any LISP dialect will be better [...]
LISP wasn't one of the choices presented. Neither was APL. When you have
a multiple choice question to answer, you can't write in extra entries.
> Unless you count "10 LIST" as a self-listing BASIC program
I do.
--
Peter da Silva `-_-'
Programmer, network firefighter, thrillseeker 'U`
Ferranti International Controls Corporation Have you hugged
Sugar Land, TX 77487-5012 +1 713 274 5180 your wolf today?
In article <···········@ferranti.com>, ·····@ferranti.com (Peter da Silva) writes:
|> [...]
|> Alternatively, FORTRAN would require the most lines because it's the only one
|> that doesn't let you put multiple statements on a line.
Well, most Fortrans implementations do. Fortran 90 requires it.
--
J. Giles