Live data from Hacker News

State of JavaScript 2019

2019.stateofjs.com

241–250 of 372 posts

Re: State of JavaScript 2019

#241

Earlier quoted context omitted.

I think that for a lot of people, SPA + API is just the default, even though most of the time you can get away with a traditional MVC.

Even then MVC is almost always far more than needed to get the job done well... as are most frameworks. I have noticed in the big corporate space many people writing this code are formally educated to write code in a very specific way that isn't quite JS-friendly and they need the extra boilerplate to make JS behave.

I see some of my colleagues (mostly front-end devs) don’t even know how to write code that’s not SPA + API, it’s pretty sad. It over complicates every project, and like you said, MVC in most cases is enough.

Re: State of JavaScript 2019

#242
post #225

Earlier quoted context omitted.

It's not just the people, some topics leads to that. E.g you can get far with just a few git commands, but one day, you will encounter a situation that is like a brick wall because you have no idea what's going on inside. Today, most JS devs don't know how "this" works, most python devs never used pdb, most git users picture a branch like a diverging chain of commits and not a moving label, etc. Again it's not the pe…

> most git users picture a branch like a diverging chain of commits and not a moving label Ok, I'll bite: can you explain that little more please?

A git repository is best thought of as a sort of tree, where the nodes can potentially have multiple parents. This technically makes them a graph ("directed acyclic" to show I do know the technical terms), but our human intuition will mostly work thinking of them as a tree. To understand multiple parents use your intuition about human beings, since we all have multiple parents.

A "branch" doesn't really have any special status in git. All it is is a pointer to a particular commit. Literally, that is all it is, even in the data structures. It has no additional ontological existence beyond that. When you make a commit to a "branch", all that happens is that git moves the branch marker along to the next commit. All of the "specialness" of a branch is what is in that behavior.

You can do anything you want with that branch marker, such as yanking it to a completely different part of the tree via "git reset --hard $NEW_COMMIT", and while you may confuse humans, you haven't confused git in the slightest. On the flip side, since branches don't actually "exist", it is perfectly sensible to "merge" with a direct commit hash, because that's all a branch is; a pointer to a hash. You can pick up that pointer and drop it down where ever you want.

(A tag is the same thing as a branch, except that when you're "on" a tag and make a commit to it, git does not advance the tag. But almost all it is is a pointer to a commit. Technically it can carry a bit more data, like a signature, but as far as the core structure is concerned it's just a commit.)

I am not the original poster, but I have a training I give at work for git, and it is heavily based on making sure this understanding is presented. (The other reason I wrote my own training rather than reusing any of the many other existing ones is mine makes sure to walk the trainees through the confusing states you can get into, then we explain what happened, why, and how to correctly get out of them. They follow along as we all manipulate a repository, and the training actually spends quite a bit of time in a "detached head" state, checking out, merging, and resetting to commits directly.)

Re: State of JavaScript 2019

#243
post #166

Earlier quoted context omitted.

I continue to be involved in development of a Meteor app that started in the 0.8 days, and has been actively maintained up to current versions. I'm a little sad, too, that "Meteor" as a technology all its own hasn't developed legs, but honestly, at this point it's a build stack and little more. Once you use React over Blaze, all it really offers you is a build process and a lack of need to set up your own GraphQL API…

Meteor 0.8 was released in 2014, and I'm sure your app would still work on the latest Meteor release without much changes, while in the meantime offering all the latest JS features (JS in 2014 was a completely different world). How many other JS build tools & frameworks from 2014 can say the same?

Good lord has it been that long?

It's on Meteor 1.6 now, and you'd be mistaken about "much changes". Blaze to React was a nearly a rewrite; Atmosphere packages to npm was a significant change for the internal dependencies we developed; removing the custom file loader itself that preceded Atmosphere packages meant touching every single file.

The original code might have still worked, but the code would be helplessly outdated and stuck on a dying platform's technologies. As it is, though, the extensive and continuing effort to update the code means that now, we have a React/node app with an idiosyncratic webchannel connection to Mongo and a build process that's outdated but manageable, and still under active development of new features.

I credit the Meteor Development Group with recognizing that the stack they wanted to lock people in on, wasn't going to work (Blaze, Atmosphere, Mongo) and providing a paced transition off those pieces early on. But if we hadn't kept pace, we'd have a half million LOC app that would be termed "legacy".

Re: State of JavaScript 2019

#244
Some of the data visualizations seem... strange. For example, on this page: https://2019.stateofjs.com/front-end-frameworks/

We see React go 93/93/91/89, but the 89 circle is higher than 91 and at the same level as 93?

