Forums

Spaces after tabs only after _ & implicit line continuation.

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Spaces after tabs only after _ & implicit line continuation.

Postby nevdelap » Sat Jul 03, 2010 10:21 pm

Hi Chuck,

I am a big fan of forcing people to lay their code out consistently, so I like the no mixing of tabs and spaces rules, but I am also a big fan of vertically aligning for readability sake, and I'm finding that I'm constantly having to use the _ line continuation just to be able to vertically align code in places where implicit line continuation already applies.

I am reading all the Discussions from day one of the forums forwards, so maybe you've explained since you said "_ is the one place you can mix tabs and spaces for indentation by using spaces *after* the tabs", but searching on _ can be difficult and I haven't found it.

Since Cobra has implicit line continuation it seems that if it allowed spaces after tabs when continuing the line implicitly as well as explicitly (two places) this slight ugliness and hassle could be eliminated.

What do you think?

string = Regex.replace(string,                   _
'(".*?)<emphasis>(.*?")', _
'', _
RegexOptions.Singleline)

This example is indented with spaces so the cobra tags align it visually correctly. Just imagine there are tabs=4 + 3 spaces to align. I even feel I need to align the underscores so that they don't look ugly.
call me Nev.
nevdelap
 
Posts: 61
Location: Buenos Aires

Re: Spaces after tabs only after _ & implicit line continuat

Postby Charles » Sun Jul 04, 2010 2:46 am

I don't see anything wrong with allowing spaces after tabs in a line continuation, whether explicit or implicit. I think that earlier statement about "the one place" in Feb 2008 was made before we had implicit continuation.

Will you fill out a ticket?

Here's a little test case where the last line causes a compilation error we'd rather not see:
class X

def foo(i as int, j as int) as int
return i + j

def main
trace .foo(1, 2)
trace .foo(1,
2)
trace .foo(1,
2)
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Spaces after tabs only after _ & implicit line continuat

Postby Charles » Sun Jul 04, 2010 3:01 am

Oh, and kudos on reading all the discussions! :-)
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Spaces after tabs only after _ & implicit line continuat

Postby nevdelap » Sun Jul 04, 2010 7:06 am

It's 210.

Thanks, and kudos to you for your faster responses/fast fixes!
call me Nev.
nevdelap
 
Posts: 61
Location: Buenos Aires

Re: Spaces after tabs only after _ & implicit line continuat

Postby hopscc » Mon Jul 05, 2010 3:14 am

This is a dup of ticket:112
and is partially addressed to the current indentation rules in the patch on ticket:116
which has been 19 months awaiting some sort of servicing.
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand


Return to Discussion

Who is online

Users browsing this forum: No registered users and 59 guests