Deutsch English Français Italiano |
<v8peuh$fi30$5@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: Which newsgroup for json parsing? Date: Mon, 5 Aug 2024 02:55:13 -0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: <v8peuh$fi30$5@dont-email.me> References: <la1bjoF2anmU1@mid.individual.net> <v25c4k$1lhfu$1@dont-email.me> <lamvvbFb0g2U1@mid.individual.net> <v2aa1g$2q337$1@dont-email.me> <lbjaepFm1vbU1@mid.individual.net> <v32pr7$6p6f$1@dont-email.me> <lblq6uF2jrcU1@mid.individual.net> <20240528144509.00002562@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 05 Aug 2024 04:55:14 +0200 (CEST) Injection-Info: dont-email.me; posting-host="9703e35b9105f1543e11e482bcc52d23"; logging-data="510048"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/dO9A8ekMTs/JDWOnHIGPz" User-Agent: Pan/0.159 (Vovchansk; ) Cancel-Lock: sha1:uvbuuft806v2tw6lur9iasAr2MA= Bytes: 2083 On Tue, 28 May 2024 14:45:09 +0300, Michael S wrote: > And despite that you can very easily have too much (or too many?) > comments. My rule with comments is that they should explain *why* the code is doing what it’s doing, not simply repeat *what* the code is doing (which would be obvious to anyone who knows the language, APIs etc). E.g. const ssize_t allocation_step = 10; /* something convenient to reduce nr of tuple resize operations */ ... PyTuple_SET_ITEM(factorelt, 0, factorobj); PyTuple_SET_ITEM(factorelt, 1, powerobj); factorobj = powerobj = NULL; /* ownership has passed to factorelt */ if (nr_used == nr_allocated) { /* need more room in result tuple */ nr_allocated += allocation_step; if (_PyTuple_Resize(&tempresult, nr_allocated) != 0) break; } /*if*/