Steve Litt via plug on 21 Aug 2020 14:24:03 -0700 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] best free FOSS progs 2020 |
On Thu, 20 Aug 2020 13:19:31 -0400 "K.S. Bhaskar via plug" <plug@lists.phillylinux.org> wrote: > On Thu, Aug 20, 2020 at 10:35 AM Ron Nascimento via plug < > plug@lists.phillylinux.org> wrote: > > > > > > > On 8/20/20 8:40 AM, jeff via plug wrote: > > > Sysadmin university: How to document code and scripts in Linux > > > https://www.redhat.com/sysadmin/document-code-scripts > > > > I never see bash scripts with any documentation, which leads me to > > believe that most bash scripts are written by non-programmers. > > > > > [KSB] I was going to ignore that last comment, but the “never” made > me take the bait! > https://gitlab.com/YottaDB/DB/YDB/-/blob/master/sr_unix/ydbinstall.sh > does have comments, though the comments are a bit sparse (the > original architect of the code base believed that developers should > read code, not comments, when maintaining software, and therefore > comments should document the developer's intent and the code should > document the realization of that intent). I think that script has just the right amount of comments. > > Any suggestions for improving the readability of that shell script are > welcome, and we will extend any good ideas to improve our other > scripting, although this is the most complex one we have. My readability suggestion would be to write it in Python, Perl, Ruby or Lua. /bin/sh is such an idiosyncratic language that, in my opinion, it's good only for programs less than 150 lines long, and even that's stretching it. But if you *have to* do it in /bin/sh, your program is more readable than most. SteveT Steve Litt Autumn 2020 featured book: Thriving in Tough Times http://www.troubleshooters.com/thrive ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug