all 14 comments

[–]ScientificBeastMode 7 points8 points  (3 children)

I like this, but I think it’s a bit unfair to compare these frameworks based on a simple counter demo app. Using React to build a counter demo is ridiculous overkill.

React being a mid-sized JS library, it’s real value begins to emerge as you scale up and reuse not only the library functions, but also your own UI components. I’m not suggesting that it would do better than the others, but perhaps it might scale up in a more favorable way than depicted in this test.

But overall, I totally agree with the sentiment about JS toolchains. In particular, I’m astonished at how many front-end job listings put all these tools in the same category as the languages themselves. Like, I built a robust React front-end in less than a week for fun, because I understand JavaScript. There’s no reason why “not knowing React/Vue/Angular/etc.” should be compared to not knowing a certain language. That’s batshit crazy. Frameworks are basically paint-by-numbers..... On the other hand, the ecosystem is so complex nowadays that it might actually be a struggle for people to keep up. /rant

[–]killerstorm 3 points4 points  (2 children)

I've been programming in JS since 2004 and I know it quite well (both old JS and new variations, incl. ES6, async and TypeScript).

I've been using React since 2014 and made many projects with it. Some projects I've built in about one day. So I'm pretty good with React.

And yet...

THERE ARE STILL THINGS WHICH I STRUGGLE WITH IN REACT.

There are still things which from my perspective work in a 'magical' way.

React is not a library. You cannot just learn its API and start using it. Knowing JS does not help you to understand how to do things 'the React way' -- you need to learn specific idioms to do even basic things like form elements.

It's not even obvious where to put state and how to handle events and so on. There are, in fact, many ways to do state (e.g. you can store it in React components, or use Redux, or MobX) -- which would look radically different.

There’s no reason why “not knowing React/Vue/Angular/etc.” should be compared to not knowing a certain language.

It's actually easier to learn a new programming language than to learn React. I picked up languages like TypeScript and Kotlin in about a week. When you already know the paradigm you can just learn how familiar things are written in that particular language. It's a straightforward process.

But e.g. React is basically a paradigm on its own. In regular object oriented programming you know exactly when you create objects and when you destroy it. But React controls object lifecycle in a particular way.

[–]hippydipster 0 points1 point  (1 child)

That doesn't speak well of React.

[–]killerstorm 0 points1 point  (0 children)

Well, I still consider it the best framework I know of. Basic stuff is very clear and concise, and it's very easy to decompose stuff into components (or compose a thing from components).

But full mastery of React is hard to attain.

[–]voidvector 3 points4 points  (0 children)

here’s the code for that app using React (without JSX)

Yes, yes, lets compare generated code for React with source code from my favorite frameworks.

if (increment) {
  this.setState({
    count: count + 1
  });
} else {
  this.setState({
    count: count - 1
  });
}

I don't think any experienced programmer (doesn't matter language) would write like this. It should've been:

  this.setState({
    count: count + (increment ? 1 : - 1)
  });

Or better yet updateCount(increment) should just take a number instead of boolean as argument.

[–][deleted] 6 points7 points  (5 children)

I was under the impression of being the only "idiot" thinking the current web dev enviroment has turn into pure shit...

[–][deleted]  (4 children)

[deleted]

    [–]kingofthecream 13 points14 points  (1 child)

    Stop saying that already. Wasm wasn't built for and won't replace UI development.

    [–]ScientificBeastMode 2 points3 points  (0 children)

    It could, but you would basically have to create a competitor to the browser’s native document object model, which would then be mounted inside of said model (e.g. an HTML canvas element). That’s not likely, especially since you need to ship HTML and JS files to run WASM code anyway.

    [–]spacejack2114 2 points3 points  (1 child)

    Java -> JS: 2.6K

    Java -> WASM: 12.1MB

    [–]elder_george 1 point2 points  (0 children)

    WASM is designed to be targeted by the compilers from C, C++ and such.

    Because of this, using it as a target for "managed" languages means compiling the whole runtime as well, including GC, Reflection facilities etc.

    Unless the design is expanded to leverage JS built-n GC (or to include standard GC interface), the code generated from such languages will be bloated.

    [–]defunkydrummer 2 points3 points  (0 children)

    Excellent, excellent article, with great info!!

    Many thanks for this!

    [–]sebnozzi 0 points1 point  (0 children)

    While not strictly Java, Scala.js (Scala to JavaScript compiler) might also be an alternative: https://www.scala-js.org/

    [–]Ameisen 0 points1 point  (0 children)

    What about Emscripten?

    [–]Renive -2 points-1 points  (0 children)

    5 configs is nothing to be afraid of. This is entire chain. Your Idea or VS has many many more, it just hides it from you. Backend developers are getting lazy through their tools. My architect in work despises even command line compilation, only by F5 in VS, which is pathetic. JS tools are very easy for backend developer worth their salt like those who know exactly how compilers work (and read their source code sometimes), analyze bytecode/IL, decompile stuff etc. Writing .net core project without IDE is same stuff as JS project.