Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The "separate files" argument is a red herring. It is really about separate "mindsets" or "modes of thinking".

In effect, JavaScript logic tends to be procedural/imperative, while templates allow declarative semantics, and styles are nearly a 2.5D constraint language. "Separation of concerns" here means only having to think in a particular mode, rather than blending all of those modes of thought into a single eyespan.

Notably, Vue allows for single-file components, while preserving the familiar and intentionally designed separation of declarative (HTML), imperative (JavaScript), and aesthetic (CSS) code.



I don't see how separate files forces you to think differently. It might aid in that effort, but it likely doesn't force it.




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

Search: