reproduce-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15706] Defining coding conventions


From: Mohammad Akhlaghi
Subject: [task #15706] Defining coding conventions
Date: Tue, 23 Jun 2020 11:43:23 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0

Update of task #15706 (project reproduce):

                 Summary: Why not use curly brackets for generic shell or bash
variables? => Defining coding conventions

    _______________________________________________________

Follow-up Comment #1:

This is a very good point, and following the discussion in task #15701, I
think it is appropriate to change the title of this task to "Defining coding
conventions". 

Besides being practical and helping the core Maneage branch be more unified,
having a "Coding Convention" section in 'README-hacking.md' can have great
educational value for a scientist who is not too familiar with writing code,
thus helping them alot. We can discuss the various conventions and what to
apply in this task.

Regarding the POSIX.1-2017 standard, as the year suggests it is relatively
recent and not fully reliable on older shells. Even today (the year 2020), I
have seen some people with shells that were written in 2006! I think probably
using double quotations is a more portable solution when we are relying on the
host's shell. But I don't have any special preference, the main point is
portability and where this convention would apply.

Generally, in Maneage we have three layers of Shell:

1) The host's shell. This is used to run the 'project' and
'reproduce/software/shell/configure.sh' scripts. We have to be the most
portable here and try our best to make no assumptions beyond a modern POSIX
standard (Maybe POSIX.1-2001? see the POSIX version history
<https://en.wikipedia.org/wiki/POSIX#Versions>).

2) A fixed version of modern Dash (the Debian minimalist POSIX-compatible
shell). This is used for building basic software (including a fixed version of
GNU Bash) in 'reproduce/software/make/basic.mk'.

3) A fixed version of modern GNU Bash. This is used in building high-level
software and the analysis phase. 

In the last two, we should be able to assume modern POSIX shell features.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/task/?15706>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]