Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

optimal width of line of code

Name: Anonymous 2011-05-07 15:11

Why people want to keep those tight limits of width of line of code? What is more readable?

bar = baz().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo().foo()

or:

[pre]a = baz().foo().foo().foo().foo().foo().foo()
b = a.foo().foo().foo().foo().foo().foo().foo()
bar = b.foo().foo().foo().foo().foo().foo()[/pre]

For me first option is much better, because i don't heave to remember, what a, b means.

Name: Anonymous 2011-05-07 18:08

Even Perl6 has unspace:

$foo.bar\
    .baz\
    .quux;


I wanted to spaz over the unsightly line-ending '\' convention but it never seems to come up.

Perl6's real line lengthening issue is chained method calls, but feeds take care of that:

@foo.grep:   /^a/    ==>
    .map:    *.chars ==>
    .reduce: *+*

Or:

@foo.grep:   /^a/
==> .map:    *.chars
==> .reduce: *+*

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List