2 ms·
We don't use Redux and use useReducer. A Login page is typically a page that if you don't use a FSM, i will make you redo your work. How do you handle MFA? Err
by orwin 2y ago
We don't use Redux and use useReducer.
A Login page is typically a page that if you don't use a FSM, i will make you redo your work. How do you handle MFA? Errors, including network errors since we work with offshore stations that don't have the most stable connexions? I don't see a single way using a handful of states wouldn't result in poor code. What do you do if a new oidc provider will be used? Or if we migrate to AWS and use cognito, what states should you remove, what should you add? How to you order the rendering?
Nah, if you don't want to reuse our hooks and functions that's fine, but you need a decent architecture, and using a handful of state is not it, especially not for a login page. As long as you have a process to follow in the component, not using a reducer will hurt you and the maintainability (we avoid putting business logic on the front-end to be fair, but sometimes you have no choice). And simple component that just display shit (thus don't need a reducer) aren't often given to juniors are this part of the job is uninteresting and quick to do for non-juniors. We tend to do a lot more backend and ops than front anyway.
- bschmidt1 2y agoDidn't say MFA, said state of username / password (useState is fine for that). Also said "use hooks", not "don't use hooks" and never said don't re-use functions. Would hate to be on that team, I bet those PRs are brutal.
- orwin 2y agoExactly what I meant to say, as soon as you have to add complexity, just adding useState over and over breaks, and that's what I call bad code. It's fine if it's just a get in a component out of the way, we do not use a reducer to print our 'about' page, but typically the login is where a lot of logic has to happen. I think I misunderstood your comment, you talked about a global manager and I thought you talked about our library. And since we pair/mob program often enough (10 hours a week roughly, per affinity or when someone ask for help), our PR meetings are more a way to show off to the whole team a new idea or present library upgrades, but it's true that we are quite brutal, especially when i compare with my previous job where I worked with Indians and north Americans, I think it is cultural though.