News for hackers. Stuff that matters.
Re:Common Beginner Mistakes with React by cvdub on Saturday March 11, 2023 @09:10PM (#35115622)
How much of a usability win is making things “real time?” Submitting a form and having the server do validation and render the error messages can feel just as fast. Plus, if you use the correct HTML input types the browser will handle the most obvious validation without any JS.

You have to do validation on the server anyway. Why do it again on the front end?

Re:Common Beginner Mistakes with React by wokwokwok on Saturday March 11, 2023 @09:33PM (#35115798)
haha... Have you ever worked with a product manager?

(:

Sorry, those turn up as 'must have' features in like, meeting #2 with the product owner, because the UI feels old and rubbish without them.

Technically? You're 100% right.

...but, I guarantee that even a LOB app, this will turn up, again and again and again as a feature request, until it becomes a tier 1 priority.

Re:Common Beginner Mistakes with React by saurik on Sunday March 12, 2023 @12:38AM (#35117048)
This clearly seems to read as a problem with the "product manager", not the technology.
Re:Common Beginner Mistakes with React by DangitBobby on Sunday March 12, 2023 @01:19AM (#35117304)
Or maybe it's a problem with people railing against the stack pretending it doesn't solve any problems in at least 1 thread per day.
Re:Common Beginner Mistakes with React by elygre on Sunday March 12, 2023 @05:46AM (#35118325)
And also the problem was with “the” product manager, not “a” product manager.
Re:Common Beginner Mistakes with React by rhaway84773 on Saturday March 11, 2023 @09:57PM (#35115975)
You don’t have to do all validation on the server side.

Did the user forget to fill a mandatory field? Is this phone number actually even possible? Does this zip/postal code exist? Is the age entered too low to create an account? Is the password long enough? Does it meet all the requirements. Can we dynamically show which requirements it doesn’t meet.

Even email, which you will want to verify by actually sending an email, can have some basic front end checks (is there an @ in the email entered by the user).

In fact, I bet the vast majority of validations can in fact be done in the front end in real time.

Re:Common Beginner Mistakes with React by giaour on Saturday March 11, 2023 @10:21PM (#35116155)
You still have to do all the validation on the server, but you can duplicate some or all of it on the front end for convenience.

For simple projects, the validation built in to HTML form elements may be sufficient.

Re:Common Beginner Mistakes with React by bombolo on Sunday March 12, 2023 @05:52AM (#35118352)
> You don’t have to do all validation on the server side.

Yes you do.

Re:Common Beginner Mistakes with React by zelphirkalt on Sunday March 12, 2023 @07:01AM (#35118690)
Client-side code is subject to potential manipulation. No validation you perform there can be a guaranteed truth for the server-side. Thus you cannot replace validation on server-side with validation on client-side.