allow line break at operators

Y

Yingjie Lan

Hi all,

When writing a long expresion, one usually would like to breakit into multiple lines. Currently, you may use a '\' to do so, but it looks a little awkward (more like machine-oriented thing). Therefore I start wondering why not allow line breaking at an operator, which is the standard way of breaking a long expression in publication? Here is an example:

#the old way

x = 1+2+3+4+\
      1+2+3+4

#the new way
x = 1+2+3+4+ #line continues as it is clearly unfinished

      1+2+3+4

Of course, the dot operator is also included, which may facilitate method chaining:

x = svg.append( 'circle' ).
      r(2).cx(1).xy(1).
      foreground('black').bkground('white')

Thoughts?

Yingjie
 
T

TheSaint

Yingjie said:
#the new way
x = 1+2+3+4+ #line continues as it is clearly unfinished

1+2+3+4
Genrally I prefer this way.
Of course, the dot operator is also included, which may facilitate method
chaining:

x = svg.append( 'circle' ).

Dot-ended is to tiny thing that might cause oversights. *If* it'll be used
as a secondary option I think it doesn't matter, otherwise *if* use as a
compulsory writing mode I'd say it is pretty mistake prone.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top