DEV Community


Discussion on: Vue or React?

ivanjeremic profile image
Ivan Jeremic

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.

Thread Thread
oncode profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Manuel Sommerhalder

It's not a opinion, it's a fact. If you think this:

useMemo(() => computeExpensiveValue(a, b), [a, b]);
Enter fullscreen mode Exit fullscreen mode

is easier / more maintainable than this:

$: computeExpensiveValue(a, b);
Enter fullscreen mode Exit fullscreen mode

Then I would like to now what you are smoking. The people you are referring to are the ones like you who have never tried another framework and saying "React is just better". 🙄

Thread Thread
ryansolid profile image
Ryan Carniato

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.

Thread Thread
chrisza4 profile image
Chakrit Likitkhajorn

I think useMemo(() => ) is more maintainable than $, and I am not smoking anything.

What are you smoking?