Date: Fri, 19 Jan 2018 12:16:37 -0800 From: Mark Millard <marklmi26-fbsd@yahoo.com> To: svn-src-head@freebsd.org Subject: Re: svn commit: r327354 - head/sys/vm Message-ID: <FD76F44C-3571-44C7-B979-7FE736F1C5AB@yahoo.com>
next in thread | raw e-mail | index | archive | help
Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net wrote on Fri Jan 19 18:39:03 UTC 2018 (quoting style(9)): > I think everyone glossed over: >=20 > Parts of a for loop may be left empty. Do not put declarations = inside > blocks unless the routine is unusually complicated. >=20 > Perhaps that second sentence should be extracted into a paragraph of = its own? > This does sound very much like what you said that you do in another = reply > in this thread. That is what I vaguely remember, now that I see it. I'm not so worried about code generation by compilers for the distinctions or the liveness tracking. I'm more worried about my own efforts during an analysis of the source code. When I have to analyze/study unfamiliar functions, the size of the range of source code where various variables might have been used can complicate things and increases the amount of analysis, including checking for a lack of interference by other code than turns out to be outside the "its live" scope. Closer approximation to minimizing the range of text helps with my doing a reliable analysis and lets a higher fraction of my time be spent on other aspects. In other words, it may take less for me to classify something as "unusually complicated" compared to some other folks. Overall I tend to like putting to use principles of locality when they readily apply. As for names repeated in nested scopes (the same name space), even absent a language rule disallowing such, I support being able to have all such examples reported as at least informational messages of some kind, possibly even selectable as "desired errors" in the sense of stopping compiles from generating object files despite not violating the language's criteria. =3D=3D=3D Mark Millard marklmi at yahoo.com ( markmi at dsl-only.net is going away in 2018-Feb, late)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FD76F44C-3571-44C7-B979-7FE736F1C5AB>