Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: filling area by color atack safety - worst memory size Date: Thu, 11 Apr 2024 22:43:10 -0700 Organization: A noiseless patient Spider Lines: 18 Message-ID: <86frvryw41.fsf@linuxsc.com> References: <86h6h3nvyz.fsf@linuxsc.com> <865xxiok09.fsf@linuxsc.com> <20240319131842.00002138@yahoo.com> <86o7b9ms7d.fsf@linuxsc.com> <20240320115416.00001ab5@yahoo.com> <86zfusltwp.fsf@linuxsc.com> <20240324193352.000062e9@yahoo.com> <86jzlrk0f6.fsf@linuxsc.com> <20240405173033.00006145@yahoo.com> <868r1k1uq8.fsf@linuxsc.com> <20240411152033.00007173@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 12 Apr 2024 07:43:10 +0200 (CEST) Injection-Info: dont-email.me; posting-host="c97bd3546ab5d223656b076d0b7c627f"; logging-data="2312771"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+B3wjmvcip5K2ZCs5UAYHLHJRU6U+jG28=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:KcVCo+pUW2Lq/lx+5aYFJnwbEuc= sha1:PpD0r62h0k8Q7GDhp5rFMXF5ufg= Bytes: 2031 Michael S writes: > On Wed, 10 Apr 2024 19:47:11 -0700 > Tim Rentsch wrote: > >> I have a strong rule against writing >> functions more than about 60 lines long. For the problem of >> writing an acceptably quick flood-fill algorithm, I think it would >> at the very least be a lot of work to write code to do that while >> still observing a limit on function length of even 100 lines, let >> alone 60. > > So why not break it down to smaller pieces ? The better algorithms I have done are long and also make liberal use of goto's. Maybe it isn't impossible to break one or more of these algorithms into smaller pieces, but C doesn't make it easy.