4 ms·
Unsurprisingly Stylus is one of the preprocessors that people want to avoid the most (beating less by 1% in user satisfaction). The preprocessor is very apathet
by jjcm 7y ago
Unsurprisingly Stylus is one of the preprocessors that people want to avoid the most (beating less by 1% in user satisfaction). The preprocessor is very apathetic to what style you use - it's the antithesis of a linter. Want to use a semicolon on this line, and not one on the next? Go for it! Not the best when you want to write something production worthy.
That said I've found it phenomenal for prototyping, simple codepen examples, and teaching css. I run the prototyping efforts at Atlassian and I've built a large amount of code prototyping tools focused on allowing designers to quickly build something out. The standard template I give to designers and students uses stylus by default because it allows them to make mistakes. People who are unfamiliar with code feel defeated when a small syntax error was the one thing holding them back - it makes them question their understanding of the intention of what they wrote, even when the meaning of what they had was correct. Stylus fixes so many of these things for me. I'd highly recommend doing any of your exploratory phases in Stylus.
- azangru 7y ago> Want to use a semicolon on this line, and not one on the next? Go for it! Not the best when you want to write something production worthy. What do semicolons - or braces, for that matter - have to do with production worthiness? Style inconsistencies do not cause bugs. Poor CSS rules do.
- jjcm 7y agoInconsistencies in the source file do not affect production worthiness in the moment, but they do affect maintainability down the line. If for instance your team wants to move to a new css preprocessor that's the next big thing in 10 years, a consistent style means you can programatically convert to the new syntax. Or maybe there's a tool that can help you write better css and detect where rules are unused -variable syntax will be sand in the gears for something like that. Mishmoshed syntax everywhere is a nightmare for programatic accessibility, though is excellent for simply trying things out. I love stylus, don't get me wrong. I use it for all my projects - even in production. But if I were the head engineer of say, google.com, I wouldn't allow it in production for a codebase that large due to the potential for problems down the line.
- bzalasky 7y agoI wouldn't pick Stylus for a new project, but you can use it with a linter like Stylint (https://github.com/SimenB/stylint https://github.com/SimenB/stylint) to enforce stricter conventions. Totally agree with you on the importance of consistency for maintainability (where it can be applied automatically with tools).
- seanwilson 7y agoClear and consistent code formatting guidelines (and ideally automatic formatting for this) is also great for reducing the thought required in formatting code you push while reducing noise and code formatting debates in code reviews.
- __oh_es 7y agoCan’t second this enough