Hacker News new | past | comments | ask | show | jobs | submit login

Remember separation of concerns ? Fuck that, let's just mash code and markup together.

The fun part is that Angular (1, anyway) has pretend-separation. Sure, there's truth in DOM, but not really. Littering your custom directives all over the place may feel like progressive enhancement but if you're using an app framework like Angular your JS is likely already complex enough that you can't meaningfully consider it a mere "enhancement" -- we're talking core functionality, not fairy dust.

People react (heh) strongly to React's JSX when they first come across it but at the end of the day I find React far more honest in its approach. Your Angular templates don't really gain anything from looking like they're just HTML templates -- instead you end up either serializing your data into some kind of string format or faffing about with magical nested "scope" objects (as if JS scoping wasn't enough to keep in your head).

But in order to maintain that illusion you also have to buy into these huge layers of added complexity when writing your own directives. I'd rather go all the way back to steamrolling the DOM with Backbone templates than these pretend-semantical lumps of custom elements and attributes.

Sorry for ranting. I'm still sore about being burned by Angular.

How exactly were you "burned by Angular"? Many of us here are using it very successfully. And no, you don't need to "serialize your data into some kind of string format" (at least in the sense that you would never flatten JS objects into serialized strings in order to work with them). Scopes definitely take some getting used to, but they are not magical.

What concerns do you think you're separating exactly, when you're dealing with presentation-tier markup and code that combine intimately to a single component?

I think a lot of the people worrying about this separation of concerns, and feel it's such an obvious problem that they don't even need to expand on it at all, are probably people who had to deal with hideous PHP (in the unenlightened days before Laravel, let's say) where views, business logic, and everything else get snarled up together in a horrible mess between some opening and closing PHP tags.

I had similar worries when I first saw JSX. Having used it quite extensively, though, it does feel like it's a sensible idea now, from a development perspective at least. That said, it does increasingly feel like the days where certain people could just write HTML and CSS, and other people could handle the trickier JavaScript, are long gone (especially with things like Radium for React).

Business logic should still remain separate. This would be display logic.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact