Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Sometimes I think Angular is mainly popular because it's supported by Google. If any regular developer made these drastic changes in HTML with non valid tags and attributes people would not be happy with that project.

This is a pretty interesting statement and I want to give it more thought. I've used Angular on plenty of projects and admittedly, It's felt a bit dirty to go back to spaghetti DOM that we worked for years to get rid of. All the books were saying to separate logic from our views. Now we're calling it declarative and it's acceptable again. I've been yelled at by other developers as if I should just forget the past few years and just get in line with what's currently the new hotness. Fine, I'm totally okay with embracing whatever is new and hot. But not just because it came from the same people that gave us Wave, Gears, GWT, etc. Let's not get involved in hero worship. All of those technologies had great ideas, yet were (overall) marked as failures. I'd love to have seen this same proposal come from some random Susan/Joe on their GitHub and see if it had been laughed off the stage for the same reasons I mentioned earlier.



> All the books were saying to separate logic from our views

It doesn't matter what the books say. Or rather - you've got to understand the reason for the advice - not just learn to follow the advice.

Programming abounds with maxims. However you can't capture a complex truth with a glib catchphrase. Everyone is trying to achieve the same ends - ease of development without sacrificing maintainability (to give a very simple example).

Catch-phrases such as "separate your logic from your views" was meant in a specific context. If you etch it in granite and pass it on to future generations it won't always embody the practical truth it was meant to convey.

So - we should remember the catch phrases but understand their context - and therefore we might hope to understand the more subtle and less easily stated truth behind the one-liners.


Exactly. There is almost no advice in programming which applies to all situations. The trick is knowing when not to follow the advice, and that cannot be explained in a one-liner.

Or, as the tao of programming says:

There once was a Master Programmer who wrote unstructured programs. A novice programmer, seeking to imitate him, also began to write unstructured programs. When the novice asked the Master to evaluate his progress, the Master criticized him for writing unstructured programs, saying, "What is appropriate for the Master is not appropriate for the novice. You must understand Tao before transcending structure."


It is also a very productive solution to front-end development. Regarding the mix of logic and views there seems to be more and more projects that thinks this is ok. React also mixes the two, maybe even harder than Angular. If you want to create component you have to have a component-view and component-logic as one pair and they will probably always be depending on each other. That said you can say that all single page applications can put a lot of their logic on the server, very clearly separated from the views.




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

Search: