4 ms·
> Let's see which one is leaner and more logical. Leaner, yeah, I'm certain a vanilla app will produce less KBs. What about dev time? I've been writing JS sinc
by pier25 4y ago
> Let's see which one is leaner and more logical.
Leaner, yeah, I'm certain a vanilla app will produce less KBs. What about dev time? I've been writing JS since the late 90s and I'd never use vanilla for anything other than trivial projects, quick tests, etc.
More logical, that is 100% subjective.
> Ok, where is the cut off? What is the smallest app, where React will shine? And I never get an answer.
Of course you won't. It's an impossible question. Could you say with certainty at which point it's better to use or not use a framework? (any framework with any language) You can't.
Once you're deep into the swamp you may realize you should have used a framework... but it's often not obvious a priori.
> which use 70 files (without dependencies!)
Honestly that's kinda ridiculous. You could build a calculator with a single file and a couple of components. This is not a problem with using React or any other of the modern libs but with that particular programmer.
- culi 4y ago> Honestly that's kinda ridiculous. You could build a calculator with a single file and a couple of components. This is not a problem with using React or any other of the modern libs but with that particular programmer. Yeah I'm trying to figure out how someone could possibly reach this number of files if you're not counting dependencies... If I make the app with the explicit goal of having as many files as possible I can think of: ~6 config files and dotfiles. Maybe make it TypeScript so we have a tsconfig.json as well and maybe we'll have a README and LICENSE as well for good measure In our public folder we'll have the index.html, a _redirects, robots.txt, a favicon, logos of different sizes, a manifest just in case, a sitemap because why not. Maybe a dozen files in total? But for the actual source files? index.tsx and App.tsx (I usually make these two the same file). Maybe we're keeping our jsx and css in different files so let's just double the number of components by 2. I'm struggling to think of why this might have to be more than one component but let's just say it's 2. So 4 files in total. Let's even say there's a custom hook for some reason so that gives us another file. That's like 7 files for the source code if we really stretch things out. Maybe you're one of those people that likes to have separate files for your routing or maybe you have some Layout.tsx business going on. Still can't imagine it stretching passed 10 files. I'm up to 28 with a ton of rounding up...