Re:A simple webpack starter without a framework
by petilon on Sunday November 19, 2017 @11:53AM
(#15734600)
Your Angular example appears to be an incomplete example, the jQuery one is more complete, so is this a valid comparison? When using jQuery you can still embed logic inside templates using something like https://github.com/wisercoder/uibuilder which is really tiny.
Re:A simple webpack starter without a framework
by rimliu on Sunday November 19, 2017 @03:57PM
(#15735900)
$('#business-class').toglleClass('selected', this.value === 'business');
And $('#business-class') should be in a var.
Re:A simple webpack starter without a framework
by rtpg on Sunday November 19, 2017 @08:41PM
(#15737159)
this is indeed a cleaner example.
I think if you are diligent about your layout, you can separate out your DOM operations from your logic operations (think Flux) and end up with nice and simple code like this.
Personally I like the "rails" given to me in Angular/React (especially given I know how to circumvent them). I also am more productive in them. But I bet a lot of skilled programmers can go far with just simple tools like jQuery.
At least for me, having a paradigm enforced is useful, especially on larger projects with multiple stakeholders.
Almost every day of the year,
feels better to me than: There are other considerations, angular/React aren't the only solutions to this... but having something to handle this sort of stuff cleanly and generally is a no-brainer to me.jQuery's an amazing tool at the low level, but there are some higher-layer stuff we can easily apply to manage state.