Deutsch English Français Italiano |
<vq0rb5$leho$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Which code style do you prefer the most? Date: Sun, 2 Mar 2025 06:46:11 +0100 Organization: A noiseless patient Spider Lines: 54 Message-ID: <vq0rb5$leho$1@dont-email.me> References: <vpkmq0$21php$1@dont-email.me> <vpl62m$250af$1@dont-email.me> <87frk10w51.fsf@onesoftnet.eu.org> <vpn8vs$2jmv1$1@dont-email.me> <vpn92i$86q$1@reader1.panix.com> <vpodnf$2q6ak$4@dont-email.me> <vpovd0$30d00$1@dont-email.me> <vpp011$30evb$1@dont-email.me> <vpp8ag$31ooi$1@dont-email.me> <vppaeq$323aa$1@dont-email.me> <vprpss$3ipmu$1@dont-email.me> <vprtlj$3jdn5$1@dont-email.me> <vprv75$3jmqu$1@dont-email.me> <vps2k5$3k722$1@dont-email.me> <vpt8ju$3r2n0$6@dont-email.me> <vpvcrm$9uaj$2@dont-email.me> <vpvqtt$ckvi$1@dont-email.me> <vq017i$dkuj$2@dont-email.me> <vq02is$duht$1@dont-email.me> <87o6ykw7f9.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 02 Mar 2025 06:46:14 +0100 (CET) Injection-Info: dont-email.me; posting-host="cc58bd9003c7ab6704d23eaebf50d89b"; logging-data="703032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zJ8feWnKkt9ds1voUlj+P" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:VmPjjf/UfBgRslJU7sAPXSqrf8Y= X-Enigmail-Draft-Status: N1110 In-Reply-To: <87o6ykw7f9.fsf@nosuchdomain.example.com> Bytes: 3538 On 02.03.2025 02:24, Keith Thompson wrote: > Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes: >> On 01.03.2025 23:20, Lawrence D'Oliveiro wrote: >>> On Sat, 1 Mar 2025 21:32:59 +0100, Janis Papanagnou wrote: >>>> My guess is that this form is just an informal syntax mimicking Perl's >>>> function parameter passing ... >>> >>> The idea of passing arguments by keyword predates Perl. >> >> That wouldn't surprise me. - I know it from Perl. - Which other >> (earlier) languages do you have in mind? - What's its origin? > > For example, it exists in Ada since 1983. [...] Back these day I had just a peek into Ada, never programmed with it. (It appears to me to have it supported very nicely.) > > The syntax is IMHO much nicer than using /*...*/ comments in C. I think the "C"-comments are horrible, especially for that purpose; I'd never do it that way. (Though, I understand the individual impetus to mimic unsupported features known from other languages.) > [...] > > Perl doesn't have keyword arguments as a language feature, but it can be > mimicked by passing hash or hash reference. Yes, that's how I perceived it. As a syntax pattern it's okay, IMO. At least it's functional and not only informal (as with comments). > > If I wanted to annotate arguments with parameter names, I'd probably use > aligned // comments with the name at the end of the line: > > confection = prepare_carefully_according_to_detailed_recipe( > flat, // pan > clarified_butter, // line_with > something_yummy, // filling > lotsa_pastry, // cover_with > 90 * MINUTES // bake_for > ); > > In practice, I seldom do so unless there's direct language support. Yep. And thanks for the hint to Ada. Janis