Hacker News new | ask | show | jobs
by jcrotor 4322 days ago
That depends. How many forms and how many fields do you need to validate? jQuery is pretty much standard on most websites, so I don't count that against the author. The total minified dependency file is 123 kb. I will agree that is pretty large if all you are using it for is a single field, but again, a large portion of that is jquery. Also compared to just core angular, which is 104 kb, I would say this is a viable alternative depending of course on your specific use cases.

That being said, could an implementation be done without jQuery? Probably. I'm sure the author is open to pull requests if you want to give it a go.

1 comments

Well, you can argue if 5 dependencies and 123 kilobytes of code is much or not. But what does it bring to the table? Your "sub-total" example would just need a normal javascript event handler. Lets say we are uber lazy and use jquery. Then it looks like this:

http://jsfiddle.net/La93vk4q/

How does the way.js version look like? Im sceptical it makes it more elegant.

I'm with you itry. Thanks for bringing this up here. These folks all want to avoid writing event handlers but these alternatives just make there be many levels of function calls between that actual user event and the developer's code to handle it. In addition to it being much slower, it's a lot harder to figure out what's happening when something goes wrong.