30
Jun
I often encounter backend codebases where data isn't validated before being processed or inserted directly into the database. This can cause serious bugs, as relying solely on your frontend buddy can lead to headaches, ruin the flow, result in unwanted and unexpected data in the database, and make you vulnerable to SQL injection if you are using an SQL database. What's the solution then?I agree that data validation is a must, but it isn't always easy to get right. Here's what you can do: Don't trust anyone. Validating data involves four crucial steps: Check the type. Validate the format. Refine…