On Thu, May 2, 2013 at 7:26 AM, Terry Therneau <therneau@mayo.edu> wrote:

> I'll be the "anybody" to argue that
>      }  else {
> is an ugly kludge which you will never find in my source code.  Yes, it's
> necessary at the command line because the parser needs help in guessing
> when an expression is finished, but is only needed in that case.  Since I
> can hardly imagine using else at the command line (that many correct
> characters in a row exceeds my typing skill) it's not an issue for me.  I
> most certainly would not inflict this construction on my pupils when
> teaching a class, nor that any break of a long line has to be after "+" but
> not before, nor other crutches for the parser's sake.  Let them know about
> the special case of course, but don't sacrifice good coding style the
> deficiency.
>

Hi, Terry.

I don't think it is just "in the terminal" where I see the problem. If code
is in Emacs, and I send line by line to the *R* session, same problem
happens. I am afraid I'm being too dense.

It quite often happens that when I'm developing a function, I have to step
through line by line to see what's going on.  That' won't work for me if I
have "else" by itself at the beginning of a line.

As an Objective-C programmer, I very much think it looks nicer to write

if ( )
    {
       blah
    }
else
    {
       blah
    }

But in R, I can't step through that, so I don't write it that way.

The fact that you don't run into that makes me think that I'm preparing
functions incorrectly.  If you don't check your code line by line, what is
your work flow?

pj



> That said, I am completely ambivalent to the result of deparse.  Just
> throwing up an objection to the "purity" argument: things were beginning to
> sound a bit too bombastic :-).
>
> Terry T.
>
>
> On 05/02/2013 05:00 AM, r-devel-request@r-project.org wrote:
>
>>   I want "} else {".  Yihue wants "} else {".  And I have not heard
>> anybody
>> say they prefer the other way, unless you interpret Duncan's comment
>> "that's nonsense" as a blanket defense of the status quo. But I don't
>> think
>> he meant that.  This is a matter of style consistency and avoidance of new
>> R-user confusion and error.
>>
>


-- 
Paul E. Johnson
Professor, Political Science      Assoc. Director
1541 Lilac Lane, Room 504      Center for Research Methods
University of Kansas                 University of Kansas
http://pj.freefaculty.org               http://quant.ku.edu

	[[alternative HTML version deleted]]

