Validations in Full Stack Development
1/29/2019 · Sandhiya

Full Stack Development, a quite tough to explain in a couple of lines. It takes ownership of the entire application from top to bottom. If you see a person as Full Stack Developer, he must be an all-rounder to develop an application from zero to high excellence. Full Stack Development includes 2 layers of architecture :
- Front-End Development (aka Client-Side / Presentation Layer)
- Back-End Development (aka Server-Side / Business Logic Layer)
Client-Side Validations
Validation takes place on the client side(web browser). It would be more frustrating to wait for the server response and re-enter the form that has nearly 100 inputs. So it is mainly for formatting data instantly and for the quick error recovery process. Client-side validation gives the user feedback ASAP without having to wait for the server. It is an added topping, but not necessary. This will avoid the majority of validation issues and unnecessary processing from the server to perform data validations.Pros:
- Faster than Server-Side Validation
- Better user experience can be provided by responding quickly(like invalid phone number, required fields,etc..)
- Saves network bandwidth, traffic API calls
Cons:
- Not Secure and useless if client-side scripts are disabled(javascript disabled)
router.post(‘/api’, async(req, res) => { let isValidationPassed= await validateAndHandleInputs(req); if(isValidationPassed){ //continue the business logics } })
Pros:
- More Secure than Client-Side Validation
- Validation Techniques and Logics cannot be viewed/modified by the user.
Cons
- Comparatively slower execution
References:
- https://www.smashingmagazine.com/2009/07/web-form-validation-best-practices-and-tutorials/
- https://medium.com/@davidpetri/server-and-client-side-validation-with-javascript-html-and-hapi-js-eccc779e448a
- http://net-informations.com/faq/asp/validation.htm
- https://surajdeshpande.wordpress.com/2013/08/10/difference-between-server-side-validation-and-client-side-validation/
