3 ms·
> But I've always felt that semicolons at the end of lines were just noise. I felt this way until I engaged in code with very horizontal coding styles. Semicol
by darby_nine 2y ago
> But I've always felt that semicolons at the end of lines were just noise.
I felt this way until I engaged in code with very horizontal coding styles. Semicolons make it extremely easy to visually break up sequential statements from expressions consuming multiple lines.
- gary_0 2y ago> code with very horizontal coding styles I'm not sure what you mean. Could you give an example?
- darby_nine 2y agoLiterally just code with long lines. You run into this particularly with monadic stuff like LINQ queries.
- gary_0 2y agoI grepped up some old LINQ code I wrote (sanitized as it's not open source): var list = obj.FindDataNear(a, b...).Select(i => obj.GetPosition(i)) .Where(...long lambda...) .MoreLINQ() .ToList(); So with the style I used, the semicolon is superfluous due to indentation. Are there styles where the semicolon is useful?
- darby_nine 2y ago> So with the style I used, the semicolon is superfluous due to indentation. Eh, indentation is also conflated with block delimitation. The semicolon is still useful to more strongly indicate statement delimitation at a glance. Yes, it's redundant, but so are many signifiers around us. The pity is that readability aspects aren't semantically relevant but are stored as if they are.