My friend uses Typescript and Svelte to make web apps. I asked him how he chooses when something should be a Typescript file, versus when it should be a Svelte file; and he said, "in a svelte file it's code per instance of a component," whereas Typescript is "a regular file...global, one per application."
This makes sense to me logically, but I still can't comprehend when I should use which one. Is it possible to make the SAME exact web app using:
- ONLY Typescript files,
- ONLY Svelte files, and
- a mix of both?
If so, then why is option 3 superior? If not, which options are possible and which options aren't, and why? Better put, what (if anything) can Typescript files do that Svelte files can't, and vice versa?
Aucun commentaire:
Enregistrer un commentaire