ReactJS vs Svelte #shorts

preview_player
Показать описание


👉 Checkout codedamn on social:

If you found the video valuable, please leave a like and subscribe ❤️ It helps the channel grow and helps me pumping out more such content.

👋 About Me:
Hey! I'm Mehul Mohan, a CSE'21 graduate from BITS Pilani, Goa. I started coding early in life, at the age of 13 when I created my first blog on Blogger. I am listed in Google, Microsoft, Sony, eSet, etc. Hall of Fame for reporting vulnerabilities in their systems.

🍎 I am Apple's WWDC'19 Scholar - visited San Francisco and attended WWDC.

🚀 Currently working on my own startup - codedamn.

Connect with me:

🏷 Video Tags:
ReactJS vs Svelte #shorts
React 18 full course
React free tutorials
React course
React beginner tutorial
react tutorial
react js
learn react
react javascript
react tutorial 2021
react js tutorial
react tutorial for beginners
svelte tutorial for beginners
svelte for beginners
svelte tutorial 2021

Рекомендации по теме
Комментарии
Автор

the cons you said are actually advantages

lone-warrior-
Автор

"It feels like magic"

- Bro that discovered compilers, 2023

emilianobregains
Автор

How does it feel like magic? It seems very idiomatic. You change the value of the variable, it's reflected in the document.

cryptidv
Автор

If you don't know js but know react, you will find svelte magic.

budhinanda
Автор

Mmmhh its actually the opposite, svelte its the one that feels more like doing regular web development, where you have the 3 main tags, script, your html and css. Yes you need to learn svelte specific syntax. But most of it its related to your html and it does so naturally that sometimes you cannot tell if the thing youre writing its something svelte specific or just pure html.

HeyDan
Автор

My brother in Christ, all boilerplate is magic. It's a thing i have to put in... just because. Without it nothing works. Functions that return html within <> </> is magic to me. Virtual DOM is magic. Svelte to me is the closest to pure, with nothing more than an extension and simplification of jQuery as syntactic sugar.

LeFlamel
Автор

You worked with React but Svelte is the one being magical???? It's literally the closest to standard HTML and CSS compared to the other frameworks you mentioned. 🤦‍♂️

gnt_
Автор

The cons are not really cons... It's more like Svelte is not React so that's a con.

nyashachiroro
Автор

I'd argue it feels no more magical than what React or Vue have, except that as you mentioned is more beginner friendly (e.g. I can get to the part where I make my project much faster than React and I don't have to think so dang hard to get there).

With React, I use useState to get a tuple of the state value and a setter and then use this in JSX to create a DOM. All of this feels magical too until you learn more of the internals, and you're writing tons of "non-standard" JavaScript and non-HTML to get it done. The React library is doing tons of heavy lifting for me, so I get to write this "non-standard" JavaScript, to magically keep state and the DOM up to date. Similar to jQuery before it, save jQuery is less magical than React. Then there's JSX, that is just flat out another markup language which needs a transpiler (basically a compiler at this point).

With Svelte, I write pretty much standard JavaScript with magic performed via a compiler. The reactive "$:" labels and "$" prefix are maybe the most magical parts, but is it really more so than trusting that useState will just take care of things for us? Then there's the markup which is much closer to HTML than JSX, so much so that I could just write standard HTML, styles included, and it will work, which is not true of JSX. The rest of it is standard templating stuff we've largely seen before. Again, much like I'm trusting React and Babel to magically make my code reactive, I'm trusting Svelte and it's compiler to magically make my code reactive.

Writing Svelte, after a few hours of learning, I feel like I think and write in JavaScript with Svelte specifics sprinkled on top. Writing React I feel like I'm writing and thinking in pretty much only React with some JavaScript I can use elsewhere sprinkled on top.

I like React, but have quickly come to prefer Svelte, even after just doing 1 project in it.

baka_baca
Автор

I'm not sure how svelte's reactivity is more magic than react's useState hooks. There's a defined syntax for declaring reactivity, and the inner workings of how it results in DOM changes are abstracted away from the developer.
The only real differences are:
-PRO: Svelte is WAY easier to understand
-CON: Svelte is not really pure JS
I'd argue svelte's magic is, in the end, way better for the development experience.

Ricardoromero
Автор

Why would a framework documentation will cover more about javascript than the framework itself??

hailme
Автор

POV:
When you are in love with someone but had to criticize the hot gal of your college to keep your gf's heart

Me-vcsf
Автор

Well use plain js and HTML and handle everything yourself. That way it can won't feel like magic, if that bothers you.
React does the same btw...

vvelarm
Автор

The "magic" is no more magical than the shadow DOM in react which I find the biggest pain in the ass. Svelte doesn't use a Shadow DOM and is doing far less magic as you say.

otockian
Автор

so basically you don't like the fact that its easy, you prefer overcomplexity, Got it.

paulcalebayibaemiotokolo
Автор

0:55 true because svelte is a compiler which means we are not writing JavaScript but another language which look and feel like svelte

alinawaz
Автор

I don't like magic 😂😂😂 why almost every react developer says that?

erickzelaya
Автор

People already mentioned it a ton, but yeah, calling it magic is not a great argument. By that logic computers are magic. That is unless you are this guy and are coding in assembly. XD
But seriously, all this frameworks do stuff that abstracts away complicated things. Thays the point of this frameworks.

jhonyortiz
Автор

The fact its a svelte script not simple JavaScript is good because its not repeating the same strategy used by other libraries/frameworks..
We want this adversity in techniques similarities in concepts.
Virtual DOM, Compilers...etc

hellelo.
Автор

Svelte is the perfect framework for side projects ATM.

fkaspow