Printing source code.

ashrobo

Regular
Joined
Apr 6, 2003
Messages
70
Location
Black Hole
i wonder if anyone (except those from my school) bothers to break up a line of code should it be longer than the width of the page, i.e. taking up two lines for a line of continuous code. i've just printed out a piece of code and saw that VS uses a arrow to indicate continuous text. is it more readable with that or breaking up the codes with _ ?

-ashrobo
 
It's always good to continue long lines of code down to the next line so it's easy to read while you code.
 
sometimes, it's easy to read the code while coding, but when printing on paper, it wouldn't be that easy to read (when the line of code exceeds a line on the paper).
 
There aren't too many cases where long lines of code are warranted. In fact, they usually indicate poorly written code, that lacks checks of return values or encapsulates multiple calls in catch-all error handlers. In most cases don't worry about breaking up the line-- worry about breaking up the logic.
 
Visual Basic:
Private Sub grdOrders_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles grdOrders.MouseUp
for instance is longer than the width of an A4 page.
In most cases don't worry about breaking up the line-- worry about breaking up the logic.
hmm, i guess you are right Derek.

cheers! ;)
 
Back
Top