Is Yarn still a thing?

Does Yarn still a good product? Let's figure it out
10 August

When npm@5 was just released this question was the first one I have googled. No doubts it comes to mind since new npm version introduced a lot of yarn’s features. In other words: should I still use yarn after installing npm@5?

Yarn features

Why do people use yarn in the first place? npm had some known issues. Well, we all have been there: downloading and installing packages for hours, resolution hell, not using essential --save and --save-dev by default, and many others.

When yarn was first released it solved many of these issues completely. It offered multiple improvements:

  1. yarn add saves a package not only to node_modules but also adds it to the list of dependencies in package.json. Think of it like yarn does not install a package into node_modules directory, it adds a package to your project
  2. yarn install worked in average from 2 to 3 times faster than npm installyarn changes how packages are downloaded and installed, that’s why it is so blazingly fast
  3. yarn install also checks for yarn.lock (or creates it), a special file where every single version is locked into a known state, what makes dependency resolution process deterministic
  4. yarn utilizes cache to make the installation process even faster. It is even possible to reinstall everything without internet connection when the cache is alive (saved me once)

This set of advantages at some point predetermined how the js package manager should look like. npm had to take the pace.

npm@5 breaks in

Keeping all that in mind the npm core team made a huge step towards the competitor. When the 5th major release was out a lot of people asked this question: should we still use yarn? The changelog for this release is inspiring indeed.

What are the key features that npm@5 brings to us?

Speed up: it is now competing with yarn and other package managers. Here’s a nice gif of the speed up, brought to you by one of the npm ‘s core members:

Determinismnpm now enforces the same workflow as yarn (and many other package managers). It generates package-lock.json to know what exact versions your project uses. It is worth mentioning that algorithms in yarn and npm differ. And npm has a solid advantage since it has better hoisting position across npm versions than yarn has across different version of yarn.

Sane defaults--save is now enabled by default. No more problems with that.

Cache: it was completely rewrittencacache and pacote living inside the new realization are fast and reliable. You can run this command to see it yourself:

git clone https://github.com/zkat/cacache && cd cacache && npm i && npm run benchmarks

Default toolnpm is the default. Everyone uses it. Earlier it was like IE: a browser to download another browser. Jokes aside, this point is strong. You don’t need to have this one extra custom package manager.

But, really, is yarn still a thing?

The answer is: it depends.

My first attempt to install something with npm@5 was with my the most favorite vue-starter which has around 850 packages to download. npm’s time was not bad at all with 42 seconds at the fresh run. When the cache is ready, it takes only 30 seconds to install everything.

Compared to yarn: 35 seconds without cache and 20 seconds with the cache in place. For me, this time gap was important enough to still use yarnas a primary tool.

But. Do not use both tools inside one team. It will lead to a disaster with package resolution and pollute your repository with extra files. Stick to something and use it.

Finale

npm is moving in a right direction (say hi to pip). It is pretty great already, but soon it will be even cooler. 

Provided by Elixir club.

N. Sobolev: "I entered Elixir in about 2 months"

Elixir-lang.moscow organizer, Auth0 ambassador, CTO at wemake.services, speaker at RailsClub 2017
11 October

Nikita Sobolev
Nikita Sobolev

CTO at wemake.services, organizer of elixir-lang.moscow conference, speaker at RailsClub 2017.

On the RailsClub 2017, we’ve managed to talk with Nikita about his report, his job and future of Elixir.

Tell us about yourself, who are you, what are you doing?

My name is Nikita, I write on Hype.codes sometimes about Elixir. I, basically, am now engaged at different conferences and meetings. I'm talking about what a cool language Elixir is and try to evangelize it in various ways. In fact, with a mercenary goal - I have my own small company called "wemake.services". We sell custom development to our customers. We want to sell Elixir development, because we like it, and we are happy to work with it. Therefore, my selfish goal is combined with disinterested.

How did you get into the Ruby ​​event?

In fact, I know that many rubists are switching to Elixir, and I decided why not even more Ruby developers could be dragged into this wonderful world of functional technologies. I applied for it, got the approvement, and here I am.

What was your report about?

My report was about the basics of Elixir, about its ideology, how to build the architecture of an application, about how you can write business logic, how it differs from other programming languages. I assumed that the audience knows Ruby, I know Python. They are similar enough, so it was a report for them. I hope it was clear.

What are your impressions of the conference?

I really liked it. Very good conference. One of the best this year, on which I was. Despite the fact that I never understood a single report.

How do you see the programming world in the next 10 and 50 years and is there a place for Elixir?

I think yes. I'm not ready to talk about 10 or even 50 years, but it seems to me that in next 5 years Elixir will have its own strong niche, connected with processing a large number of real-time applications, asynchronous requests. We hope to get fixed in this niche, together with Elixir.

What are the main pros of Elixir?

A low entry threshold, even though it is functional. I entered Elixir in about 2 months. At the same time, I did not know any functional programming language, and I can say that I still do not know. I write on Elixir, not noticing that it is from a different paradigm. This is a very great dignity. Elixir is gaining popularity very fast. Low entry threshold = fast popularity gain.

What are the main differences between Elixir and Erlang?

The main difference is syntax. Either way, they are very similar. They have common pros and cons. But Elixir really has a much more pleasant syntax. To us, those who are used to writing in Ruby or Python, this approach is understandable and does not cause any rejection. We can start writing on Elixir the same way as we write on Ruby.

Recently, the IT field for employment has become very popular. Which advice would you give advice to the average "IT specialist" to stand out from the crowd?.

You can stand out the crowd with 2 things - work hard and learn, and talk about yourself, talk about what you can do, share knowledge with others. Thanks to the combination of these two factors, you can achieve a lot.

Do you have any plans to write a book? Or maybe you are already the author of some book?

No, unfortunately, I did not write and do not plan yet. I do not know what, I do not have those that I could put in the book. But I hope that someday they will appear and I would not be willing to write anything fundamental.

What in your work makes you truly happy that brings inner pleasure?

We, as a project team, are always happy when we finish the project. We have a whole day of happiness. Similarly, we experience stress, if the project goes wrong for some reason, and when issues are fixed, as a result, happiness becomes even greater. But we also need to feel the process - when we write what we like, when we make a very high-quality product, we get pleasure not only from the result, but from the process. And in fact, it's even bigger pleasure. Since we sometimes work with large corporate or governmental clients, result is not visible. And the process is remembered and remains forever.

Elixir is a young language, and there are very vacancies and elixirists in the labor market. How to increase the number of Elixirists? And how do you think, when there will be enough of them?

In fact, I believe that there won't be many Elixirists. Elixir is a very niche language. It is not a general programming language. Its concept and features allow it to become a very good niche tool. At the moment, amount of vacancies growns on the wave of hype. There will never be the same amount of vacancies as for Pythonists or Rubists. But, I think that there will be more of them in a whole.

Do you have nightmares related to your daily work?

Of course. Whenever someone calls me, I think the server crashed. But, in reality, I don't have nightmares. Sometimes when I go to bed, and read something before, or watch a video or a report, and I don't want to fall asleep, but I want to try something cool. So I have to force myself to say sleep. It happens.