L A Walsh wrote:
1) I see no benefit in the use of extra braces. It diminishes
> comprehension in this case.
really? to me the braces make the code easier to read, in the context of
the surrounding
function. they clarify the intention.
*if (THE VALUE IS OK) {*
*USE THE VALUE*
*
don fong wrote:
my patch (form (A)):
-report_error (_("%s: parameter null or not set"), name);
+{
+ if (check_nullness)
+ report_error (_("%s: parameter null or not set"), name);
+ else
+ report_error (_("%s: parameter is not set"), name);
+}
the new co
On Tue, Mar 06, 2018 at 05:15:36PM +0800, Clark Wang wrote:
> I don't know much about bash's source code so I cannot comment much. And
> this kind of arguments are quite opinion based which are not simple yes/no
> questions.
That's precisely what a "coding standard" is -- an opinion. If one
start
I don't know much about bash's source code so I cannot comment much. And
this kind of arguments are quite opinion based which are not simple yes/no
questions. And I believe one thing - the world is not perfect. :)
-clark
On Tue, Mar 6, 2018 at 8:26 AM, don fong wrote:
> Clark,
>
> Just took a l
Clark,
Just took a look at the code and it is an int:
declaring boolean quantities as int is a common practice in old C code.
indeed, all the boolean vars in this program seem to be declared as int.
at least, i don't see anything declared as bool.
declared type notwithstanding, in the context o
On Mon, Mar 5, 2018 at 9:13 AM, don fong wrote:
> Clark, thanks for your answer.
>
> I use ``if (flag)'' only when `flag' is a boolean.
>
>
> but in this case, it *is* a boolean, as i stated, and as can be seen in
> subst.c:
>
> +{
> + if (check_nullness)
> + report_error (_("%s
Clark, thanks for your answer.
I use ``if (flag)'' only when `flag' is a boolean.
but in this case, it *is* a boolean, as i stated, and as can be seen in
subst.c:
+{
+ if (check_nullness)
+ report_error (_("%s: parameter null or not set"), name);
+ else
+ report_
On 3/4/18 7:43 AM, Clark Wang wrote:
>> i submitted a patch with code in form (A). it was added to the code base
>> in form (B). was there a good reason for this mutation?
>>
>
> I believe the main reason is to keep consistent with existing code.
That, plus the final change was smaller and sim
On Sun, Mar 4, 2018 at 5:15 AM, don fong wrote:
> admittedly this is a very minor point, but i am curious. this has to do
> with coding standards for bash source.
>
> consider an if statement in C (or bash, for that matter). which is form is
> better?
>
> Form (A):
>
> if (flag)
> X