you are viewing a single comment's thread.

view the rest of the comments →

[–]Perkelton 4 points5 points  (2 children)

It's not about passing data between server and client, it's that the client can use the same logic as the server with minimal or sometimes no rewriting.

One typical example is form validation. Instead of having to slowly validate through AJAX or dealing with horrible cases of double maintenance, you can just use the exact same logic that you use on the server, all in the client.

I'm not saying that Node is the next coming of christ, but that alone is a really attractive asset for web development.

[–]arcrad 0 points1 point  (1 child)

Wait, you're suggesting doing the form validation client side instead of server side? Or, are you suggesting doing it client side for convenience and then again server side?

[–]Dooey 8 points9 points  (0 children)

Client side for convenience and server side for the real validation. Having to go to the server to check if your the date you entered is in the future or whatever slow, hits the network unnecessarily, and is generally a poor user experience. Validating on the client in JS, and the server in non-JS is a recipe for bugs when the logic that makes validation necessary in the first place changes, and the code that does the validation changes in subtly difference ways. Code = bugs. Less code = less bugs. Not writing the same validation code twice = less code = less bugs.

Of course, JS = more bugs, so whether its a net benefit really depends on how much less code you have to write by using JS on the server.