Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Command Languages Versus Programming Languages Date: Fri, 22 Nov 2024 19:24:23 +0000 Lines: 38 Message-ID: <878qtbrs0o.fsf@doppelsaurus.mobileactivedefense.com> References: <87o727rwga.fsf@doppelsaurus.mobileactivedefense.com> <87h67zrtns.fsf@doppelsaurus.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain X-Trace: individual.net UEJH8Ea+V6CMLPjq5cNdbQr145npXssFUWBNmxRcUThEF7zVo= Cancel-Lock: sha1:a1+leBdFrlYTHnUZg1Ib2Lq3TZ4= sha1:KTTXPD4cOTzop+F8zu8yg9v8kOA= sha256:0XPdoWFHGOMuBJYm4trWjTcz39feQICJoHxWYN0F5P0= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Xref: csiph.com comp.unix.shell:25955 comp.unix.programmer:16593 comp.lang.misc:11083 cross@spitfire.i.gajendra.net (Dan Cross) writes: > Rainer Weikusat wrote: >>cross@spitfire.i.gajendra.net (Dan Cross) writes: >> >>[...] >> >>> In any event, this seems simpler than what you posted: >>> >>> #include >>> #include >>> #include >>> >>> int >>> main(int argc, char *argv[]) >>> { >>> if (argc != 2) { >>> fprintf(stderr, "Usage: matchd \n"); >>> return EXIT_FAILURE; >>> } >>> >>> for (const char *p = argv[1]; *p != '\0'; p++) >>> if ('0' <= *p && *p <= '9') >>> return EXIT_SUCCESS; >>> >>> return EXIT_FAILURE; >>> } >> >>It's not only 4 lines longer but in just about every individual aspect >>syntactically more complicated and more messy and functionally more >>clumsy. > > That's a lot of opinion, and not particularly well-founded > opinion at that, given that your code was incorrect to begin > with. That's not at all an opinion but an observation. My opinion on this is that this is either a poor man's attempt at winning an obfuscation context or - simpler - exemplary bad code.