Page 1 of 1

Spaces after tabs only after _ & implicit line continuation.

PostPosted: Sat Jul 03, 2010 10:21 pm
by nevdelap
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.

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

PostPosted: Sun Jul 04, 2010 2:46 am
by Charles
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)

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

PostPosted: Sun Jul 04, 2010 3:01 am
by Charles
Oh, and kudos on reading all the discussions! :-)

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

PostPosted: Sun Jul 04, 2010 7:06 am
by nevdelap
It's 210.

Thanks, and kudos to you for your faster responses/fast fixes!

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

PostPosted: Mon Jul 05, 2010 3:14 am
by hopscc
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.