Re: [R] R is GNU S, not C.... [was "how to get or store ....."]

From: Jan T. Kim <jtk_at_cmp.uea.ac.uk>
Date: Wed 07 Dec 2005 - 02:23:55 EST

On Tue, Dec 06, 2005 at 03:16:17PM +0100, vincent@7d4.com wrote:
> Martin Maechler a ?crit :
>
> > please, please, these trailing ";" are *so* ugly.
> > This is GNU S, not C (or matlab) !
> >
> > but I'll be happy already if you could
> > drop these ugly empty statements at the end of your lines...
>
> May I disagree ?
> I find missing ";" at end of lines *so* ugly.
> Ugly/not ugly depends on our observer's eyes.
> From my programmer point of view, I prefer to mark
> clearly the end of the lines.
> In many languages, it's safer to do it this way,
> and I thank the R developers to permit it.

I agree with this view -- I prefer an explicit statement terminator to a whitespace which terminates if termination is possible, too.

> (in my opinion, it should even be mandatory).
> (By the way, marking the end of lines with a unique symbol
> makes also the job easier for the following treatment.)
> And yes, I'm also a C programmer ;-)
>
> > {and I have another chain of argments why "<-" is so more
> > expressive than "="
>
> Why "<-" seems better than "=" is also quite mysterious for me.
> There was a discussion about this point recently I think.
> I believe in 99% of cases it's more for historical reason
> (and perhaps also for some "snob" reasons).
>
> I am not at all a 20 years experienced R programmer, but I have
> written several hundreds of R lines those 6 last months,
> and until today didn't get any problem using "=" instead of "<-".

As far as plain, stand-alone assignment statements are concerned, "=" and "<-" are equivalent.

Given the diversity of coding styles that are permitted by R, consistently using one style is, in practice, perhaps more relevant than finding out what the "best" style is.

There is a draft R Coding Convention available at

    http://www.maths.lth.se/help/R/RCC/

which may be useful for finding a style that is good because it is widely used and therefore familiar to a large number of readers.

Best regards, Jan

-- 
 +- Jan T. Kim -------------------------------------------------------+
 |             email: jtk@cmp.uea.ac.uk                               |
 |             WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed Dec 07 03:26:17 2005

This archive was generated by hypermail 2.1.8 : Wed 07 Dec 2005 - 04:31:30 EST