Often I generate long lines of code such as the following...
shippedItems.AddRange(OrderItem.Fetch(market: this.MARKET, shipConfirmState: ORDERITEMSHIPCONFIRMSTATE.NONE, orderPlacedAfter: serverTime.AddDays(-7), orderPlacedBefore: serverTime.AddHours(-85)));
... which adds the results of a method call to an existing list.
Adding white space to this line could improve readability. At one point in time or another have rationalized almost every possible behavior between:
- Leave everything on a single line and let the editor wrap where it feels is best.
- Put even shippedItems.AddRange( on a line by itself.
While over time I feel that the clarity and readability of the code that I write has improved -- and lets hope for reasons other then white space -- I have never come to peace with how to break long lines.
I will up vote any answer that does NOT include as the solution:
- shorter variable names.
- disregarding named parameters (at least for this example).
- creation of variables only used once.