Re: [csswg-drafts] [css-syntax-3]: Voluntary semicolons (#5413)

Yup, afaik SCSS syntax is preferred by a strong majority of the Sass userbase. Less also sticks close to standard CSS syntax; Stylus aligns with Sass by using indents and no semicolons.

A noticeable trend here is that CSS preprocessors tend to either stay close to standard CSS syntax, merely adding some useful features, *or* they go far from CSS syntax and make indentation matter. If indentation is significant, then semicolons are just visual noise, and *should* be removed.

I *like* significant-whitespace languages; Python is my primary programming language at the moment, and I wish it had leaned slightly *more* into whitespace so I didn't have to use so many `:`s. But I think you have to commit to that. JS is in a worst-of-both-worlds place, where whitespace is *slightly* significant, allowing semicolons to be omitted *most* of the time, but you have to always be on watch for the handful of places where it'll screw you up (like putting something on a newline past a `return`, or starting a line with an array literal, etc). I really don't want CSS to follow along there.

Notably:

> I was always a fan of simplicity for users. If a parser can figure it out by itself without big impact, then let the parser do it.

Simplicity is a difficult sword to wield. Being able to write less characters can look simpler, but if it means users have to memorize more rules about how to *format* their values, it can backfire and actually make the feature more complex to use. "Properties are always separated by semicolons" (current CSS) is a simple rule; "properties are always indented one level in from their selector, and lines with further indentation are just continuing the previous line" (Sass/Stylus) is a simple rule. "Semicolons can be omitted, but be careful about how you linebreak when you spread a property over multiple lines, because whether or not it interprets you correctly depends on some heuristics" is not a simple rule.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5413#issuecomment-671536209 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 10 August 2020 19:11:18 UTC