We see Vue go 87/91/91/87, but the second 91 is at a higher level than the first and the 87 is way below the first 87.

It seems like the React line should be straight, then dip down a little bit, then dip down a little bit more.

The vue line should go up a bit, then be straight, then dip back down to the original position.

Re: State of JavaScript 2019

#245

Wow, 39.9% of respondents mark themselves as "Expert" at CSS. I've been doing front-end in various guises for 12 years and I would only rank myself maybe 5 or 6 out of 10. As I've gotten more experienced in my career I've become more aware of what I don't know as opposed to what I do know. It's funny that "Advanced" is mastering animations and transitions whereas "Expert" is being able to develop a full-front end con…

The description of "Expert" in the survey probably caused this. "Expert: Being able to style an entire front-end from scratch following a consistent methodology" Meanwhile, "Advanced: Mastering animations, interactions, transitions, etc." I can certainly "style an entire front-end from scratch" without "mastering animations".

You're absolutely right. I'd bet the CSS experts understand the context of the question and the difficulty involved in "styling an entire front-end app from scratch with consistency." I think a lot of novices looked at that and thought it meant using one of the css grid / framework libraries and making a website. The question hides how difficult that actually is with CSS and how easy it seems if you've never had to do it.

Re: State of JavaScript 2019

#246
post #166

Earlier quoted context omitted.

I continue to be involved in development of a Meteor app that started in the 0.8 days, and has been actively maintained up to current versions. I'm a little sad, too, that "Meteor" as a technology all its own hasn't developed legs, but honestly, at this point it's a build stack and little more. Once you use React over Blaze, all it really offers you is a build process and a lack of need to set up your own GraphQL API…

Meteor 0.8 was released in 2014, and I'm sure your app would still work on the latest Meteor release without much changes, while in the meantime offering all the latest JS features (JS in 2014 was a completely different world). How many other JS build tools & frameworks from 2014 can say the same?

Not exactly a framework, but a React app from 2014 will still work great in 2019 and can be updated with very little pain.

Build tools wise, a simple Webpack/Babel config from 2014 would be relatively straightforward to update to the latest versions.

Re: State of JavaScript 2019

#247
post #225

Earlier quoted context omitted.

It's not just the people, some topics leads to that. E.g you can get far with just a few git commands, but one day, you will encounter a situation that is like a brick wall because you have no idea what's going on inside. Today, most JS devs don't know how "this" works, most python devs never used pdb, most git users picture a branch like a diverging chain of commits and not a moving label, etc. Again it's not the pe…

> most git users picture a branch like a diverging chain of commits and not a moving label Ok, I'll bite: can you explain that little more please?

Of course. Someone explained it to me, after all.

In git, a branch is NOT like a wooden branch on the trunk of a tree, although it ends up being at the top of one, which makes the analogy ok.

A git branch is the same thing as a git tag, except it moves automatically when you commit from it.

You can see it as a lightweight label attached to a commit. If your HEAD is itself attached to a branch (HEAD is also a lightweight label, but this one is like a red sticker on a map saying "you are here"), when you do "git commit", the branch label is moved to the newly created commit.

Hence, you can have several branches on a single commit, and you can move branches around: they are just labels. You can also have branches with different names locally and in a remote, or have a branch with the same name, but on different commits locally and in a remote.

A branch is like a reference, it's useful to tell git what place in the history you are talking about, without referring to a commit in particular. It is a moving reference because the place in history you talk about is always changing: it's the top of a chain of commits, the ever changing last thing you worked on for this particular part of the history.

We want branches because they are a convenient way to say "I'm going to do something on the latest commit of this part of the history":

- "git checkout branch_name" => I'm now working on this part of the history, gimme all the latest stuff you got and consider everything I do is now related to it.

- "git checkout branch_name /file/path" => Get the latest version of the file from this part of the history and bring it on my hard drive

Of course, you can put a branch at a commit that is not yet the top of a chain of commits. But soon this commit will become the top of a new chain of commits because when you'll commit from this branch, a new commit will be attached to the previous one, diverging from the original chain, and the branch label will be moved to it. You now have a fork of two chains of commits, both of them having a different branch label at their top:

"git checkout commit_hash && git checkout -b new_branch_name" => I'm going to consider this commit as a new starting point and work from that.

In fact you can move a branch pretty much anywhere, create one or delete one at anytime, including "master", which is not a special case, just one created automatically on the very first commit.

This is also why if you "git checkout commit_hash" instead of "git checkout branch_name", git warns you you are in a "detached HEAD" (the "you are here" label is attached to a commit directly, not a branch label). Indeed, a chain of commits (the stuff that looks like a wooden branch on a trunk in graphics) can exist without a branch label. But it won't be convenient to reference: looking for the hash of the newest, latest commit, every time you want to mention it is tedious. Besides, git will run "git gc" automatically once in a while, deleting diverging parts of the history with no branch or tag, so you may lose this work.

