Hacker Newsnew | past | comments | ask | show | jobs | submit | SPBesui's commentslogin

I’ve been thinking about that on my own lately. It’s like the whole human race has imposter syndrome and thinks there needs to be an “adult” in the room.

I don’t know how many parents feel this way when bringing their first-born home from the hospital, but my spouse and I felt like the doctors were crazy to trust us, a couple of twenty-somethings, to take home a child and actually keep it alive and do all the things adults do for children.

Maybe that was wise of us to realize the level of our inexperience, but I think that feeling of inadequacy applies to most humans in many situations. We look for leaders to follow, intellectuals to learn from, heroes to worship, and monarchs to rule us. Otherwise, who is the adult in the room?


On taking custody of small humans, I like to say that if we weren’t able to make them at home ourselves we would definitely need a license to get one. It is illegal to own most other types of ape.


> Unit testing of hook based code is non existent IME. It’s some kinda funky E2E feeling test.

I’m guessing you’re referring to the fact that you can’t access component state like you can with class components. If so, that’s not required to do a unit test. That’s a sign that implementation details are leaking into your tests.


I think you’re probably referring to the lifecycle methods, which have relatively clear and unambiguous names in class components. The thing is, those names may make you feel comfortable that they do what their respective names imply, but in reality they’re an abstraction away from how React really works under the hood. Hooks, for better or worse, get you a little “closer to the metal,” so to speak.

Also custom hooks are vastly more readable IMHO than HOCs.


You might like this: 100 school kids against 3 professional soccer players. https://youtu.be/f5Irak2H9GE


“or less” is doing a lot of work in that first paragraph. Running plays typically only last like two seconds, maybe four if they get to the second level (linebackers).

Also, I agree the “math is tiny“ but the talent, work ethic, luck, etc. required to separate oneself from the good to be great is *enormous*.


Metaphors are of course imperfect by their very nature, but more importantly, the phrase “a roller coaster of emotions” isn’t even really a metaphor. It’s a figure of speech that means one is going through a wide range of feelings and/or emotions in a (relatively) short amount of time, possibly in rapid succession or even simultaneously. I think it was used appropriately.


> The original class components were much easier to understand.

Class components only made you feel like they were easier to understand because the method names indicated an intuitive lifecycle. But the reality under the hood was almost certainly different than your mental model because the method/event handler names were actually deceptive. Hooks are much closer to the metal, so to speak.

> A backend developer could open a .tsx file and understand what is going on, and make simple fixes.

They might assume they knew what was going on and how their "simple fixes" would affect execution, but that would probably be naïve. But that goes for anyone jumping into any codebase for a platform/library that they're not familiar with.

> Hooks makes some things easier but the cost in terms of loss-of-intuitiveness is huge.

This is fair, although I feel like the learning curve for React is only steep at first, then plateaus for the vast majority of application developers. It only gets really complicated (as anything does) when you start to get into advanced performance tuning or you're writing a library with very specific requirements.

> The other mistake Facebook is making is assuming that performance is the most important attribute of a UI framework.

This is simply not true. The React team has indicated many times over the years that basic, hello-world level, idiomatic React code is fast enough for the vast majority of applications ("don't worry too much about the number of re-renders," etc.). They're very anti-premature optimization as a group.

Also, Hooks weren't introduced to improve performance anyway (at least that wasn't the primary motivation).

> handling deeply nested objects in the state without making entire copies of the data

It's not from the React team, nor is it specific to React, but have you tried immer? https://immerjs.github.io/immer/


I hope this doesn’t come across as rude, but have you ever held a trumpet? Even if you’ve never played one, you can see they have adjustable tuning slides (a main one at the first bend, then a smaller one off each of the three valves). Maybe you’re thinking of a bugle? But any decent bugle player can bend notes up or down at least a little, probably to compensate for weather/temperature/etc.


I have held a trumpet, and an oboe, and every other instrument I cited here. Bending notes a little bit (which you can do on almost every instrument with varying amounts of effort) is not equivalent to playing in an unequal temperament.


My point was more about the tuning slides on a trumpet, and that it doesn’t have a “fixed tuning.” It’s almost like a trombone in a way: you can play any tone you want within a certain range by adjusting the slides.

(I do apologize if I came across poorly—I couldn’t think of another way to ask the question.)


This is an interesting and thorough response, and I liked reading it, but GP was talking about internal, captive-audience stuff. Box is an app you sell. B2B, yes, not B2C, so your users are “enterprise.” But it’s still a product that competes with others and that seems very unrelated to GP’s point.


In that case, who is concerned with page size for those apps? The apps with bundle sizes that people complain about are almost exclusively from third parties. I've worked on some big internal apps, and almost none of them have payloads big enough to notice. If it ain't broken don't fix it.


> who is concerned with page size for those apps?

That was kind of their point: No one is, so why bother with a lot of effort?

> The apps with bundle sizes that people complain about are almost exclusively from third parties.

Right, like Box. Not the internal apps they were referring to.

> I've worked on some big internal apps, and almost none of them have payloads big enough to notice.

That echoes my own experience.

> If it ain't broken don't fix it.

I think you’re agreeing with the person you responded to. It was just that Box wasn’t the kind of app they were talking about. All I was saying was that your response, while interesting, was not 100% relevant. It was still interesting, though!


> One of the Uvalde officers was checking his phone with an ongoing shooting right next to him.

If you’re talking about the one with the Punisher lock screen, I’m pretty sure his wife was contacting him telling him she’d been shot and was dying. AFAIK he wasn’t just “checking his phone” out of boredom.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: