News for hackers. Stuff that matters.

SPBesui

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?

Re:Introducing react.dev on Thursday March 16, 2023 @09:34PM (#35191666)
> 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.

Re:Introducing react.dev on Thursday March 16, 2023 @09:08PM (#35191370)
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.

Re:Lionel Messi Is Impossible (2014) on Monday December 19, 2022 @02:29AM (#34049465)
You might like this: 100 school kids against 3 professional soccer players. https://youtu.be/f5Irak2H9GE
Re:Dear Chess World on Monday September 26, 2022 @08:59PM (#32990544)
“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*.

Re:It’s time to let the five stages of grief die (2019) on Tuesday September 06, 2022 @07:56PM (#32744692)
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.
Re:Understanding UseMemo and UseCallback on Wednesday August 31, 2022 @11:01AM (#32662939)
> 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/

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.)

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.
Re:Page Weight Matters (2012) on Sunday July 31, 2022 @02:35PM (#32297605)
> 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!

Re:Page Weight Matters (2012) on Sunday July 31, 2022 @11:39AM (#32296292)
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.
Re:A hookup app for the emotionally mature on Wednesday July 13, 2022 @11:43PM (#32091759)
> 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.

I have nothing special to add here, just wanted to bring attention to the excellent episode of The Good Place (S02E06) that handles the Trolley Problem in a humorous (and very literal) way.
Re:Ask HN: Newly Remote Workers – Where Are You Moving? on Friday August 14, 2020 @12:49PM (#24160200)
Phoenix is great for about six months of the year, but man is it hot in the summer. It is a dry heat, yes, but 115 is 115, humid or not.
Maybe I missed it, but there doesn't seem to be any credit given for the xkcd comic (https://xkcd.com/208/) shown on the Next Steps page (https://refrf.shreyasminocha.me/chapters/next-steps). Does Randall even require it?
Re:The Riemann Hypothesis (Part 2) on Tuesday September 10, 2019 @07:32PM (#20935012)
Excellent read. I also liked his history of algebra: Unknown Quantity (https://www.amazon.com/Quantity-Real-Imaginary-History-Algeb...).
There's a good TED talk on procrastination which might interest you: https://www.ted.com/talks/tim_urban_inside_the_mind_of_a_mas...
Re:NFL Releases Finite Element Helmet Models on Tuesday May 15, 2018 @01:52PM (#17076038)
Lots of people agree with you, including one of the greatest NFL wide receivers: https://profootballtalk.nbcsports.com/2012/12/04/hines-ward-...
He also has a book for children called My Journey to the Stars: http://a.co/11xrP6e
Agreed – see my comment lower down the thread. But even some athletic departments that are net in the red have football programs that make money on their own. Their coaches are paid market value, more or less.

https://news.ycombinator.com/item?id=72825141901

The parent comment to my previous was completely rewritten after I replied. It originally said something like "those athletic programs make tons of money for their schools." I was just saying that only a relative few really made a lot of money, which is what the link shows (as you said).
That's a common misconception. Very few college athletic departments are in the black. And even among those, usually only football and men's basketball make any money at all. Sorry no link...should be easy to google statistics.
But all you're really saying with sports coach comment is that, among people in a sector that is not profit-oriented or known for high wages, the highest paid employee is the biggest differentiator of success ("amateur" participants notwithstanding) for a lucrative entertainment business. That's not really surprising on its face.
It still gets stuck in my head: My Bird of Paradise...
Re:Donald Trump Is Elected President on Wednesday November 09, 2016 @01:58PM (#12913406)
> Much of the issue here is because of lack of understanding of the perspective of the other side.

This sums up pretty much every political debate ever.

Re:Pittsburghese Expertise: Dropping “To Be” on Saturday July 09, 2016 @05:03AM (#12060732)
It really depends on the tense. I'm from Texas and "needs fixing" sounds completely normal (although it sounds even more natural as "needs fixin'"), while "needs fixed" is awkward as heck.
Re:Gogs: a self-hosted Git Service written in Go on Monday August 25, 2014 @07:27AM (#8221309)
It's for ZeroClipboard (http://zeroclipboard.org/), which is widely used (GitHub switched to it in early 2013). Unfortunately Flash is still the only reliable way to programmatically copy content to a user's clipboard in the browser.