This makes it clear that tags are labels like branches, only they don't move. They serve the purpose of having a static reference to a fixed point in time: both allowing you to easily talk about it, and let git know you want to keep this around.

All that stuff is way clearer with a visual explanation. For my Git training, I bought a fantastic toy for 10yo with magnets that let me build a 3D history tree and use post-its to represent branches and tags. It's instantly obvious. It's really fun, you can move stuff around and show what each command does to the tree. After that, git seems much more accessible, and you just grunt at the terrible UI ergonomics.

Re: State of JavaScript 2019

#248
post #150

I'm surprised to see Angular drop in ratings and rank so poorly compared to React. I personally prefer Angular myself because it's (a) opiniated and (b) has everything included (HTTP REST calls, Material UI, etc). Just curious why so many people prefer React and mark it so positively.

Maybe because React is small (API surface) and does (or is felt to do) “one thing”. It is easy to wrap your head around it, even without fully understanding, say, the Virtual DOM diffing. Angular is very different in that regard. I recently had to read up on how Angular applies changes to the DOM. It was extremely difficult to get this information at all. For me, React with TypeScript is king. It trumps Angular in th…

* Angular templates are typed, but until version 9 (coming out in a couple weeks, but I've been using the RCs and they've been fine), any variable created in the template itself was defined as `any`, creating gaps in the compiler's coverage. A vscode plugin provides IntelliSense.

* Agreed, this is an awful default and I don't understand why the Angular team hasn't already deprecated it. I suppose a slightly simpler "Hello World" makes Angular look a bit more approachable, but it just encourages accumulating unnecessary tech debt. The proper way to use Angular is to disable the magic (`OnPush` change detection) and use observables.

* Prod builds take a while and use a lot of memory, but local development is fine. (I haven't observed that prod builds are necessarily "slow" relative to what they accomplish.)

I like both Angular and React, but generally prefer Angular. The structure and universal consistency imposed by the framework and CLI are convenient (particularly when moving between projects or adding devs to an existing project), and the limitations imposed by Angular-HTML vs JS(X) are great for readability.

Re: State of JavaScript 2019

#249

Earlier quoted context omitted.

I'd say that the topic of "node.js" skill covers such a wide range of skills, experience and scenarios, that you'd need to be an expert already to judge how little you know. Someone who'd applied it to a single domain successfully can reasonably feel like they've got a good handle on it. Your question is essentially a proxy for server-side architectures and applications, not nodejs itself. It invites misrepresentatio…

I'm still not grasping how the question "what have you actually built with node?" is "a proxy for server-side architectures and applications, not nodejs itself." and "invites misrepresentation." I feel like you guys think I asked them to rate themselves 1-5 on the subject. I did not, I got their resume, where they themselves rated them on the subject. With my question I was just checking whether that self-assessment…

Sorry: I misunderstood slightly, thinking it was something you put to them. In our tech interviewing I ignore self-assessed ratings, finding them useless for the reason you do, but I don't hold it against them if they're inaccurate just for the reasons I outlined.

Re: State of JavaScript 2019

#250

I'm surprised to see Angular drop in ratings and rank so poorly compared to React. I personally prefer Angular myself because it's (a) opiniated and (b) has everything included (HTTP REST calls, Material UI, etc). Just curious why so many people prefer React and mark it so positively.

> Just curious why so many people prefer React and mark it so positively. For the exact same reasons you stated -- Angular is opinionated and has everything. React is just a framework - you get to make your own opinions and are not handed the whole ball of wax, so you can make your own choices.

When will this meme end. Angular is not crazy opinionated. The previous version more so, but it's really open to letting you do things in general ways. You want css scoped to your components? Sure. You want two way data binding? Sure, but wait you want one way binding? You go it. You can use rxjs, or you can avoid it.

There's some general ways to set things up, but it's nice to have a general approach to each project you encounter.

And the biggest thing is Angular wasn't designed to be used by a solo developer working on a side project. It's evolved to allow that, but it was designed with companies in mind. Multiple developers, multiple teams of developers, maybe with little communication to work together on single projects whilst allowing guide rails to keep things headed on the same track, but allowing many ways to move the track in a way that fits your style.

The idea that react is just a "library" (think you mixed up your words there) is absurd when you look at the majority of react in the wild. Using create-react-app, react router, forms library, animations, etc etc, and now look, you just pieced together a bunch of different libraries to form....Angular.

Post reply on HN