3 ms·
i don't see how sprinkling if-statements in your html is cleaner than "magical attributes" but thats just me :)
by SonicSoul 10y ago
i don't see how sprinkling if-statements in your html is cleaner than "magical attributes" but thats just me :)
- mateuszf 10y agoif statement is one of the most basic concepts of programming and is opposite to magic
- bryanrasmussen 10y agoTrue, but some would argue that its use is a mark of lacking taste - https://medium.com/@bartobri/applying-the-linus-tarvolds-good-taste-coding-requirement-99749f37684a#.ap2xosolo https://medium.com/@bartobri/applying-the-linus-tarvolds-goo...
- nobleach 10y agoIt's not just you...this has been a pretty big toss-up with MVC style frameworks and view libs. Does business logic belong in the template? Or does it belong in some sort of view controller? Mustache.js insists that all decisions should be made before data is sent to the template. Most other libs allow the template to make decisions. I don't think there's a definitive answer. I kinda lean on making easy decisions in Handlebars templates... or, since our new app is in React, JSX.