Live data from Hacker News

Why we moved from Angular 2 to Vue.js and why we didn’t choose React

medium.com

141–150 of 151 posts

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#141
post #30

Earlier quoted context omitted.

> It should take no more than 20 minutes to learn JSX. it should, but in practicality, for most front-end devs especially junior ones, it's not. Moving Angular 1 devs to Vue gets actual work going 3-4 times (anecdotal experience) quicker than with React. For most smaller shops/startups Vue is almost always a better idea - it's much easier finding devs (especially remote/<100k comp ones) with previous Angular 1 experi…

You are probably right that Angular 1.x devs will ramp up a bit faster in Vue than React. Angular and Vue both add template syntax to HTML, which will be more familiar to Angular devs. However, I do not think initial ramp up time should matter that much, at least not for long running projects. More important questions are: How will the project scale? How easy will it be to maintain? > React is overengineering for mos…

> This is a peculiar statement, imo. Have you compared the surface APIs of React and Vue? React's API is much smaller. While Vue might be easier, React comes off as simpler.

This 'simplicity leading to complexity' issue reminds me of the many articles that argue why Lisps aren't more popular precisely because they're so powerful/simple.

I'm not experienced enough to know if the argument has merit, but I have noticed that my React projects often end up rather complex because I need so many extra packages to even get a basic app going (beyond the simple Todo demo apps anyways).

The moment I add an extra package, it's yet another choice to make, and yet another thing that makes my project less accessible to others. Where I might use Redux, others might only have experience with Baobab, Fluxt, Nuxxor, FlimFlam, or whatnot.

This situation does seem to be improving: Redux seems relatively 'safe' and standard enough, for example, and then there's stuff like create-react-app. However using Vue.js is still 'simpler' by having a more standardized ecosystem.

While personally I've always preferred simplicity and love React conceptually, I've definitely become more aware of the drawbacks of having a less standardizes ecosystem to work with. And I can definitely confirm that getting people new to front-end development started is much easier with Vue.js.

I even have a suspicion that the logic-in-template stuff, my reasons for avoiding Vue and Angular in the past, is much easier to 'get' by those who are new to front-end development. I'm not entirely sure why, but it's what I've experienced with all my 'students'.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#142
post #41
post #12

I've been attempting to learn Angular2 and React, but haven't delved into Vue. Angular2 is just different, but it makes more sense to me than 1 if you take the time to learn the concepts. If you go into 2 thinking your 1 skills will translate, then I get why you'd be frustrated. But I found 1 to be very vague conceptually, so many different ways to do the same thing that you end up with many bad implementations. And…

> Angular2 is cake imo. Angular.X totally lacks of vision. For years it didn't know what it wanted to be, pilling up layers of layers of complexity with IoC containers (useless in a weakly and dynamically typed language such as javascript), Some custom HTML that even needs its own parser, Rx.JS (which is self sufficient if you use it, you literally do not need something on top of that). For what result? it's not fast…

The vision is finally having a good UI kit. Components, templates, lazy loading, isomorphic/universal JS, precompilation, maintainability, code discoverability, ease of team development, testing, etc.

