In this blog, I would like to compare and contrast two of the most popular ways to develop UI using JavaScript out there: React and Angular. I star...
For further actions, you may consider blocking this person and/or reporting abuse
Clearly React has cleaner syntax, my second choice after React would be Vue for sure.
I don't think it's that clear cut though. React is nice but Angular's ability to separate html from typescript code is actually quite good for debugging.
It means Angular's html will be much closer to reality than React in practice.
Really? Html has an ng-if element?
Haha Obviously not BUT it will render just fine with it!
I'm confused about how
{submitError && <p className='product-submit-error'>{submitError}</p>}
is closer to a html element than<p class='product-submit-error' *ngIf="submitError">{{submitError}}</p>
clearly you are biased, or you don't know what clean means.
I think it's more about personal preference, as I said if I wanted to use Angular
ng
-fied attributes, I would go for Vue.js.I think the class name should be ChildComponent if I am not wrong
You're right., I have corrected it. Thank you for pointing out the error :)
We can all be religious about our preferences but honestly Angular is top notch with it's SRP approach to problems, no wonder it's the best for wiring enterprise apps. Think React is too free style to write something that's maintainable over time
Can't really sympathize with react JSX mixing view with controller code. Angular has an approach that follows better the separation of concerns paradigma.
You can always use hooks in react to separate your business logics. 😊
Putting stuff in separate files !== separation of concerns. Angular controllers and templates are joined at the him.
"...The separation of concerns is achieved using modularization, encapsulation and arrangement in software layers."
An Angular distinguishes between this aspects of a project:
-Modules
-Components
-Services
-Templates
-Metadata
-Data binding
-Directives
-Dependency Injection
If this and separating the presentation layer into view and logic is not some kind of "encapsulating" then I don't know.
In my mind, only Svelte exists. 😎
But if Svelte didn't exist, Vue would be my choice. React seems to be the grandpa now: Shaped the future, but the future has surpassed it.
React is great if you need to write some unmaintainable spaghetti code quickly. For anything enterprise related, that you'll actually need to support long-term Angular is the way to go.
Angular natural separation of concern make it easier to read and pick-up as a newbie
Angular looks difficult, but I found it way better to learn than the React spaghetti. After Svelte, we shouldn't even talk about React anymore.