by guitarbill · 8y ago · 0 comments
int someLongFunctionNameThatWillBeRefactored(int foo,
int bar);
someLongFunctionNameThatWillBeRefactored(longVariableName1,
longVariableName2);
and do int someLongFunctionNameThatWillBeRefactored(
int foo,
int bar);
someLongFunctionNameThatWillBeRefactored(
longVariableName1,
longVariableName2);
or even int someLongFunctionNameThatWillBeRefactored(
int foo, int bar);
Now tabs work fine. Spaces work fine. Elastic TabStops? Ironic that he mentions "Keep it simple, stupid!" and then overengineers this thing and every editor along the way.Anyway, this will probably not go down well since everybody has been trained to use the former style, and now people "prefer" it, out of what seems to me to be habit.
I do note that even your proposition doesn't really solve the problem of using Elastic TabStops, because if you imagine a comment spanning all three lines:
someLongFunctionCall(⇥ /* This function call */
⇥ longVariableName1,⇥ /* is really cool *
⇥ longVariableName2);⇥ /* and stuff */
You have an additional tab at the beginning of the two last lines which means (as far as I understand it) that the first comment line won't necessarily line up with the two others. Of course that showcases a potential issue with Elastic TabStops, not your particular coding style. /* This function call is really cool and stuff */
someLongFunctionNameThatWillBeRefactored(
longVariableName1,
longVariableName2);
So I sort of dismissed that use-case as a toy example. But yes, if you did that elastic tabstops would be useful... except the contents of the block comment doesn't get reflowed when the tabstop width changes. Which I'm sure we could do, but then we're getting into interesting territory w.r.t edge cases/usability for sure.Python is especially bad for me here, despite having used it everyday for years, because "if" and "while" and etc don't even have those closing markers.