|
|
|
|
|
by rualca
1994 days ago
|
|
> The next step is to move all the UI definition into a single place, i using a single language that abstracts the underlying HTML/CSS/JS files & semantics. That sounds like a gigantic step backwards, and one which does not follow the example you've mentioned. The point of Sass was to introduce backwards-incompatible changes to CSS which adds nice human-readable syntactic sugar to CSS. Being turing-complete is besides the point and even it's regular use. In fact, I worked in projects where Sass was introduced just for it's support for nesting and partials alone. Mixing content and presentation in scripts misses any of the lessons from the last couple of decades. It feels like yet another example of the cargo cult of javascript, where people mindlessly argue that dragging everything into a script solves anything at all. |
|
Agreed - although this is not a JavaScript thing, but a react thing I think (maybe also Vue? No idea about that). E.g. Angular still has CSS (actually SASS) and HTML in separate dedicated files, and then a another separate file that contains the JavaScript (actually typescript) for the logic itself.
I do not see the benefit at all of putting all these things in one single file, apart from trivial tiny simple things (angular allows you to create single-file components for instance) or for making "To-Do with React" type tutorials look easy. Once you get more than 100-200 lines of code + html + CSS then it is time to separate the files.