back

by rbanffy·17y ago·view on hn ↗
I agree. Biased, poorly written.

"the idea of handing complete responsibility for "View" generation and near-complete responsibility for Model "business rules" validation to the Web Browser would make perfect sense"

The idea of handling business logic in the browser makes me puke. This guy should hand in his programmer card and never approach a computer again. You end-up with different set of rules implemented twice in two very different execution environments.

The only way it would not be utterly stupid would be if the server somehow generated the JavaScript validators based on the business rules, but that would, also, be a very ugly kludge (and probably require a validation DSL that is different from the implementation language of the rest of the server side).

1 comments
"You end-up with different set of rules implemented twice in two very different execution environments"

precisely!!! read the article - that's exactly the present situation except....

"The only way it would not be utterly stupid would be if the server somehow generated the JavaScript validators based on the business rules,"

precisely!!! that's EXACTLY what the article advocates, by using XXXX-to-javascript COMPILERS.

in this way, the SAME language that is used server-side is ALSO the same language from which the client-side javascript is generated from.

in this way, the SAME source code which is used to perform the business rules validation can be either executed client-side, OR server-side, OR both, depending on the application requirements and depending on what the developer chooses to do.

this _was_ mentioned in the article - and was the whole _point_ of the article.

it's not as ugly an approach as you might think - it just takes a _lot_ of getting used to, and a significant amount of "old thinking" and "disillusionment with the present situation" has to be overcome.

let me put it this way: if someone wanted me to write in pure javascript, they would have to pay me a _lot_ of money. but, using compiler technology such as pyjamas, GWT or rubyjs / rwt, i don't mind at all - because i'm writing in a high-level language where the output happens to be javascript.