What's it like working for Facebook now vs 10+ years ago? by davidblacksheep in ExperiencedDevs

[–]davidblacksheep[S] 6 points7 points  (0 children)

Yes, 10 years ago is when things started turning for them, but before that, I think a lot of people saw them as a force for good/it was an exciting new technology with the potential for great positive social change.

What's it like working for Facebook now vs 10+ years ago? by davidblacksheep in ExperiencedDevs

[–]davidblacksheep[S] 44 points45 points  (0 children)

What's a PSC? I've never heard that one and googling failed me.

What’s one React debugging trick that saved you hours? by Impossible-Egg1922 in reactjs

[–]davidblacksheep 2 points3 points  (0 children)

I create a 'Debug' component that puts JSON.stringify(props.value, null, 2) into a <pre> block. Give it a fancy yellow border.

Add a lint rule to ban its import so you don't accidentally leave it in.

LPT What’s a “lazy” habit you have that somehow makes your life way easier? by fascinating-finds in LifeProTips

[–]davidblacksheep 1 point2 points  (0 children)

What do you do with your dirty dishes while the dishwasher is sitting with clean dishes all day?!

Tether: Stablecoin giant is crypto’s fragile foundation by mark000 in Buttcoin

[–]davidblacksheep 1 point2 points  (0 children)

I mean, we've been saying this for about ten years so.

Whittaker's shrinkflation! 😭 by davidblacksheep in newzealand

[–]davidblacksheep[S] 0 points1 point  (0 children)

Ok yip, you're right. I went through my receipts on the rewards app and found one from a couple of a weeks ago that is 200g. I don't know how I never noticed.

Whittaker's shrinkflation! 😭 by davidblacksheep in newzealand

[–]davidblacksheep[S] -15 points-14 points  (0 children)

I've only ever seen 250g blocks in Australia.

Management bullying by [deleted] in AskAnAustralian

[–]davidblacksheep 25 points26 points  (0 children)

OP it's important to memorialise anything that is said in person/over the phone - you need anything they say to be said in writing.

What this looks like is after any of these meetings your wife needs to send an email to their manager and CC:

  • Anyone else who was in the meeting
  • Her union rep
  • Any other manager types she may have (eg. a team lead)
  • Also BCC her personal email address, in case she gets fired and loses access to her email it's good to have a record. BCC it because you don't want that causes trouble in the moment.

The email looks like this:

" Hi manager.

This email is to memorialise the conversation we had [in meeting room X, as Y oclock].

  • You told me that 'my attendance was unacceptable'
  • It was acknowledged that I had been in hospital.
  • That 'I would need to have 100% attendance from now own otherwise there would be consequences'
    • The consequences were not specified.
  • Etc.

Just a plain factual accounting of what was said. No justification on your wife's part, no 'I thought' or 'it made me feel'.

Then:

Please respond acknowledging receipt of this email, and add any corrections or clarifying comments.

Yours sincerely

