Hacker News new | ask | show | jobs
by muglug 4842 days ago
Lift's JS & jQuery code generation is nightmare-inducing, it's ridiculous to call it a "benefit". JavaScript should not be auto-generated by some flavour-of-the-week web framework in a totally different language. You're just creating a whole world of pain for future-you.
2 comments

I respectfully disagree. I was able to finish an ajax form, including value validation with only a snippet and it's binded scala function. I did not have to create a specific rest API and write up jquery ajax code along with the snippet. Lift's JS & Jquery support was never meant to replace js and jquery. (don't write up every js feature with lift.) It's meant to eliminate tedious js works that both frontend and backend developers don't want to spend time on.
I think calling it nightmare-inducing is going too far, but there's nothing that forces you to use it. I think it's fantastic for prototyping, because it lets you focus on getting things done in one place. If you're not prototyping, I think you should keep your JS in JS and come up with a common interface to interact with your JS from the server—I've chosen events dispatched on the document element in a variety of situations as that communication protocol.