分享

What are the main differences between Angular, React and Vue Javascript libraries?

 heii2 2018-09-09

The main differences, as in the difference that you the developer will most notice, are the interfaces. Technically, React and Vue are libraries and not frameworks, so they are not directly comparable to Angular, but both projects have their standard package of tools that, when Voltronned together, create a direct competitor for Angular.

Angular will feel very similar to writing old fashioned AngularJS, and will also feel in line with writing old MVC architectures like classic PHP, .NET, Ruby on Rails, and Spring. You have a template file that is vanilla HTML, a style file that is vanilla CSS, and a controller file which is TypeScript. All of these things are combined by Angular into a single JavaScript file, but you as the developer do not see this process.

Vue is very easy to start using. You can simply embed the vue.js file at the top of your page and start writing Vue syntax. This means that Vue is very good at replacing AngularJS and JQuery in many applications. You attach Vue functionality to your HTML, and can move toward pure JS if you want, making Vue a sort of middle way between AngularJS/JQuery and React.

React is essentially a new form of DOM writing and will feel very alien to those accustomed to writing HTML like in JQuery. In React, you can write an app that has no HTML or CSS in it at all! Everything is a JavaScript object or function. You can construct your UI out of logic. You can write a sorta’ HTML called JSX, which is React’s attempt to make HTML work inside of JavaScript. It mostly gets the job done but is not nearly as good as Angular’s templates or Vue’s handling of plain HTML. I basically hate JSX.

There are technical differences, but these make no difference. The performance of all three is very similar. The memory footprint is similar. Ultimately, they all produce the front-end.

I see React as the most forward-thinking of the three. It is truly the programmer’s framework since markup has been almost entirely removed. That said, DOM objects are not passive things. They have state and methods. They exist. Since React rejects this, you will find some weird code is required to get certain things, especially forms, working as you would expect. In this regard, both Vue and Angular are better.

Angular’s template, style, and controller files are very easy to grok. The problem with Angular is that its insane change detection strategy requires a massive amount of boilerplate structure and code. On large projects with fluid teams, I think this could actually be a benefit since the structure of an Angular component is so well defined that a new developer can easily get up to speed.

Vue has garnered great success by catering to those who don’t want to abandon the old ways to developer a web page. Indeed, both React and Angular are way overkill for many sites that do not need nor want a full application framework. Vue fills this niche very well. That said, it is necessarily a bit backward looking. You can enhance your app later on to be a full app app, but then Vue starts looking a lot like React. Indeed, Vue supports JSX.

So to recap, Angular uses plain, HTML, CSS, and TypeScript files for building applications, which is familiar and easy to use. React is pure JavaScript and the closer to stick to pure JavaScript, the easier React is. Vue is a kinda’ middle ground that JQuery developers should absolutely look into, since it will be very similar to how they are currently working.

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多