Article View: alt.folklore.computers
Article #620756Re: Nostalgia
From: J. Clarke
Date: Tue, 27 Feb 2018 12:56
Date: Tue, 27 Feb 2018 12:56
70 lines
4423 bytes
4423 bytes
On 27 Feb 2018 12:15:31 GMT, Jorgen Grahn <grahn...@snipabacken.se> wrote: >On Tue, 2018-02-27, J Clarke wrote: >> On 26 Feb 2018 11:32:49 GMT, Jorgen Grahn <grahn...@snipabacken.se> >> wrote: >> >>>On Mon, 2018-02-26, J Clarke wrote: >>>> On 26 Feb 2018 06:43:24 GMT, Jorgen Grahn <grahn...@snipabacken.se> >>>> wrote: >>>> >>>>>On Mon, 2018-02-26, Dan Espen wrote: >... >>>>>> In the above case, the code still needs a comment >>>>>> but it should be something like: >>>>>> >>>>>> x=5; # Max supported fingers >>>>> >>>>>max_supported_fingers=5; # Nothing more to say >>>> >>>> But a lot more to type and that style tends to be hard to >>>> read--operators get lost in the visual noise. >>> >>>A lot more to type, but a lot less to remember. I agree that the >>>visual noise aspect is a problem, though. >>> >>>It depends on the context. For very local variables I tend to favor >>>one-letter names like i (for iteration), p, q (pointers), n and m >>>(quantities and sizes). >> >> I used to do that but realized that it's a bad habit for a variety of >> reasons. (Working in insurance and using APL has a lot to do with it >> I think). First, single letter variable names are hard to search on. > >But you don't usually search for names which have a scope limited to >(say) 5--10 lines. You're assuming that I know in advance that that is the case. > (Note the irony, which is typical for coding style discussions: I > had to defend using long, descriptive variable names, and now I'm > defending using one-letter ones. Consistency is overrated.) > >> So are variable names that form parts of common words. Second, once >> the habit develops, it's easy to run out of variable names and end up >> using "l" (lower case L), which is identical to "1" (one) in many >> fonts which can lead to very difficult to identify bugs. > >Hm, I've never seen that problem arise. It would indeed be a problem, >and a symptom of an underlying problem. Generally, I limit the number >of variables in scope at any given time, because code is harder to get >wrong when there are few moving parts. You seem to have learned programming in the era in which "scope" actually existed. When I learned, variables were usually global. >> Third, actuarial science has its share of accepted one letter >> values--"Q" for example is mortality. > >Ok. Well, I didn't mean to suggest my set of names are always >applicable everywhere. > >> Then there's the guy who used Z for whatever was returned by a >> function, _any_ function.. But somehow Z managed to escape and become >> globalized, so finding out what changed Z becomes a major undertaking. >> >>> I allow global names to be longer, but look >>>for ways to abbreviate them too. > >/Jorgen
Technical Details
Message-ID:
<p8la9dhdunvee3pcj9ra816vq5p0rp2k5g@4ax.com>Path:
mbox-mo1.pugleaf.net!n14ni3942wmi.0!nntp.google.com!goblin1!goblin2!goblin.stu.neva.ru!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post01.iad!fx37.iad.POSTED!not-for-mailReferences:
<2MWdnbgKEKQjRA_HnZ2dnUU78XHNnZ2d@giganews.com> <ffga3cFrifbU1@mid.individual.net> <ffgu5uF5nalU15@mid.individual.net> <1313349967.541300884.430961.peter_flass-yahoo.com@news.eternal-september.org> <p6vrnc$ue5$1@dont-email.me> <slrnp97b4c.eu5.grahn+nntp@frailea.sa.invalid> <0lq79dpae03ai000r0690fja58qcud4udu@4ax.com> <slrnp97s31.eu5.grahn+nntp@frailea.sa.invalid> <3ve99dtbi7vu0jda6ut1kcbemr6j4ta28v@4ax.com> <slrnp9aiv3.eu5.grahn+nntp@frailea.sa.invalid>Show Full Headers
Complete Article Headers
X-Received: by 10.223.163.221 with SMTP id m29mr1294679wrb.20.1519736213659; Tue, 27 Feb 2018 04:56:53 -0800 (PST) X-BeenThere: alt.folklore.computers@googlegroups.com Received: by 10.28.47.77 with SMTP id v74ls309667wmv.6.gmail; Tue, 27 Feb 2018 04:56:51 -0800 (PST) X-Received: by 10.28.247.5 with SMTP id v5mr1379019wmh.12.1519736211783; Tue, 27 Feb 2018 04:56:51 -0800 (PST) Path: mbox-mo1.pugleaf.net!n14ni3942wmi.0!nntp.google.com!goblin1!goblin2!goblin.stu.neva.ru!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post01.iad!fx37.iad.POSTED!not-for-mail From: J. Clarke <jclarke...@gmail.com> Newsgroups: alt.folklore.computers Subject: Re: Nostalgia Message-ID: <p8la9dhdunvee3pcj9ra816vq5p0rp2k5g@4ax.com> References: <2MWdnbgKEKQjRA_HnZ2dnUU78XHNnZ2d@giganews.com> <ffga3cFrifbU1@mid.individual.net> <ffgu5uF5nalU15@mid.individual.net> <1313349967.541300884.430961.peter_flass-yahoo.com@news.eternal-september.org> <p6vrnc$ue5$1@dont-email.me> <slrnp97b4c.eu5.grahn+nntp@frailea.sa.invalid> <0lq79dpae03ai000r0690fja58qcud4udu@4ax.com> <slrnp97s31.eu5.grahn+nntp@frailea.sa.invalid> <3ve99dtbi7vu0jda6ut1kcbemr6j4ta28v@4ax.com> <slrnp9aiv3.eu5.grahn+nntp@frailea.sa.invalid> User-Agent: ForteAgent/8.00.32.1272 MIME-Version: 1.0 Lines: 70 X-Complaints-To: ab...@newsdemon.com NNTP-Posting-Date: Tue, 27 Feb 2018 12:56:51 UTC Organization: http://www.NewsDemon.com Date: Tue, 27 Feb 2018 07:56:49 -0500 X-Received-Body-CRC: 3456903548 X-Received-Bytes: 3949 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit