🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.folklore.computers
Article #623706

Re: The birth of BASIC

#623706
From: Charles Richmond
Date: Mon, 04 Jun 2018 21:29
83 lines
6198 bytes
On 6/4/2018 2:05 PM, Joe Pfeiffer wrote:
> Charlie Gibbs <cgibbs@kltpzyxm.invalid> writes:
> 
>> On 2018-06-04, Gareth's Downstairs Computer
>> <headstone255.but.n...@yahoo.com> wrote:
>>
>>> On 04/06/2018 12:13, Bob Eager wrote:
>>>
>>>> On Mon, 04 Jun 2018 06:28:37 -0400, Peter Flass wrote:
>>>>
>>>>> Gareth's Downstairs Computer
>>>>> <headstone255.but.n...@yahoo.com> wrote:
>>>>>
>>>>>> On 03/06/2018 22:40, Peter Flass wrote:
>>>>>>>
>>>>>>> Some problems are easily solved by recursion that are significantly
>>>>>>> more complicated otherwise.
>>>>>>
>>>>>> I would be interested to know some examples, please?
>>>>>
>>>>> Depth-first search of a binary tree. Top-down parsing.
>>>>>
>>>>> Anything that requires retracing a path thru a data structure. Without
>>>>> recursion you have to maintain a table to keep track of where you've
>>>>> been and where you're going. Recursion just handles it naturally.
>>>>
>>>> +1
>>>
>>> In both cases a table is maintained, either through a manually
>>> programmed (trivial) table or through the auto-maintained call
>>> tree, either by a return stack, or, again, in the case of
>>> languages such as PL/M-86 that allocate local data statically,
>>> a human-maintained call structure.
>>>
>>> It seems to me that computer scientists wish for everything to
>>> be handed to them on a plate and baulk at the thought of
>>> minor diversions to provide some simple and trivial extra facitlites
>>> whereas real world programmers just get on with the job.
>>
>> I admit that there are probably cases where recursion is an
>> elegant solution to the problem.  However, in my experience
>> such cases are few and far between.  I've always considered
>> an obsession with recursion to be a hallmark of the CS weenie.
> 
> Speaking as retired faculty, we tend to be better at giving the students
> tools than at showing them where they're appropriate...
> 
> In the case of recursion, a problem a lot of new students have is
> understanding the difference between calling a function, and using a
> goto to get to the function and another goto to go back where you came
> from (I actually once had a student ask me what the difference was; he
> didn't have enough of a concept of abstraction, encapsulation, or
> organization for any answer in those terms to make the slightest
> sense).  Simply not telling them about labels and gotos in the first
> class helps, but there's always one who figures it out on his own and
> turns in a bowl of amazing spaghetti for his second or third assignment.
> 
> By the time they can get a simple recursive function to work, they have
> to have some sort of understanding of the notion of a function call
> being the same thing as turning a part of the problem over to somebody
> else to solve, and getting an answer back.  So it's really helpful in
> teaching functions.
> 
> Unfortunately, they also tend to come out of the experience with the
> idea that it's a great way to find the fibonacci sequence...
> 

If you use "dynamic programming" and cache the results of Fibonacci 
calls, it can be quite efficient.  When the Fibonacci function returns a 
result or sub-result (say the fifth Fibonacci number), the result is 
cached.  Before any call to the Fibonacci function, the program first 
checks to see if the result being sought...  already exists in the 
cache.  If the result is in the cache, use the result instead of calling 
the function.

This prevents repetitiously calling of the Fibonacci function for any 
one particular number.  For example, if you have already called the 
Fibonacci function for the tenth number...  the result will be in the 
cache.  You never again need to call the Fibonacci function for the 
tenth Fibonacci number.

