Live data from Hacker News

Hooks: React’s Do-Notation

devanshj.me

31–40 of 80 posts

Re: Hooks: React’s Do-Notation

#31

My first boss had an often repeated mantra in code reviews: "akdor, don't fight the damn language!" If you're using Python, write with Python concepts. In C#, write C#. In F#, write F#. Etc etc. React has many many great ideas. But they are perpetually fighting the language. Here we have a great demonstration of stuff that is built in to any ml-legacy language being hacked into js in a way that the transformation hap…

Which is all good and well, but the language is fighting the language. If you don’t believe me, just look at active tc39 proposals. JavaScript is increasingly becoming a compilation target and writing it idiomatically is increasingly a mishmash of preferences.

> JavaScript is increasingly becoming a compilation target

JavaScript is the browser's machine code; having it as a compilation target makes at least as much sense as having an Intel chip as a compilation target.

Re: Hooks: React’s Do-Notation

#32

My first boss had an often repeated mantra in code reviews: "akdor, don't fight the damn language!" If you're using Python, write with Python concepts. In C#, write C#. In F#, write F#. Etc etc. React has many many great ideas. But they are perpetually fighting the language. Here we have a great demonstration of stuff that is built in to any ml-legacy language being hacked into js in a way that the transformation hap…

Which is all good and well, but the language is fighting the language. If you don’t believe me, just look at active tc39 proposals. JavaScript is increasingly becoming a compilation target and writing it idiomatically is increasingly a mishmash of preferences.

God I wish TC39 would treat JavaScript as a compilation target, but they do seem to keep adding new complex features for end-developers (which, as you say, are mixing up what it even means to code in the language: the class-oriented stuff in a prototype-based language is causing a whack-a-mole of syntax complexity to regain what they lost, such as with decorators) that of course every implementation will have to support (which alone should be a reason to try to only add features and behaviors to the browser that absolutely could not possibly be simulated effectively in code: browsers should be easy for a few people to implement, like a JVM, with most users using nothing but JS and canvas, generated as a compilation target... but, instead they are spiraling behemoths of complexity with ever-burgeoning CSS and HTML features that even Microsoft had to finally tap out of bothering to maintain).

Re: Hooks: React’s Do-Notation

#33

My first boss had an often repeated mantra in code reviews: "akdor, don't fight the damn language!" If you're using Python, write with Python concepts. In C#, write C#. In F#, write F#. Etc etc. React has many many great ideas. But they are perpetually fighting the language. Here we have a great demonstration of stuff that is built in to any ml-legacy language being hacked into js in a way that the transformation hap…

> in the user's browser in a scripting language at runtime

ok, but it will just get compiled down to machine code?

Re: Hooks: React’s Do-Notation

#34

My first boss had an often repeated mantra in code reviews: "akdor, don't fight the damn language!" If you're using Python, write with Python concepts. In C#, write C#. In F#, write F#. Etc etc. React has many many great ideas. But they are perpetually fighting the language. Here we have a great demonstration of stuff that is built in to any ml-legacy language being hacked into js in a way that the transformation hap…

Which is all good and well, but the language is fighting the language. If you don’t believe me, just look at active tc39 proposals. JavaScript is increasingly becoming a compilation target and writing it idiomatically is increasingly a mishmash of preferences.

The progressive C++ification of JS is scary and exciting in equal measure.

Re: Hooks: React’s Do-Notation

#35
The functional programmers always sound like wannabe mathematicians to me, with their fancy category theory words. And the OOP guys always sound like wannabe engineers, with their fancy AbstractFactoryFactory.

Nice article though.

Re: Hooks: React’s Do-Notation

#36

My first boss had an often repeated mantra in code reviews: "akdor, don't fight the damn language!" If you're using Python, write with Python concepts. In C#, write C#. In F#, write F#. Etc etc. React has many many great ideas. But they are perpetually fighting the language. Here we have a great demonstration of stuff that is built in to any ml-legacy language being hacked into js in a way that the transformation hap…

[deleted]

Re: Hooks: React’s Do-Notation

#37
post #9

Sometimes I look at what's going on in React land and just want to ask these developers, do you really need all this to make a UI? Really? Are you sure? Are you making things better?

As a frontend developer I can confirm that you do not, in fact, need any of these things to make a UI.

Re: Hooks: React’s Do-Notation

#38
post #14
post #9

Sometimes I look at what's going on in React land and just want to ask these developers, do you really need all this to make a UI? Really? Are you sure? Are you making things better?

This article is a bit long-winded. I don't reason about React at all like the author of this blogpost. Using React with hooks is dead simple, and getting a React app running takes minutes.

Minutes to build, years to unspaghettify

Re: Hooks: React’s Do-Notation

#39

React has hooks because React's "classes" were pretty crappy…partially due to crappy OOP in general in previous eras of ECMAScript. But instead of actually making their syntactical sugar better as JS' native OOP paradigm improved, they went the opposite direction. After having to use them in a large React codebase for years now, I still can't stand them. For a look at a UI library that actually rocks precisely becaus…

I love lit. Smoothest developer experience with a very small learning curve.

Curious, what do you use for state management across WC’s?

Re: Hooks: React’s Do-Notation

#40

Earlier quoted context omitted.

Which is all good and well, but the language is fighting the language. If you don’t believe me, just look at active tc39 proposals. JavaScript is increasingly becoming a compilation target and writing it idiomatically is increasingly a mishmash of preferences.

> JavaScript is increasingly becoming a compilation target JavaScript is the browser's machine code; having it as a compilation target makes at least as much sense as having an Intel chip as a compilation target.

I hope you mean this in the manner that usually we _don't_ target Intel chips, and instead target the x86_64 ISA.

Sure, it's possible to target JS, but in the general-case it's wildly inefficient, and requires mental gymnastics compared to something like WASM. This is likely why people are bothering with WASM at all, rather than accepting JS as "the browser's machine code."

Post reply on HN