Article View: alt.folklore.computers
Article #620754Re: Nostalgia
From: J. Clarke
Date: Tue, 27 Feb 2018 02:06
Date: Tue, 27 Feb 2018 02:06
74 lines
4421 bytes
4421 bytes
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: >>>> Peter Flass <peter...@yahoo.com> writes: >>>> >>>>> Bob Eager <news...@eager.cx> wrote: >>>>>> On Sun, 25 Feb 2018 17:29:16 +0000, Huge wrote: >>>>>> >>>>>>> On 2018-02-25, Andrew Swallow <am.sw...@btinternet.com> wrote: >>>>>>> >>>>>>> [15 lines snipped] >>>>>>> >>>>>>>> Reading Fortran and Assembler code tells you how, it does not tell you >>>>>>>> why. Comments are needed for that. >>>>>>> >>>>>>> *applause* >>>>>>> >>>>>>> Anyone who writes code like this should be shot; >>>>>>> >>>>>>> x=5; # Set x to 5 >>>>>> >>>>>> Strangely, I was doing generic feedback for an assignment about an hour >>>>>> ago. I repeated this statement, but not in Huge terms. (the external >>>>>> examiner will read it) >>>>> >>>>> When you start writing assembler everyone says you should put a comment on >>>>> every line, so you tend to do a lot of this until you get the idea. >>>> >>>> Putting a comment on every line makes it simpler to >>>> read the whole program as comments. With highlighting >>>> this is an easy way to quickly absorb a module. >>>> >>>> Of course the comments may not be 100% right. >>>> >>>> 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. 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. Third, actuarial science has its share of accepted one letter values--"Q" for example is mortality. 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:
<3ve99dtbi7vu0jda6ut1kcbemr6j4ta28v@4ax.com>Path:
mbox-mo1.pugleaf.net!m4ni18qte.0!nntp.google.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad!fx28.iad.POSTED!not-for-mailReferences:
<p67o2727bv@news1.newsguy.com> <p6967v$t5b$1@dont-email.me> <p6q0kb$t5$1@reader2.panix.com> <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>Show Full Headers
Complete Article Headers
X-Received: by 10.55.31.41 with SMTP id f41mr9763444qkf.51.1519697180387; Mon, 26 Feb 2018 18:06:20 -0800 (PST) X-BeenThere: alt.folklore.computers@googlegroups.com Received: by 10.55.77.8 with SMTP id a8ls35575qkb.3.gmail; Mon, 26 Feb 2018 18:06:18 -0800 (PST) X-Received: by 10.55.27.27 with SMTP id b27mr9476291qkb.53.1519697178604; Mon, 26 Feb 2018 18:06:18 -0800 (PST) Path: mbox-mo1.pugleaf.net!m4ni18qte.0!nntp.google.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!post02.iad!fx28.iad.POSTED!not-for-mail From: J. Clarke <jclarke...@gmail.com> Newsgroups: alt.folklore.computers Subject: Re: Nostalgia Message-ID: <3ve99dtbi7vu0jda6ut1kcbemr6j4ta28v@4ax.com> References: <p67o2727bv@news1.newsguy.com> <p6967v$t5b$1@dont-email.me> <p6q0kb$t5$1@reader2.panix.com> <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> User-Agent: ForteAgent/8.00.32.1272 MIME-Version: 1.0 Lines: 74 X-Complaints-To: ab...@newsdemon.com NNTP-Posting-Date: Tue, 27 Feb 2018 02:06:18 UTC Organization: http://www.NewsDemon.com Bytes: 3838 Date: Mon, 26 Feb 2018 21:06:16 -0500 X-Received-Bytes: 3900 X-Received-Body-CRC: 1414158872 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit