Hacker News new | past | comments | ask | show | jobs | submit login

I usually partake of the "faster, lighter, less bloated" kool aid, but I have to say I don't really see the bloat in less/sass/stylus. They're fast, you can just ignore the features you don't need, and they're an `npm install` away.



Both Less and Sass implement features that I consider anti-patterns: nesting, @extend, etc. Sure, you can ignore them, but there's a lot of code in the tool to support that. The code needs maintenance and puts the barrier of entry higher for those wanting to contribute to it. Also, these are first-class features of the tool, they can't be disabled explicitly. So you'd need code reviews and other artifacts to make sure no programmer/designer ever tries to use them. Finally, why would you choose a tool that does 20x what you need, if there's an alternative that does just what you need? (As stated in other comments, I don't mean my solution is what will replace all preprocessors. PostCSS looks like a more modular approach and it allows you to effectively cherry-pick the features you need by means of plugins.)

Also, easy != simple. The fact that a tool is easy to install (after having installed another mega-dependency) shouldn't count as an advantage, in my opinion.


Nesting is the only reason I wish to use any of these preprocessors to be honest. I don't understand how people write plain css when things like less/sass exist. Writing and maintaining css selectors is a nightmare, but it's so simple and intuitive to just nest things inside parents.


I was going to say. How the heck is nesting an anti-pattern? It is SO useful for CSS. It should have been standard years ago. Variables are helpful too.


I don't really have a great reason for it - but my impression of working with code bases that require node (when the code is not node code) is that they quickly start bringing in a ridiculous amount of dependencies. I have no reason to think the 100s of dependencies I need to install is a necessary part of using less or sass. But in the projects that I've worked on, this has been the case. My impression of node as a community is a culture of bloat. So if I can get less involved, that is appealing to me. I'm speaking only from what I've seen, so I could certainly have a wrong impression.


It depends how you define bloat. If you define bloat strictly as number of dependencies, then sure, the Node ecosystem encourages more "bloat" than any other mainstream ecosystem.

But if you define bloat as "inclusion of features I'm not using," the Node ecosystem is lean and mean. If I only need 15 of the 250 functions that Lodash provides, I can include each of those 15 functions as an individual package. Yes, it increases disk space, because each dependency ships a package.json and a README and subdependencies aren't shared, but disk space is cheap. Decreasing the surface area of my library dependencies is worth it for my development happiness.

I think the criticism you want is "ultra-modular." You can make an argument that Node's proliferation of tiny, one-function packages is a maintenance burden and causes discoverability problems. Personally, I disagree: any effort to move towards a world where you never have to write a line of code someone else already has is well worth it. And from an end-user perspective, it shouldn't matter at all. `npm install` on average takes no longer than `gem install` for me, despite NPM pulling in orders of magnitude more packages.

(Python might be bloated; have you ever looked at the complete stdlib? There are some horrifying pieces: urllib2, email, turtle (?!).)

P.S. Check out libsass [0], a re-implementation of Sass in C with [probably] bindings to your favorite programming language.

[0]: https://github.com/sass/libsass


Then again, not being noticeably slower than gem install doesn't mean a lot.


I see what you mean. Generally node libraries are very small and do just one thing, which is why almost any project ends up having a large amount of (small) dependencies, or alternatively, like PostCSS, a whole bunch of plugins that have to be installed separately. It can look a bit silly at times, but then again, if that means each dependency is small, well-tested and of high quality, the number of dependencies is not necessarily indicative of bloat.

But to each his own, of course!


I dunno, our sass codebase eventually got to a point where we couldn't watch it with the ruby-based compiler. It would take something like a minute to recompile all the files when a globally included file was edited. We ended up writing our own wrapper around sassc (the c-based sass compiler.)


Agreed. This just comes off as the typical HN post, "I rewrote X program, using Y language, check it out!".

OP is learning Y language, wanted to make a project as a goal. Which is all well and good. But thinking its worthy to be shared seems like narcissism, especially when the description for the repository is, "Half-assed CSS preprocessor." And with 12 commits from the last 5 months, 3 of those being actual code, this isn't a serious project.

This is showing off homework. Though I suppose everyone seeks validation.


I don't think you read the top section of the README. It clearly says that I was first looking to write a simpler CSS preprocessor, and then came across M4.

I'm not saying the tool I wrote will replace all preprocessors. My point is: I wrote one with just enough features in around 30 LOC. Can we use that to start a discussion around the current state of the art regarding frontend tooling? Or software in general?


Things don't need to be "serious projects" to be cool and worth showing off.


Less takes forever to compile. It does.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: