News for hackers. Stuff that matters.
Re:Things every React.js beginner should know by mcv on Monday January 25, 2016 @10:23AM (#10967630)
In Angular separating logic and html works fine. The only type of component that should be dealing with html in the first place, are directives. Directives point to a piece of html to include, which can be either a string or a url. In the case of the url, the code is separate.

But more important is the separation between the directive and the rest of the code. The directive is specifically about the logic that's directly related to the view. That's not something you want to put too far away from the view.

And of course Angular's html is enriched html: by including directive, you can put databinding, and limited logic (generally about when you show that bit of html) directly into the html. Separating those would be frustrating and a bad idea. If your view is dynamic, that logic should be considered part of the view.

Re:Things every React.js beginner should know by untog on Monday January 25, 2016 @10:34AM (#10967694)
In Angular separating logic and html works fine

And of course Angular's html is enriched html: by including directive, you can put databinding, and limited logic

Either it's logicless or it isn't, surely. To me, databinding is absolutely the kind of logic that shouldn't belong in a template in the world of strict code/template separation. Another reason why it doesn't really work.

Re:Things every React.js beginner should know by mcv on Tuesday January 26, 2016 @05:52AM (#10972789)
Not all logic is the same. There's logic of the type: "this is what we want to show, and we only want to show it if X is true", and there's logic of the type: "here's how we calculate it and that's all the complex stuff that X depends on".

If you refuse to put the former in your view, you're making your code a lot more complex for little gain. But if you put the latter in your view, you're making your view unreasonably complex and hard to read.

Neither extreme is good. You need separation of concerns, but some logic really does concern the view directly.