4 ms·
> Re-using them is just a matter of copying them over to a new directory. And you lost me. Is it possible to write reusable JS/CSS/HTML? Yes but the overhead
by joshstrange 4y ago
> Re-using them is just a matter of copying them over to a new directory.
And you lost me.
Is it possible to write reusable JS/CSS/HTML? Yes but the overhead is very frustrating and you will quickly find yourself building a custom framework to manage everything. Best to start with a framework from the start if you plan on having rich interactions. The speed at which I can move in VueJS is nothing short of amazing and the amount of reuse I get is extremely high, all without me having to manually manage a bunch of files/includes. With 1 TS import I can get all the HTML/CSS/JS for a component and safely use it in another component. At a minimum that would take 3 http calls in "vanillaJS" to fetch the html/css/js that I would need to maintain and update myself. SFC's are a game changer. Sure the browser might eventually support what I need but by that point I have no doubt that VueJS (or similar) will have lept further ahead.
It's the same reason I jumped on the 6to5/babel train early, it let me write my code in ES6 but still deploy to older browsers without waiting on everyone to upgrade.
- silent_cal 4y agoOkay, so if I understand the main benefit is that you get to use a package manager and import statements? Also, don't you still need to manage tons of files, directories and config files in a React project? The React websites I've seen have way more complex directory structures than your average HTML/CSS/JS site.
- joshstrange 4y agoI understand that at the start a pure HTmL/CSS/JS site appears easier (and to a large degree it is) but as soon as your project grows to a certain complexity the frameworks make life a million times easier. Also, once you’ve seen what the frameworks can do (handling the annoying stuff for you) it’s hard to go back even for simpler sites. Especially since we rarely know if a “simple site” is going to grow and need more functionality in the future at which point it would make sense to switch to a framework. Why not just start with the framework? I’ve tried to go back to plain html/css/JS before and it’s a huge pain. I’m constantly thinking “ugh, this would be 2-3 lines of code in Vue but instead I have to manage all this stuff myself and it’s going to take 10’s of lines if not more. I’m not a fan of reinventing the wheel, also my skill set can be used everywhere if I write all my stuff in Vue instead of needing to context switch between smaller and larger projects (and again, small projects almost always grow so why not set them up for success?).