The reality is you don't really have any idea of what future of web development is, as anyone has. The community is not oriented in any way... rather we are probably in the time of biggest uncertainty and most frequent change of ideas of the whole web dev history.
Honestly the only and best suggestion I can make is "ignore everyone who try to say * this is how you should do things, the rest is shit * ", for the big part of the time they are just trying to self-justify an over investment on their own solution (or worst, ego), telling themselves they for sure had understood everything and the others are just wrong or "not there yet". They don't even know that they don't know.
Now that doesn't make js revisitation of fp pristine but still it's quite a refreshing thing.
I never used Ang2+ but Ang1 was such a heavy thing; it was a OOP theory in itself, flipped around the DOM (I forgot their terminology but basically, the DOM tree became the inheritance tree).
The angular team seems to hate simplicity and love made up words.
No more factories, or dependency injection, or crazy template language that is never quite expressive enough, and no more digest cycles to optimize.
ANY web developer is someone that once upon a time looked at an api that was a complete mess (javascript, dom, ...) and still said to himself - that's for me!
Update : absolutely not saying they wrong to think so. Building the right things is more important than building the things right.
The benefit over react is how you don't need anything additional to manage your workflow. It's nice to set up a project and not need to glue together libraries.
Then, I read that VueJS was a somewhat better and lean version of React, so I skipped React and started with Vue, I was surprised that I wrote the complete app within a week of starting to learn Vue (https://github.com/thewhitetulip/Tasks-vue) , of course, there were issues I faced, but they were solved quickly thanks to the amazing vue community.
I saw that many many people who are trying Vue are facing the same problems as I was, thus, I started writing this guide (https://github.com/thewhitetulip/intro-to-vuejs/).
Vue is amazing.
edit: link
Those frameworks/libraries don't write themselves.
This is really aggravated that -- as opposed to native GUI libraries -- frontend requirements vary wildly. You might just need it to embellish some elements (i.e. the jquery level), you might also use it to build some large desktop app replacement.
Which is why I take most comparisons with a large grain of salt. In this regard, "JS framework XYZ sucks/rules" is the new "PHP is great/awful".
Which often has the same end result, with a bit of added customization and some hard choices way too early.
Edit: removed a brash statement.
How easy it is to get up and running with a framework doesn't actually tell me that much about the framework. Is the apparent simplicity simply an artefact of a huge layer of magic that I will end up fighting 4 months down the row?
A good example for this is actually the much maligned Angular 1, two-way data binding looks easy on the surface, but it comes with a cost. And guess what, two-way data binding was all the rage for a while in the HN echo chamber during the early days of Ember, Angular and Knockout.
In the end, whether you use Angular, React or Vue is really secondary to what you build with it. You can create shitty and good code with all of them.
Now, specifically about Angular2+. People act as if its approach was this awful, monstrous abomination. This all really depends on your circumstance tho, or not? There are instances where it makes perfect sense to tailor your setup and use a libraries-first approach. But if you do this, let's say in React, you need to make a lot of decisions up front. Do you want manage state? How? Redux? MobX? What about message buses? Do you want to use Flow? Just ES6 / Babel? TypeScript? What about routing? Lazy-loading? What about bundling? Webpack? Rollup? And so on.
Now, if you are part of a heterogenous developer team working in an enterprise shop, maybe you are happy to know that there is a framework that has made a lot of decisions already for you and prevents you from having to discuss the initial setup for 2 months, but at the same time is flexible enough to be adapted to your needs (I mean, this even applies to experienced front-end shops, there's nothing more horrible than endless discussions about shit like pure ES6 vs Flow vs TypeScript from senior devs). On top of that it uses patterns that you already know, such as dependency injection and annotations. While you personally might not feel at ease with this, many developers do.
1. The documentation is excellent. It's short enough to read in one sitting and comprehensive in that every option is documented without needing to resort to third party websites. When a new feature is added even in a minor version upgrade, that new feature is in the documentation (and marked as NEW). The search is also great and separates results into "Guide" and "API" categories.
2. Vue itself is extremely cohesive and user friendly. User friendly can mean many things. One of those is simply terminology. For example, in both Angular and Vue, templates can have child content. AngularJS and Angular use the terms Transclusion and Content Projection while Vue templates can have "slots": a term which doesn't require a CS degree to understand the intent.
The Angular documentation is simply not good: the organization, navigation, search, and writing style are vastly inferior to Vue's docs. Many sections are written in tutorial form repeating the same information (or mentioning important information in an unrelated section). It's hard to find what you're looking for and in many cases things simply aren't documented. For instance, speaking of Content Projection, it's a major feature and it's nearly impossible to find in the docs unless you already know ahead of time that it's called "Content Projection". I had to learn about it from a third party blog which made me question if it was even safe to use. There's even an open JIRA item noting this:
https://github.com/angular/angular.io/issues/3099
Other things that bit me recently were key modifiers in which the possible options are only mentioned on the github issue page (not in the docs).
> In the end, whether you use Angular, React or Vue is really secondary to what you build with it.
yes and no, you are also making a tradeoff at the learning curve of the chosen framework.
Some tools are harder than others, sometimes because they accomplish more.
Imagine if you'd said "one day into learning about homeopathy, I was able to prescribe homeopathy-things, but after 4-5 weeks of med school I was still taking classes about blood cells."
I'm not actually defending Angular as such, because I am super ignorant about it. Perhaps Angular is a byzantine mess. But there are many great tools which do not have smooth onboarding procedures, which are still valuable because of how they work on complicated projects.
Of course, the BEST tools make easy things easy and hard things possible. Angular might (or might not) make hard things possible, but I think everyone agrees it's not particularly good at making easy things easy.
I get your point, I removed the last statement, it was incorrect. the thing is, I wanted to state that Vue is super easy to use, now, if it is a toy or a serious framework is upto the programmer to decide :-)
I am hardly an expert on either Angular/Vue to recommend them based on their internals, I stated my experience, of course, the final decision depends on those who choose one framework over another.
1. Angular 2 is not object oriented in the standard meaning of the term: it does not rely on inheritance or polymorphism that much.
But it does rely on classes as the backing structure of your UI components. In other words, they tried to create a platform for creating widgets that compose. And more or less succeeded.
This is a tried and true pattern that has been used to create complex user interfaces since forever. I would wait a while before claiming that this stile is obsolete.
2. Angular 2 is quite functional.
Decorators in Javascript are just higher order functions (like python I guess). They look like like Java's annotations, but work in a completely different way.
They made streams (RxJs) the standard way of working with data.
And pipes are also a functional construct.
3. There are some good things to say about their routing module too, but I have to go.
Anyway, my opinion is that Angular and React address different needs and there is definitely room for both of them.
I will never go back to using a framework with an approach like Angular. Trying to abstract away the browser environment and have developers learn a whole new set of APIs with nearly the same level of complexity is just a fundamentally bad idea.
JSX doesn't do any abstraction. Unless you're using React Native, you're writing HTML, just that JSX turns it into `React.createElement(...)` calls.
The VDOM is kind of an abstraction, as React Native can use the same reconciler as React, but the React (web) VDOM is just a tree of HTML DOM nodes that gets diffed against the component rerender output and the changes are applied to the DOM.
He doesn't have it backwards.
He means they're "opaque" abstractions, in the sense that they're the opposite of a "Leaky Abstraction"[0]. A leaky abstraction is one wherein the abstractions below it "leak" up and you have to keep multiple abstractions in your head at once. This happens more with Angular than React.
I see what you mean by calling it a transparent abstraction though, since React's abstractions get out of your way and let you directly think about the lower level. This doesn't really fit with the Leaky abstraction analogy though, but it's a great point.
[0] https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-a...
However, to me it's not really that Angular is bad in itself, it's more that the alternatives (React/Inferno/Preact combined with redux or MobX) are just superior in so many ways, and by a huge margin.
Once you've done React with TS/TSX, with type checked components all the way, great code completion, incredible performance...it's hard to go back.
Angular's components would be ok if React didn't allow you to declare functional components in just a few lines of code, create HOC to decorate exiting components, etc. Angular's components are certainly better than Angular 1's but when you compare it with what you can do with React it just can't compete.
Honestly, from my experience, there is not a single thing that Angular does better than React and friends. Not a single one. It does things better than Angular 1/Ember/Backbone but that's it.
I think this is a bit like the solar/renewables revolution that is happening in energy. There are more efficient combustion engines, filters and whatnot, but when you compare them with the other paradigm, it falls short.
My company uprooted a few months of React development because Angular (2) comes with batteries included and we wouldn't have to rely on third-party stuff to fill in the gaps. The amount of stuff you get is... not actually that much, but it's enough to sell it. Of course, our new package.json is just as long, if not longer using Angular than it was before, and I've spent arguably more time doing setup (before @angular/cli stabilised) than I ever did with React. The whole @angular/router situation with module loading is silly, who wants to load modules via strings? Yes, the default batteries-included parts work with each other very well for the basics, but what about power and flexibility?
React could go a long way in this regard just by having a few more official ways of doing things and offering a few tools straight up (a @react/router for instance) while still selling the just-part-of-a-wonderful-ecosystem thing. React is so much better at satisfying real development needs, like the hyper-extensibility via functional composition and the super-DRY code you can get out of it very quickly, that proving its worth in ways that are only superficially important would be well worth it.
It comes down to this: What is the relationship between your code and the 3rd party code? Are you calling it, or is it calling you?
If most of the code you write is extending some 3rd party code, e.g. React.Component, and most of the time your code is being executed by the 3rd party code, e.g. as render() calls, then what you have is a framework.
React and its myriad extensions may be as great as people are saying, but this insistence that it is a "library" only serves to make the community look delusional.
React is 4 years old.
Vue is 3 years old.
In React it is a breeze to make Higher Order Components to connect to a store and it also makes it much easier to separate those smart components from small reusable presentation components.
I have seen people shy away from making smaller components just because Angular makes it so damned painful to make components. It is just easier to stuff everything in a template and copy paste everything around, which leads to a serious case of spaghetti code. I am happy for you if you don't have to work with something like that. I do, and I can tell you it is not nice in any way.
I am rewriting a React/Redux app I wrote to Angular 2. It's more readable, the control flow is easier to understand, and it's better to work on as a team. Instead of reducers and action creators, I have services separated into their own files. It's much easier for me to manage the work of others on the team.
Golden cage then eh?
Nah, I'd rather go with polymer instead which is much closer to DOM and is a small library indeed (It's not like redux is working only for react).
And without polyfills I'm looking into 15kb download for users, instead of react + reactDOM behmoth.
I can't wait for someone to add JSX+VDom support for polymer (for the folks who like that approach).
F# has Fable that compiles down to Javascript, OCaml has BuckleScript, and the new kid on the block, ReasonML. I've read about one or more production websites running in these what we'd call esoteric choices. (Add Elm and PureScript to the mix)
There is increasing adoption in the web for both Typed FP through these languages and Untyped FP through ClojureScript. Non-FP communities on the other hand don't seem too keen on the web. Ruby for example has Opal, but with the pace at which Javascript is getting better, porting similar languages just for their familiarity doesn't seem to generate the same kind of excitement as transpiling from a more powerful one.
And once Web Assembly becomes viable and browsers are free from Javascript (except for being the lowest common mass adoption denominator), we'll be able to choose our languages just like we can when programming for any other environment. It'll be a Wild West out there, but in a nice kind of way.
Javascript is more of a 'Prototype' based language. They call things 'Object's but I've seen few portions of JS code that actually use OOP in the traditional sense (encapsulation, polymorphism, etc)[0]. Mostly objects are just used for namespaces for finding vars and functions.
Agreed on the frameworks versus libs.
I would recommend that you work on a large codebase in a statically-typed language for a spell. Duck-typing is great for a shell script or blog post but things may be different when refactoring 100k lines of code, finding references, etc.
[0] Yes I know about the JS 'library' 'pattern'. That's more gymnastics than encapsulation.
You probably mean "inheritance", which is a way to achieve polymorphism, not a synonym for it.
https://en.wikipedia.org/wiki/Polymorphism_(computer_science...
The general idea is that you can have one expression dispatch to many different concrete implementations depending on the context. Virtual function calls is one approach, but C uses function pointers, C++ uses templates, dynamic languages use duck typing, several languages use message passing, and so on.
Personally I'm one of the apparently rare breeds that hate angular but loves typescript. I wish there were more of us.
They're really in different realms and please don't make them part of the same whole. Typescript is a transpiler but the transforms it does are designed to mimic accepted JavaScript idioms.
When I'm debugging typescript it makes sense, it looks almost like JavaScript written by somebody that knows what they're doing.
Contrast that to Babel, Closure compiler, and countless others that produce "JavaScript" that reads more like assembler.
Typescript is easy to make back into human readable JS and it's equally easy to slowly transform your JavaScript into typescript.
It's the most forward and backward compatible language transformer I've ran across so I don't appreciate you shitting on it :)
TypeScript is an invaluable, mature technology that provides large productivity boosts to any team that maintains a mid-sized code base.
It plays extremely well with React too, and it's benefits are independent of the tech stack. If you are used to typed components/templates, you will NEVER want to go back.
I would argue that is more important to have static typing in the front-end compared to the back-end in a web-application context. There is more state, lot's of shared entities and unit tests are expensive to write and maintain.
Good point, but only to an extent: Unit tests boilerplate in dynamic languages that is redundant with static typing is only a (minor) subset of unit tests that you should be writing for your code. Static typing is not an excuse to skip unit tests altogether. I've unfortunately met people claiming exactly that...
I retried using Typescript 1 month ago. Compiling took 6-7 seconds for about 8 files. I could not find a solution and gave up using TS. I hope that's just me doing not good enough research.
Plus you can do some cool things like Component inheritance.
I've never tried Flow, but I guess it's practically the same.
Looking at both A1 and A2 has confused me, so might just try React and see if that is more compatible with my ageing me. :) Nevertheless, I also really like the looks of Typescript. Could your possibly recommend a(n opinionated) way to get started with the two?
Of course the whole web stack is a new thing. Angular makes web app development much more productive.
React is a lot less abstraction and feels more natural to people that started out making UI with plain HTML.
Each has its merits but Angular uses way too much magic for my taste to make the web seem like something it's not. Much like a client side re-imagination of webforms
We're in the phase of the hype loop where everyone assumes language designers from 15 years ago are idiots. In another few years everyone will be talking about the revival of OOP
That said, if someone thinks language designers from the past are idiots, then they also shouldn't like functional programming, as it's at least as old.
you seem a bit committed. is this an emotional thing?
> there's a good reason most...
is there? is this reason related to languages themselves or their use? does it necessarily imply anything specific about "functional style"?
This is a HUGE red flag if you're seeking employment long-term in the tech sector.
Anders Hejlsberg has done a brilliant thing.
I'm also always a bit sad that Knockout seems to be overlooked a lot. It is not as opinionated but often times exactly the right tool for the job.
Frankly, I don't know if I can say the same about all the other libraries/frameworks/etc since every month there is something new that's supposed to make all the other competing tools part of ancient history.
There's literally no reason to not use typescript
What I like most with React over Angular is that it seems like it cuts to the core of the problem I'm actually trying to solve here. It just feels like a lean, clean, proper solution to the main issue at hand. (this of course helps with dev adoption too because it's easier to find people knowledgeable in lean frameworks, or at worst much quicker to train them)
I've been using TypeScript with React now for about six months - prior to that I was working on a large React/Redux app written in ES6 using Babel.
In my experience, I have seen a significant increase in my productivity after embracing TypeScript. With the static type support I am fixing/avoiding more errors at 'authoring' time due to intellisense and the VSCode editor flagging what will be compile errors. I am able to refactor across files with a lot less fear.
The advanced types in TS (specifically discriminated unions) make Redux actions and reducer code a lot more maintainable.
Overall I'm very pleased with the transition to TS. I spent time learning Elm last year and simply fell in love with that development experience. For reasons out of my control I cannot use it in production but with my current TS+React approach I can at least get close to what Elm offers.
(And I happen to agree with him on angular being confusing and not well designed)
I really like the idea of Typscript, but now... now I guess back to the drawing board on what to learn.
Then 3 minutes into a Angular 2/Typescript lesson I read that. But point taken.
I think I will stick with Angular and Typescript purely on the basis that it seems to have better integration with .Net core etc. I say all of this from a huge point of ignorance and just what I could gather from an hour or so of research online.
Edit: Changed to single toe.
You will still be able to use redux/whatever with it.
I'm sure the Angular team are great people, and they're clearly talented devs... but stay away from Angular.
It doesn't help with the problems you will actually face. Typed Javascript is a cargo cult. Angular just plain confusing for no apparent benefit. Dependency injection is bizarre. The distinction between modules, components, and directive is unnecessary. The Javascript community in general is moving away from OOP towards functional programming, but Angular has hitched it's wagon to OOP. It's reliance on the decorator pattern is maddening. It's view layer performance is sub standard. It's opinionated in all the wrong ways.
And I say this as someone with a lot of experience with Angular 1, Angular 2.
Trust me, go for libraries over frameworks every time. Redux, React, Immutable, Sagas, and reSelect. That's the future of web app development.