top | item 45526614

(no title)

alsiola | 4 months ago

> the opposite of being under appreciated

> despite there being alternatives that are better in almost every way.

This right here is the under appreciation. The new way to signal to others on forums that you are a really really great dev seems to be to bring up how much better some bizarro templating engine that abuses a niche JS language feature is.

discuss

order

array_key_first|4 months ago

React has fundamental problems that lead to both:

- horrible performance characteristics

- needless complexity

These are not tradeoffs, these are bugs. We don't gain anything from them.

That's why React introduced a compiler. Because problem 1 is a big deal. But it's not a code problem, it's a React problem. Other tools simply do not have that bug. Which is why the exact same react code can be compiled and run much faster.

jwr|4 months ago

You haven't described those "fundamental problems" that you call bugs, but I think these are irrelevant for me from a ClojureScript point of view. As an example, immutable data structures mean that equality comparisons are cheap and I can often avoid re-computing and re-rendering huge parts of the tree.

More importantly, I don't have a React performance problem. I don't really need "much faster".

recursive|4 months ago

I'm curious what makes a template language bizarro, and why JSX is or is not bizarro?

alsiola|4 months ago

JSX is just sugar around JavaScript, and interops nicely with it. I'm okay with that. The more I write JSX, the better I become at the programming language I'm using. Concepts and patterns in JS can be adopted in my components.

If I learn Vue's templating language, then I'm spending my time learning a system with no wider applicability, a much narrower tooling space, that doesn't utilise my previous or future experience from JS. That's not a good calculus for me.

paulhebert|4 months ago

This seems like a very hostile and uninformed take on the alternative tools.

Have you tried building anything with Vue or Svelte recently?

Can you provide some concrete issues you ran into beyond them being “bizarro”?

alsiola|4 months ago

I consider this example fundamentally broken, in a non-obvious way that reflects, in my opinion, a poor API choice.

  <script>
    let numbers = $state([1, 2, 3, 4]);

    function addNumber() {
      numbers.push(numbers.length + 1);
    }

    const sum = numbers.reduce((x, y) => x + y, 0);
  </script>

  <p>{numbers.join(' + ')} = {sum}</p>

  <button onclick={addNumber}>
   Add a number
  </button>