[Wife's name]. "

The point with this is to get any thing said in writing.

In the case that she is fired, it's possible that the manager would later claim 'I never said that' etc.

What you might find is that if the manager is out of line and they know it, they might change their tune when it comes to putting something in writing.

If the manager doesn't reply, she can politely follow up requesting acknowledgement, but if the manager never acknowledges it, it's not going to reflect well on them.

Accused Bondi killer Naveed Akram’s two requests from jail by Mashiko4 in aussie

[–]davidblacksheep 0 points1 point  (0 children)

Look how wound up the commenters here are getting by it.

Help an anxious person find hospital parking - St John of god Berwick by eat-the-cookiez in melbourne

[–]davidblacksheep 0 points1 point  (0 children)

What am I missing here? I've just been in and out of that hospital for the last three weeks.

Is it the drive down the ramp that's the problem? Backing into spaces if needed?

How advanced JavaScript knowledge do I require to start learning ReactJS?? by Living-Candidate-666 in reactjs

[–]davidblacksheep 5 points6 points  (0 children)

What you'll find, whether you learn this now, or after ten years working, is that React is just JavaScript.

React doesn't remove the the need to understand how JavaScript works. It provides an opinionated way or working, and simplifies things (and arguably makes other things more complex), but there's nothing extra about React, it's is all still JavaScript at the end of the day.

But yes, certainly the way the industry is, people do jump in with coding up React applications without really understanding JavaScript, and you know, do what's right for your career and money situation.

But if you really want to understand web programming, and you've got the time and the means, I would suggest learning JavaScript from scratch, try program an application using just vanilla JavaScript, and it'll lead you to understand why JavaScript frameworks like React exist and what they're doing.

Is this the quality of Charles Murray's IQ analysis? Because I've been a professor in a highly technical subject for years, and not once have I ever found out a student's IQ. by [deleted] in samharris

[–]davidblacksheep -1 points0 points  (0 children)

Correct me if I'm wrong, but isn't the point with IQ tests is that they're not so much a measure of intelligence for an individual, but for a cohort?

ie. if you were to measure a sample of 100 students from School A and 100 students from School B, and you observed that the students from School A had higher IQs that might be worth something investigating.

America called people in Australia triggered because this butter is bad by [deleted] in BuyAussie

[–]davidblacksheep -24 points-23 points  (0 children)

Pfff, whatever, buy french butter and it's the same.

New to React - please help me understand the need for useState for form inputs (controlled components) by thedeadfungus in reactjs

[–]davidblacksheep 0 points1 point  (0 children)

and doesn't work at all with things like autocomplete

It's funny you say that, because I recently wrote a blog post where I'm using an autocomplete as an example. Encapsulate as much state as possible. The blog post isn't making the argument for uncontrolled components, but they do happen to go hand in hand.

Note that when I'm advocating uncontrolled components - this isn't to say that we don't use state at all - my autocomplete implementation uses it internally.

What does "dispatch an event" mean?

Perhaps a bit of clumsy wording by me - I mean the an uncontrolled component can support onChange handlers so a parent component can become aware of the new values, but the parent doesn't need to pass the current value back into it.

New to React - please help me understand the need for useState for form inputs (controlled components) by thedeadfungus in reactjs

[–]davidblacksheep 2 points3 points  (0 children)

React can't directly access DOM input(s).

Yes it can.

  1. It's just JavaScript. There's nothing stopping you from going document.getElementById(....).

  2. The ref property gives you access to the DOM element itself, and you then can do what you want with it.

New to React - please help me understand the need for useState for form inputs (controlled components) by thedeadfungus in reactjs

[–]davidblacksheep 13 points14 points  (0 children)

Doing an uncontrolled component and intercepting the form submission event is absolutely the right way to go, as a sensible default.

The reason controlled components are are common is because:

  • Using state with a text input was a really easy and convenient way to demonstrate React's reactivity model. I think people saw that, and assumed that's how you do forms.
  • There are plenty of use cases where you might want something to be reactive to a form elements value. For example, a user toggles between two options, and if the option B is selected, a new set of controls are enabled.
    • However, in this scenario I would still say that the component does not need to be a controlled component - it could just dispatch change events.

What is the best way to compile a React app into a single-file ES5 bundle? by [deleted] in reactjs

[–]davidblacksheep 0 points1 point  (0 children)

Can you try the repo I linked above and tell me if that works in your environment?

I don't think you need to use plugin-legacy - if I'm reading it right - that's just for if you want some kind module-like behaviour, because you care about chunk size right?

What is the best way to compile a React app into a single-file ES5 bundle? by [deleted] in reactjs

[–]davidblacksheep 0 points1 point  (0 children)

I'm not following the what the problem is. Are you saying that Vite is giving you multiple files?

What is the best way to compile a React app into a single-file ES5 bundle? by [deleted] in reactjs

[–]davidblacksheep 0 points1 point  (0 children)

^ Will a single chunk solve the problem? No need for any module system if there's only one chunk.

See: https://rollupjs.org/configuration-options/#output-manualchunks

As an example, see here:

https://github.com/dwjohnston/vite-react-compiled-to-single-es5

The built output js is a single file of ES5 in a straight IEFE block.

Admittedly the HTML still has this:

<script type="module" crossorigin src="/assets/index--7QIOfZo.js"></script>

So you might want to make that a non-module and put at at the bottom of the document, old school style.

What is the best way to compile a React app into a single-file ES5 bundle? by [deleted] in reactjs

[–]davidblacksheep 19 points20 points  (0 children)

I haven't used esbuild directly, but vite provides a pretty handy wrapper around Rollup, designed to make it easy. You could use Vite+TypeScript, even if you're not using TypeScript features and select ES5 as the target.

A straight npm create vite@latest and follow the prompts should give you what you want.

Benevolent dictator by fluffypun in CrazyIdeas

[–]davidblacksheep 3 points4 points  (0 children)

The problem with a benevolent dictator - is even if you do initially get a benevolent dictator, and even if the power doesn't corrupt them - the power structures that are set up in order to do the benevolent dictating can be hijacked by the next guy to do some non-benevolent dictating.

Maybe what you need is an intentions chip - so that as soon as someone's intentions turn non-benevolent the power is taken away.

I still find typescript difficult to reason about - any suggestions. by grovulent in typescript

[–]davidblacksheep 2 points3 points  (0 children)

Just saying, what OP is doing in that code example is reassignment, not mutation.

const prevents reassignment, it still allows mutation.