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 15:51

It was general question and code, that I posted was only example. Sure, that if there would be only bar() methods it should be written like mentioned. But what about more realistic example:

bar = object.perform_some_action_A().perform_some_action_B().perform_some_action_C()

Most people say, that there should be temporary variables to make line shorter and more readable. Well, maybe back in time, when low resolution CRT monitors were used it was OK, but now? I also don't agree, that this indicate, that code is wrongly designed, because, as I mentioned it actually increased density and readability.

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