Simple question about formatting code (in my case C++).
If I have a line of code, say:
SomeSortOfLongVariable = AnotherLongVariableThatTakesUpTonsOfHorizontalSpace + IDontActuallyUseVariablesThisLong
Should I split it like:
SomeSortOfLongVariable = AnotherLongVariableThatTakesUpTonsOfHorizontalSpace +
IDontActuallyUseVariablesThisLong
or:
SomeSortOfLongVariable = AnotherLongVariableThatTakesUpTonsOfHorizontalSpace
+ IDontActuallyUseVariablesThisLong
Another example:
foo = bar->baz;
// Should it be:
foo = bar->
baz;
//Or:
foo = bar
->baz;
Do people have a preference when it comes to this? Is it on a case-by-case basis? They both seem equally clear (or unclear) to me, so I was wondering if there are any standard ways of doing it.