-- 
numerist at aquaporin4 dot com
Technical Details
Message-ID: <pf4aud$e8p$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!f20-v6ni252itd.0!nntp.google.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
References: <874lisvjda.fsf@usenet.ankman.de> <fnammmFl3d5U4@mid.individual.net> <pep9gi$ssu$1@dont-email.me> <877enj7cme.fsf@usenet.ankman.de> <2111hdh5qbjo4o6ot3n9cuqfgk1pqdn8ck@4ax.com> <86ad7a17-fbd3-4056-98aa-91e1b38932ce@googlegroups.com> <1778842547.549582573.514335.peter_flass-yahoo.com@news.eternal-september.org> <-8-dnaDqYe0JXo_GnZ2dnUU78bmdnZ2d@giganews.com> <68034291-0143-4693-b8fe-755df7f87322@googlegroups.com> <PcqdnYC22cafaI7GnZ2dnUU78S3NnZ2d@giganews.com> <pf1188$q8f$3@dont-email.me> <358405364.549754306.026362.peter_flass-yahoo.com@news.eternal-september.org> <pf2rlv$kq0$1@dont-email.me> <1147666797.549800491.480189.peter_flass-yahoo.com@news.eternal-september.org> <fnkl60Fl3d5U10@mid.individual.net> <pf385t$mnk$1@dont-email.me> <pf3lbl02eqe@news4.newsguy.com> <1bfu22cqz1.fsf@pfeifferfamily.net>

Show Full Headers
Complete Article Headers
X-Received: by 2002:a6b:e506:: with SMTP id y6-v6mr8419284ioc.122.1528147726657;        Mon, 04 Jun 2018 14:28:46 -0700 (PDT)
X-BeenThere: alt.folklore.computers@googlegroups.com
Received: by 2002:a6b:5908:: with SMTP id n8-v6ls1112178iob.7.gmail; Mon, 04 Jun 2018 14:28:46 -0700 (PDT)
X-Received: by 2002:a6b:3c0e:: with SMTP id k14-v6mr1261559iob.105.1528147726030;        Mon, 04 Jun 2018 14:28:46 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!f20-v6ni252itd.0!nntp.google.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: Charles Richmond <nume...@aquaporin4.com>
Newsgroups: alt.folklore.computers
Subject: Re: The birth of BASIC
Date: Mon, 4 Jun 2018 16:29:01 -0500
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <pf4aud$e8p$1@dont-email.me>
References: <874lisvjda.fsf@usenet.ankman.de> <fnammmFl3d5U4@mid.individual.net> <pep9gi$ssu$1@dont-email.me> <877enj7cme.fsf@usenet.ankman.de> <2111hdh5qbjo4o6ot3n9cuqfgk1pqdn8ck@4ax.com> <86ad7a17-fbd3-4056-98aa-91e1b38932ce@googlegroups.com> <1778842547.549582573.514335.peter_flass-yahoo.com@news.eternal-september.org> <-8-dnaDqYe0JXo_GnZ2dnUU78bmdnZ2d@giganews.com> <68034291-0143-4693-b8fe-755df7f87322@googlegroups.com> <PcqdnYC22cafaI7GnZ2dnUU78S3NnZ2d@giganews.com> <pf1188$q8f$3@dont-email.me> <358405364.549754306.026362.peter_flass-yahoo.com@news.eternal-september.org> <pf2rlv$kq0$1@dont-email.me> <1147666797.549800491.480189.peter_flass-yahoo.com@news.eternal-september.org> <fnkl60Fl3d5U10@mid.individual.net> <pf385t$mnk$1@dont-email.me> <pf3lbl02eqe@news4.newsguy.com> <1bfu22cqz1.fsf@pfeifferfamily.net>
Reply-To: nume...@aquaporin4.com
Mime-Version: 1.0
Injection-Date: Mon, 4 Jun 2018 21:28:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="722fa8e7bfc367a582ae93ae7f4c2e14"; logging-data="14617"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX18I2r/zh2DXQRBcfscVsmJQ8uZI3x+34t0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
Cancel-Lock: sha1:ud7K9o9afXRN1yMyrfW+IyUChQc=
In-Reply-To: <1bfu22cqz1.fsf@pfeifferfamily.net>
Bytes: 5882
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit