r/Clojure • • Mar 20 '21

Evolution of ReactJS vs Reagent (2013 - 2021)

https://www.youtube.com/watch?v=pd8kWJVDQD4
74 Upvotes

15 comments sorted by

10

u/GuerreiroAZerg Mar 20 '21

I know the video is just for fun, but while React is the library that does all the magic, Reagent is a wrapper over that library. I may be wrong, but I think this is the fact that makes it possible to Reagent to stay the same for so much time

16

u/[deleted] Mar 20 '21 edited Mar 22 '21

That is not my point. My point was to show how much time we waste while trying to keep with the JS "upgrades" . I am using ReactJS as an example, but it can apply to any JS library: Redux, Material UI... we see the same pattern. To quantify the hours lets do some estimation:

Assumption (2021)

  • 12M professional JS developers world wide

  • 10 devs per team (1.2 M teams)

  • Now let's assume that you need to "upgrade" at least 2 packages every year (nodejs, react, material ui etc)

  • And let's say it takes at least 2 sprints (1 sprint = 2 weeks) to make that upgrade and requires at least 1 intermediate developer per package (2 per team) o make this upgrade on a medium size code base (100K LOC)

  • And finally lets assume this developer works full time

With that, the total time loss :1.2M teams * 2 packages * 4 weeks ( 2 sprints * 2 weeks/sprint) * 40 hours = 384M engineering hours lost.

Remember Engineering is the MOST expensive resource for any business. Wouldn't it be wise decision to spend all this time on adding new features.

I mean clients don't really care what languages or framework we use. All they care about is how fast can they finally use that "new" feature that makes their lives a little bit easier..

I should have added this in the video but oh well :).

3

u/GuerreiroAZerg Mar 20 '21

That's a great point, thanks. What do you think causes all this churn? I see that React changed it's API a lot, but the concept remained the same, while Angular threw everything away. Redux is pretty much the same since ever, only adding a few tools like redux toolkit on top of it. Redux-saga as well. But in fact there's too many language features in javascript

4

u/[deleted] Mar 20 '21
const PizzaPreview = ({ pizzaType }) => {
  const [quantity, setQuantity] = useState(0)
  const increment = () => setQuantity(quantity + 1)

  return (
    <div>
      <p>I luv {pizzaType} pizza</p>
      <button onClick={increment}>Increment</button>
    </div>
  )
}

2

u/[deleted] Mar 20 '21

Thank you for the correction :)

1

u/[deleted] Mar 20 '21

NP :)

3

u/backtickbot Mar 20 '21

Fixed formatting.

Hello, Anasurimbor_Cale: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.

4

u/Doombuggie41 Mar 20 '21

I'm newish to the clojure world after years of js development with a focus on React. I've always enjoyed FP and going from react's functional components to reagent was pretty effortless as a result. It's interesting to me that it took 8 years for react to get to what reagent envisioned on day 1 essentially.

That being said, it's not the full story. There's some weird nuances of if you want to use react hooks in reagent components wrt how they're invoked for example.

React and JS dev as a result has become a lot more "functionally oriented" over the last few years for sure. IMO React's biggest weakness is that it makes side effecting way too easy with useEffect. I don't really have what a good fix for it would be, but maybe it's to handle events differently than that. Things like re-frame offload it to a more fixed/opinionated event system. React has had this with things like Redux, but the boilerplate has always been a bit heavy and it has lost its favor with the React thought leaders. Things like `react-query` and `useSWR` are very nice, in that they allows you to treat ajax calls like a commodity and that's little boilerplate in setting them up.

0

u/[deleted] Mar 20 '21

[deleted]

3

u/[deleted] Mar 20 '21

yeah just made for fun. i love JS as well :)

11

u/mac Mar 20 '21

Can't we poke a little fun at react/js and learn at the same time? What in your mind would be the top 3 things we could learn?

8

u/didibus Mar 20 '21

If I wanted to try and learn from JavaScript, what would be those things?

5

u/CanvasSolaris Mar 20 '21

Next.js is, in my opinion, the good standard for a front end framework. The tooling is really great

-2

u/BadPoet3 Mar 20 '21 edited Mar 20 '21

Nothing, you already know everything.

12

u/mlengurry Mar 20 '21

I once worked with someone who thought I was an idiot for not knowing the latest syntax added to JS that year. He advised a client that it would be better to rebuild their app because it was 18 months old and now ‘legacy’.

The churn is often excused as ‘progress’ in JS land but it is real and it’s exhausting.