1

When you learn that in SPAs you do validation in the back and front end -.-

Comments
  • 3
    Why is that bad?
    You validate in front end so you can give instant feedback without having to wait for network and server
    You validate in backend for security

    If you do it in node.js then you can just make a validation module and import it into both front and back end. No duplication of code
  • 3
    @Froot and you should always do both in web development. Always pinging the server to see if it's broken is slow
  • 1
    I'm not saying that is a bad thing... It's just it's odd for me because I have a .Net background... You can figure out why :D
  • 0
    @nervousDev oh, I feel you. The old .net is weird, so glad I'm moving onto mvc
  • 2
    @iam13islucky You don't need every client pinging your server for that. You could just have another tool or whatnot do that. Or do you mean to show a notification to the client? I'd think it's enough to let the client know once he needs to send something. After all, your server being down should be quite a rare occurance
  • 0
    @Froot it's more a UX thing. If they have to wait for the server to tell them if it's valid, it seems much slower, because it is
  • 0
    @iam13islucky I don't get it. That's why you validate client side first and respond from there if it's invalid. That's what I said didn't I πŸ˜„
    Or did I misunderstand you? πŸ˜„
  • 1
    @Froot yeah, I was agreeing. My bad, I phrased it weird.
  • 0
    @iam13islucky Ah ok. I guess I could do a better job at understanding things too πŸ˜„
Add Comment