octave-maintainers
[Top][All Lists]
Advanced

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

Re: coding style


From: Rik
Subject: Re: coding style
Date: Fri, 16 Mar 2012 10:31:15 -0700

On 03/16/2012 09:58 AM, address@hidden wrote:
> Also, do we care about using a consistent coding style or not?  I
> thought we were (mostly) using the GNU coding conventions in all
> Octave code.
>
> jwe
We DO care about coding style.  Just because the compiler will accept a
file, doesn't mean we should.  One can overcome the challenges of
inconsistent coding style, but why bother?  We have documented some of this
in the Tips and Standards part of the manual but perhaps this should be
made more emphatic by making it a separate subsection with a title "Coding
Style Guide".

I've grown to find some of the conventions very useful, particularly the
use of a space between a function name and the parenthesis but the lack of
a space when doing indexing.  In other languages this isn't a problem
because there is often a different character used for indexing.  In Perl,
for example

f($a,$b,$c) => call function 'f' with arguments a,b,c
f[$a][$b][$c] => index multi-dimensional array

Since Octave uses the same character for both operations I find the cue of
cuddling the parenthesis or not to help a lot.

--Rik


reply via email to

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