Hacker News new | ask | show | jobs
by another-cuppa 2824 days ago
I'd been out of the loop of frontend Web stuff for several years but I tried Vue.js because I read here and elsewhere that Angular was a mess. I just couldn't stand the weird hybrid html/css/js editing. At no point did I feel I had the slightest clue what was going on and it felt like I wasn't supposed to ask. React felt much more natural to me. Is there any way to do stuff differently with Vue or should I just stick with React?
9 comments

This one was pretty good and goes into deeper details instead of just claiming x is better than y: https://medium.com/@swizec/some-thoughts-on-vue-after-deploy...

The fundamental difference between React and Vue is vision. React bets on functional programming and moves closer to reaching its goal, perhaps shedding the last OOP parts some day.

Vue follows an older paradigm, Angulars basically, but with React underpinnings. It's heavily inspired by OO templating, pseudo code mixed into html. Perhaps the gravest difference if you come from React is that it encourages mutation, to an extent that now forces it to maintain two incompatible versions going forward due to IE11's lack of proxies.

I’m the exact opposite. I took several React courses and wrote a few apps, but it didn’t click. My mind would bend but fail to fully wrap around, if that makes sense.

In comparison, within 10 minutes of reading Vue “getting started” docs I had it up and running and everything just... made sense. I have been using it for a year and a half and haven’t looked back.

You can skip both, and most of the churn by taking a look at https://mithril.js.org . It's one of the only frameworks I've seen that gets you 95% of the way while supporting you through the last 5% instead of getting in your way. It includes all the regular things you need (view, router, requests) while staying under 10kb and having better performance than those two. If you need any help at all, there's a super friendly community at gitter as well. Did i mention 0 dependencies?

If you want to give it a go quickly, just load up https://flems.io/mithril .

Here's a quick hello world. https://flems.io/#0=N4IgZglgNgpgziAXAbVAOwIYFsZJAOgAsAXLKEAG...

I have been using it for the last few years and found it to be the easiest simplest and fastest library to create an app with.
That looks really great. Bookmarked.

Shame the site is one of the rather large group of sites that assume everyone's default CSS is black on white text, though.

Well I'd be happy to make a pull request to fix it. What is your setup?
I use the option "use theme colours" in Firefox and therefore my default background is grey and default color is whitish. Basically, if you change color, make sure you change background appropriately, and vice versa. Don't assume background will be white and color will be black for everyone.
Curious: if React makes more sense to you, what would tempt you to stick with Vue?

(I work on React. Vue seems to make more sense to many people, and React to many others.)

I'm honestly shocked to see someone say they found React natural, but felt Vue was confusing.
>Is there any way to do stuff differently with Vue or should I just stick with React?

On technical side, not much.

But there are much more to it than just technical stuff.

Angular was great for big, organized teams, with spec driven development.

Separation of concerns and work was also great - having junior devs concentrate on templates and to spec written directives, while seniors deal with something more arcane.

But further they went, the more dogmatism showed up, and more it felt that they are effectively trying to invent their own language. Remember the famous "you are not doing it the Angular way!"

A big benefit of Vue is that China and big money are on the Vue train now. In China, companies are reluctant to use React.

In China, companies are reluctant to use React.

How come?

It's made by Facebook
How will they feel about Vue's new dependency on TypeScript, a Microsoft-owned technology?
Microsoft is still "kosher"
Does that really matter to them? Why?
Vue is really nice. I think a lot of the complexity, at least to me was wrapping my head around redux itself, which as you know is optional.

If next.js wasn't as nice as it appears to be, or nuxt was just as good, I wouldn't be looking at react for another project. The lack of plugins is "meh", the dev tools in React are pretty amazing. I haven't figured out a way to get a really nice stack trace in the browser for an error in Vue, react does this much better.

Experience in Vue (2.5 years and continued, 1 shipped SaaS, fairly large internal project) React (1.5 years off and on, big ecommerce furniture place)

>At no point did I feel I had the slightest clue what was going on and it felt like I wasn't supposed to ask

what exactly do you mean? you didn't understand the templating language? you didn't understand the data model? you didn't understand webpack? what does "i didn't have the slightest clue what was going on" even mean? do you know what gcc does when it compiles your C code to assembly? is that the resolution at which you'd like to know "what's happening" ???

It's hard to explain. I know how the web works. I used to write HTML in Notepad many years ago. With Vue I just didn't know how the stuff I was writing was turning into the stuff that the web browser actually sees. React is just a JS library that you can add on to your HTML and CSS and makes sense in the standard model.

I guess with Vue I just don't feel in control any more, and that's a big no for me.

It's usually React that people complain about.

If you like jQuery, you should like vue. Cause, you can use vue just by adding a script tag in your web page.

You don't need command line, web pack or any other tool to use most of vue.

You can do that with React too.
React is a great framework, the only thing I couldn't find is a great solution to have runtime templates. I know they're not optimal but for some small projects it's better to eliminate the build step. Of course no one in the right mind would manually write render functions.
I figured that's what he's doing with React. He probably stumbled upon complicated Vue tutorials.

edit: Sorry. Didn't know I was replying to you.

If you're happy with React, by all means continue with it. If you want to understand Vue, then get simpler articles/videos and ignore the unnecessarily complicated ones.

I guess with Vue I just don't feel in control any more, and that's a big no for me.

I understand your feeling, even though I don’t work in React.

I worked for a company that brought in a new guy who was all hung-ho on Vue as the new hotness. He managed to convince the project manager that we had to convert the entire site to Vue.

I was never able to wrap my brain around the fact that so much of it was opaque. You just had to trust that A would lead to B would lead to C. And when it didn’t, even the Vue evangelist couldn’t untangle it.

As I’ve explored more and more languages and frameworks over the years, some I immediately grok, and others just never make sense. I think some programmers, brains are just wired differently than others. It’s too bad that there’s this undercurrent of tribalism and brand loyalty in the industry.

I understand that because of some of Vue default conventions (like webpack and single file components). But i'm building a simple architecture to build Vue apps without the need to compile your scripts, you can check it out here:

https://unpkg.com/@arijs/vue-generator/outra/pagina/index.ht...

https://github.com/arijs/VueGenerator

I'm not sure what you call "hybrid html/css/js editing". Vue components are stored in single .vue file (newer angular versions also default to SFC). Within said .vue file, HTML/CSS/JS are very obviously separated. Scoped style and templates are very easy to reason about and manage, IMHO, as an underqualified front-end developer.