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

Jim Kinney jim.kinney at gmail.com
Thu May 25 14:51:05 EDT 2017


On Thu, 2017-05-25 at 13:37 -0400, leam hall wrote:
> 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".  :)

I save the swearing in comments until the debug phase.

> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
-- 
James P. Kinney III

Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain

http://heretothereideas.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170525/9b3de351/attachment.html>


More information about the Ale mailing list