From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113110 invoked by alias); 5 Dec 2019 20:21:24 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 113083 invoked by uid 89); 5 Dec 2019 20:21:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=card, screen X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Dec 2019 20:21:21 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id xB5KLGnm005672; Thu, 5 Dec 2019 14:21:17 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id xB5KLFMq005671; Thu, 5 Dec 2019 14:21:15 -0600 Date: Thu, 05 Dec 2019 20:21:00 -0000 From: Segher Boessenkool To: Jakub Jelinek Cc: Thomas Schwinge , gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, Tobias Burnus , Michael Meissner Subject: Re: [RFC] Characters per line: from punch card (80) to line printer (132) (was: [Patch][OpenMP/OpenACC/Fortran] Fix mapping of optional (present|absent) arguments) Message-ID: <20191205202115.GK3152@gate.crashing.org> References: <8be82276-81b1-817c-fcd2-51f24f5fe2d2@codesourcery.com> <20191205151515.GS10088@tucnak> <87lfrq6ahm.fsf@euler.schwinge.homeip.net> <20191205160412.GT10088@tucnak> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205160412.GT10088@tucnak> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00087.txt.bz2 On Thu, Dec 05, 2019 at 05:04:12PM +0100, Jakub Jelinek wrote: > On Thu, Dec 05, 2019 at 04:46:45PM +0100, Thomas Schwinge wrote: > > On 2019-12-05T16:15:15+0100, Jakub Jelinek wrote: > > > [...] much more indented though, but you could > > > use a temporary, like: > > > tree nullarg = null_pointer_node; > > > > I object to cluttering the code by introducing temporary variables/names > > just for the sake of a few characters of screen width. Even if located > > close lexically, when reading the following code you still have to trace > > back from the 'nullarg' usage to its 'null_pointer_node' definition in > > order to figure out what a 'nullarg' might be: > > > > > if (present) > > > ptr > > > = gfc_build_conditional_assign_expr (block, present, > > > ptr, nullarg); > > > > > Another option would be shorten the name of the function, say > > > s/conditional/cond/. > > > > Likewise I object to "crippling" identifier names like that just for the > > sake of a few characters of screen width. (Here of course, "cond", or > > the existing "expr" might be fine abbreviations, but my point is about > > the general case.) > > The point about temporaries is general, and I believe they actually make > code much more readable. Mostly about coding style like: > t = fold_build2_loc (loc, code, fold_build2_loc (loc, code2, > something1, > something2), > fold_build2_loc (loc, code3, something3, > something4)); > vs. > tree op1 = fold_build2_loc (loc, code2, something1, something2); > tree op2 = fold_build2_loc (loc, code3, something3, something4); > t = fold_build2_loc (loc, code, op1, op2); Yes. And the names, even if they do not say much, *do* say enough to help comprehending the code. They help structure it. > The above case is extreme in both being indented quite a lot (general rule > is to consider outlining something into a function then) I hope you mean actual factoring, not just outlining :-) If you pick good factors you can give them good names, too. Good names help reading the code. And on the other hand, when it is hard to come up with a good name for a piece of code, it is probably not chosen as a good factor anyway! > and using > way too long function names. If you look at the earlier suggestion where > the code is indented reasonably, using the temporary there makes the code more > readable and shorter. Yup. Segher