News for hackers. Stuff that matters.

Can Modern Syntax beat 1977?

Computer Recreations Creative Computing, Sept-Oct. 1977 D. Van Tassel

Syntax Messages

In the March-April 1977 issue I suggested you write a program to generate as many different syntax-error messages as possible with as few statements in the program as possible.

I received a few responses but first prize must go to Wayne M. Compton of Dhahran, Saudi Arabia. He sent me a COBOL program with just one statement which generated 570 error messages. The statement was just the program name paragraph:

PROGRAM-ID. ERRMSG.

The compiler then went wild and generated 570 error messages. He ran this program on a IBM 370 OS/VS system. If you have access to such a system you might try it.

( 3 comments | 3 points | on HN )
Re:Can Modern Syntax beat 1977? by greenbit on Monday December 18, 2023 @07:19AM (#38681520)
Have seen C++ go berserk and throw miles of errors when template implementation gets fumbled. Have also seen Java go stark raving mad over relatively minor infractions. Wish I had some examples handy.
Re:Can Modern Syntax beat 1977? by 082349872349872 on Monday December 18, 2023 @05:47AM (#38681044)
ERRMSG yields a list of all error messages, so the compiler wasn't "going wild", but behaving according to spec. A modern COBOL should beat that handily; no doubt they've added at least one or two new errors between 1977 and now.

source: https://www.ibm.com/support/pages/cobol-error-messages-are-n...

Re:Can Modern Syntax beat 1977? by InfamousRece on Monday December 18, 2023 @08:56AM (#38682518)