I do actually prefer the React solution here (mostly) even if my personal perspective might put me closer to Svelte camp. I've used dozens of JS UI frameworks. I'd like to even consider I have some expertise on the subject.
I know the first thing is React but for the sake of this argument it doesn't have to be. We are talking about an explicit JavaScript semantic expression that could do the same thing as the Svelte one except it is more explicit what is going on. I know that in React that is not what is happening and that useMemo is a whole other craziness given Hook Rules and potential stale closures etc..
But syntactually the first is clearer of what is going on. What values are being derived from, what is happening simply from being named. There are other benefits. Composability, modularity.. What is $: and why does it have this behavior? Can I just pull my $: statement into a different file and expect it to behave the same.
To be clear I do think this is an opinion thing but one could easily make the same naive argument that React is factually better from that example. This comes down to easy vs simple. Implicit vs Explicit etc.. Everyone has it's own comfort level. We can discuss the tradeoffs of the abstraction vs the internals to death, but ultimately these libraries are doing similar things and more important similar complexities are there.
So conversation is good. This argument not so much.
I recently learned svelte a few weeks ago and absolutely love how simple it is. You can literally just look at the documentation with a quick glance and be like, "oh, that is how its done." Sooooo simple. At work we use Vue.js. React's bound properties are just messy.
Actually I am also impressed by Svelte, which seems to be sort of novelty on this given battlefield, but it is contender with mentioning IMO (especially considering SvelteKit).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It is ok that you have your own opinion but there are clearly more people who disagree with you in the world then with me.
I do actually prefer the React solution here (mostly) even if my personal perspective might put me closer to Svelte camp. I've used dozens of JS UI frameworks. I'd like to even consider I have some expertise on the subject.
I know the first thing is React but for the sake of this argument it doesn't have to be. We are talking about an explicit JavaScript semantic expression that could do the same thing as the Svelte one except it is more explicit what is going on. I know that in React that is not what is happening and that
useMemo
is a whole other craziness given Hook Rules and potential stale closures etc..But syntactually the first is clearer of what is going on. What values are being derived from, what is happening simply from being named. There are other benefits. Composability, modularity.. What is
$:
and why does it have this behavior? Can I just pull my$:
statement into a different file and expect it to behave the same.To be clear I do think this is an opinion thing but one could easily make the same naive argument that React is factually better from that example. This comes down to easy vs simple. Implicit vs Explicit etc.. Everyone has it's own comfort level. We can discuss the tradeoffs of the abstraction vs the internals to death, but ultimately these libraries are doing similar things and more important similar complexities are there.
So conversation is good. This argument not so much.
I think
useMemo(() => )
is more maintainable than$
, and I am not smoking anything.What are you smoking?
I recently learned svelte a few weeks ago and absolutely love how simple it is. You can literally just look at the documentation with a quick glance and be like, "oh, that is how its done." Sooooo simple. At work we use Vue.js. React's bound properties are just messy.
Actually I am also impressed by Svelte, which seems to be sort of novelty on this given battlefield, but it is contender with mentioning IMO (especially considering SvelteKit).