3 ms·
Hmm? You have not changed alignment, as all your lines of code start on the same integer indentation boundary. You just moved the operator to the beginning of t
by arghwhat 3y ago
Hmm? You have not changed alignment, as all your lines of code start on the same integer indentation boundary. You just moved the operator to the beginning of the line, and changed the bug between the two examples.
Either you misunderstood what we mean by alignment (single whitespace separating operators and operands are not alignment), or maybe you tried to indent the first string literal further to align the string literal start boundaries. I sincerely hope it wasn't the latter...
Putting the operator on the second line, at the same indentation level, is a perfectly fine, indentation- and alignment-agnostic stylistic choice, and has its uses.
- deathanatos 3y ago> You have not changed alignment I have changed the alignment of both ' ' and '+' characters between the two examples, from not being aligned to being aligned. > as all your lines of code start on the same integer indentation boundary Indentation is not the only thing "style" guides enforce. > and changed the bug between the two examples. The bug should be the same in both examples, though I do see I transposed a '+' into an '*'. That wasn't intentional; the two are supposed to form the same AST, but with purposeful alignment in the second making bugs in both far more visible. (You seem to be using "alignment of characters" to mean "alignment with indentation", which is more limiting than I would take "Aligning a character on one line with an arbitrary character on another line" to be.)