Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Programming exercise/challenge
Date: Tue, 08 Dec 2020 23:26:40 -0800
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <86v9db5tjj.fsf@linuxsc.com>
References: <86wnxwkyol.fsf@linuxsc.com> <20201208015930.831f44395024675505845f37@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="5eb73538a536c16dceb299f9d9a18884"; logging-data="24239"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hXQ55yQEYZmGsRqBGCmbVqoVGlx8AxFc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:KOM1sESxrqqCWudotOfOa9FiXks= sha1:THwCuIDanbg6Dt3UZEeZtcxi3I8=
Xref: csiph.com comp.lang.c:157125
Anton Shepelev writes:
> Tim Rentsch:
>
>> Short problem statement: a C program to remove comments
>> from C source input.
>>
>> Specifics: Remove both /*...*/ and //... style comments.
>> Don't worry about trigraphs. Read from stdin, write to
>> stdout, and diagnostics (if any) go to stderr. If EOF is
>> seen inside a comment, do something sensible but it
>> doesn't matter what as long as it's sensible. Use no
>> 'goto' statements. Limit function bodies to no more than
>> 25 lines.
> [...]
> By the way, am I the only one to be hard-pressed to keep the
> functions within the 25-line limit, for botjh of my
> functions have exactly 25 lines.
I may have been overly optimistic in choosing 25 lines as the
limit here. I think anyone who makes an earnest effort to
stay away from longer functions may be said to satisfy the
spirit of the stated limit.