Email or username:

Password:

Forgot your password?
29 comments
Tali

@keithamus great post, I only recently started a react course and the instructor makes only a few references to how React used to be and it makes me relieved that I'm learning it for the first time in a post-hooks world

keithamus

@Tali may as well be two different frameworks. I’m not sure the change was a net improvement though.

Konnor Rogers

@keithamus @Tali feels like an improvement for library authors at the expense of end users.

Also no one has to worry about "this" anymore 😂

Andy Luhrs

@keithamus @Tali I learned it right as functional components were being phased out, so I had to re-learn a bunch. Then set it aside, and hooks were the new hotness the next time I looked.

The Spicy Web

@keithamus It is baffling just how much of a unique snowflake React is at this point. In many respects, there's *how the web works* (and most frontend libraries/frameworks follow suit to a fair degree)…and then there's React. 🤪

Alex Wilson

@keithamus Great read.

"it's global state in a functional trench coat" is one of the best sentences I've ever read on React.

Tom

@keithamus this is a great article, especially the recommendations of valuable things to focus on that you've listed at the end.

I myself started freelancing in the late 2000s too, so a lot of what you've written sounds very familiar. I used many frameworks over the years, even Preact, but I'm not inclined to put myself into a "framework developer" box - I believe in choosing appropriate tools for a project, instead of forcing the project into your favorite toy, err, tool.

Patrick H. Lauke

@keithamus "he's not the messiah, he's just a naughty boy..."

Sara Joy :happy_pepper:

@keithamus Uuuughhhh. I straddle this as a new and old hand at the web myself and it's so hard wanting to use some of the gorgeous and elegant new HTML and CSS stuff only to find that it's broken and really hard to make work through React.

Naiyer

@keithamus I agree with everything except Java being a drag to learn. Just like React in 2024 is very different than React in 2013, modern Java is very different than it was years ago. It is much less verbose. With great standard library, it is a fine language to get started without dependencies.

gorsefan

@keithamus yep, and this applies to our business too - which is mature, and here for the long term. For us it’s just not a great ROI compared to investing in technologies that follow & expose web standards, and investing in people motivated to do that too

Bart Louwers

@keithamus You lost me at "Zig is more marketable than Java or C++".

Maybe as a Hacker News hit piece, not if you want a job.

keithamus

@bart perhaps you’re over indexing on one word out of 1000. The point is that these tools can teach you transferable knowledge and maybe you’ll find a job doing them. I’ve not seen or heard of many places actively hiring for Zig developers but I also haven’t seen many hiring Java devs either.

Bart Louwers

@keithamus I think your web development related advice is spot on. Learning transferable knowledge is always preferred to learning tools.

However, knowing one or more languages in depth is also very useful. And here we need to be honest, boring languages like Java and C++ reign supreme and are vastly more widely used than the hip and new languages you mentioned. I also don't think complicated setup is an bad for learning, it's what you have to deal with in most real projects as well.

keithamus

@bart I agree with you overall, but I also think the "boring" languages like Java & C++ also have a high barrier and because of that they're difficult to dive into. I pointed at Rust and Zig because they're new systems languages that lack some of the footguns and don't have a back catalogue of outdated literature.

Obviously lots of places still use them, but as I see it, there is general divestment and the jobs available are for those that specialise. Newer langs, OTOH, have a wider door open.

keithamus

@bart as for complicated setup, yeah it's great landing a gig doing C++ where everything is established and you just need to "find the person or the doc". But if you're staring at a text editor not knowing where the next step is, those langs can be very intimidating. Modern langs have a much more pleasant on boarding experience.

Bart Louwers

@keithamus I see one job listing for 'Zig' in the Netherlands on LinkedIn. And it's from a company called 'Zig' 😀. (24.729 for C++, 28.697 for Java).

Finding out what documentation and learning resources are up to date, struggling with build tooling, dealing with legacy code and constructs, these are all essential skills as a software developer. Being a bit intimidated is while learning is not a bad thing. It preps you for the frightening complexity of any pretty much any real project...

Bart Louwers

@keithamus That said, I get your point as well. Learning Rust or Zig is probably a lot more fun and you will learn some programming concepts more easily if you don't have to focus on overcomplicated or non-standardized build tooling.

Naman

@keithamus > I don't have the time left in my career to waste learning pseudo-functional paradigms when I could instead pick up actual functional languages like Haskell or Elixir.

React hooks are modelled after Algebraic Effects, not Monads etc from Haskell / Elixir. It’s more niche.

React may or may not be the right way to learn these concepts, but the article is amazing:

overreacted.io/algebraic-effec

(Note: I think generator functions *are* algebraic effects in JS)

@keithamus > I don't have the time left in my career to waste learning pseudo-functional paradigms when I could instead pick up actual functional languages like Haskell or Elixir.

React hooks are modelled after Algebraic Effects, not Monads etc from Haskell / Elixir. It’s more niche.

React may or may not be the right way to learn these concepts, but the article is amazing:

Naman

@keithamus What issues are you seeing using dialogs and popovers in React?

keithamus

@nmn need to `useEffect()` to use the methods. `ontoggle`, `onbeforetoggle` don't work. I think the latter is fixed in 19 but still now way to call `showPopover` or `showModal` without a hook AFAIK.

Mayank

@keithamus @nmn where would you rather call `showPopover` and `showModal`? it's imperative code

keithamus

@mayank @nmn I dunno, but it’s a framework so shouldn’t it solve that for me rather than expecting me to use the escape hatches?

Naman

@keithamus You can call showPopover or showModal in a regular event handler function. Doesn’t need to be a hook.

James Scholes

@keithamus I'm gonna need to get "global state in a functional trench coat" on a T-shirt. Maybe kick off a series of similar slogans equating disguised global state in other tech stacks with appropriate garments.

Go Up