Angular CLI does the compilation, provides the boilerplate management (no need for IDE, if you don't want that), provides the language service (for static checking templates).

Google dogfoods it, they are on the latest rc always. Somehow they can manage the API changes/breaks. (And so far it wasn't much problem for us either.)

I don't know if rx is now a hard or optional dependency, but at least they haven't NIH-ed another Observable lib.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#143

Earlier quoted context omitted.

OK, but I don't agree. I think it is valuable to separate your template and behaviors associated with it for exactly the same reasons.

it is valuable to separate, but why is it valuable to force a different syntactic layer, often with heavy constrains on what logic can be expressed which inevitably leaks back into various helpers implemented in the layer you've just separated yourself from? why is it not better to separate using mechanics native to your language?

Because what happens otherwise is you eventually end up with a whole program written in your templating language.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#144

Earlier quoted context omitted.

it is valuable to separate, but why is it valuable to force a different syntactic layer, often with heavy constrains on what logic can be expressed which inevitably leaks back into various helpers implemented in the layer you've just separated yourself from? why is it not better to separate using mechanics native to your language?

Because what happens otherwise is you eventually end up with a whole program written in your templating language.

Templating is a bad term, it implies string generation, which is only a subset of what presentation logic is or is about. Taking that into account - if your presentation language is your program's language - I don't see the problem.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#145
post #137
post #15

"We invested in a beta product and then shock horror - it changes before it's released. Let's blame the framework on that poor choice." "We were unable to learn how to use TypeScript properly, so let's abandon gradual typing and suffer a net loss in productivity over the longer term."

We actually implemented quite a big project with Vue/Typescript. Half year later we removed all ts code in favor of plan js.

I would like to read a postmortem article about your experience, and I guess many others would.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#146

Earlier quoted context omitted.

Because what happens otherwise is you eventually end up with a whole program written in your templating language.

Templating is a bad term, it implies string generation, which is only a subset of what presentation logic is or is about. Taking that into account - if your presentation language is your program's language - I don't see the problem.

But that is my whole point. I want templates separate from the rest of the presentation logic, not interleaved with it.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#147

Earlier quoted context omitted.

> I personally don't see any difference with doing a loop in JSX and doing a loop in HTML using special tag attributes. Don't do that. Perform loops outside of the final template. People get confused because they don't remember that JSX is just a tree of nested React.createElement function calls, so they decide that they should mix looping logic into a block of JSX because that's what they'd do in PHP even though you…

Do you have any specific reasons for why `items.map` should not be inside a jsx tag? Your comment doesn't make it clear why you think this.

> People get confused because they don't remember that JSX is just a tree of nested React.createElement function calls, so they decide that they should mix looping logic into a block of JSX because that's what they'd do in PHP even though you'd obviously not do that when looking at raw code.

Basically what I'm saying is, if you were just writing React.createElement function calls, it'd be more obvious that the items.map should kept out of the rendering code, e.g.

    const MyComponent = function MyComponent(props) {
        return React.createElement(
            "div",
            null,
            React.createElement(
                "h1",
                null,
                "List of items"
            ),
           React.createElement("br", null),
           props.itemData.map(function (itemData) {
               return React.createElement(Item, { data: itemData });
           });
        );
    };
Of course, this is a simplified example, but the more complex the template (i.e. the deeper the nesting) the more the code benefits from having loops and other control structures extracted from the final template.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#148

Earlier quoted context omitted.

Templating is a bad term, it implies string generation, which is only a subset of what presentation logic is or is about. Taking that into account - if your presentation language is your program's language - I don't see the problem.

But that is my whole point. I want templates separate from the rest of the presentation logic, not interleaved with it.

templates are presentation logic.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#149

Earlier quoted context omitted.

Do you have any specific reasons for why `items.map` should not be inside a jsx tag? Your comment doesn't make it clear why you think this.

> People get confused because they don't remember that JSX is just a tree of nested React.createElement function calls, so they decide that they should mix looping logic into a block of JSX because that's what they'd do in PHP even though you'd obviously not do that when looking at raw code. Basically what I'm saying is, if you were just writing React.createElement function calls, it'd be more obvious that the items.…

When a programming expression is made significantly more concise via some abstraction, it can be used in new ways that weren't reasonable before.

JSX makes expressing dynamic, declarative DOM markup concise enough that a short expression such as: `items.map(item => ` is no longer overly obtuse/obfuscating.

If the `map` expression becomes much larger, it might make sense to refactor it out in some way. But I would argue that the important guiding principle here is readability and modularity. Drawing a hard line between flow/control structures and "template code" is not useful, in my mind.

As others have stated in this thread, the more useful distinction is between business logic and presentation. Loops rightfully exist in both of those domains.

Re: Why we moved from Angular 2 to Vue.js and why we didn’t choose React

#150

Earlier quoted context omitted.

But that is my whole point. I want templates separate from the rest of the presentation logic, not interleaved with it.

templates are presentation logic.

That is why I said I wanted them separate from "the rest of the presentation logic" and not "the presentation logic."
Post reply on HN