[ale] Why define one function inside another (bash, awk)?

leam hall leamhall at gmail.com
Thu May 25 13:37:22 EDT 2017


On Thu, May 25, 2017 at 1:25 PM, DJ-Pfulio <DJPfulio at jdpfu.com> wrote:

> On 05/25/2017 01:08 PM, Joey Kelly wrote:
> >> In fact, my initial code is usually a page of comments describing what
> >> needs to happen, in order. Then each of those comments usually becomes a
> >> function. If a function gets too long, more comments are written and
> >> more sub-functions are made, about 5-20 lines at a time.
> >
> > A lot of my code is exactly like that... document first, code later.
>
> For non-trivial programs, each comment might be an entire class, if
> doing OO.
>
> I actually do it to help remember where I left off the next day or the
> following week after being interrupted.  Sleeping helps wipe memories.
> This isn't something new caused by age.  When I coded in my 20s, it was
> good to have reminders too. ;)
>


My comments tend to be something like "this broke stuff" and "get rid of
this". I try to avoid things that would be embarassing after a "git push".
 :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170525/a879d69b/attachment.html>


More information about the Ale mailing list