
Scala has a reputation for a language with which complexity lies in from different angles: the entry threshold is higher than that of Java, and developers are much less (so it can be more difficult to assemble a team). As a result, Russian companies rarely decide to use it. But Tinkoff.ru has been actively using for far from the first year - and we decided to ask the company how, in practice, they live with Scala. Since the difficulties can be both technical and personnel, questions were asked to two different employees: the head of the software interface development department
Roman Dokuchaev and the head of HR projects
Olga Shpuntenko .
Roman Dokuchaev
- The first question suggests itself: why did the company make an unobvious choice in favor of Scala?')
- The reasons are many. First and foremost is the ability to write simple, concise, expressive and asynchronous code. At the same time, you can easily reuse ready-made Java libraries, which is important when solving issues of integration with other systems, especially the enterprise class. Most often, people who are carried away with a lively mind come to Scala, so it turns out to gather very creative and cheerful teams. At the exit, we get a greater development speed, fewer bugs, and we keep large loads compared to other languages.
- Here, many will want to argue that the concise code does not mean “simple”: the Scala code is sometimes called “a set of boxes”, and the language itself is called complex. You have no problems with the fact that new employees find it difficult to understand the existing code?- Indeed, not everyone just rebuild the thinking on the FP. But for those who succeed, a new world opens up with unicorns, rainbows and a minimum of pain. As for the squiggles, I agree, but few of them use them. Almost everything has clear letter expressions. New employees usually have no big problems.
- In the “Debriefing” podcast , you said, “Go is too primitive, and we have a financial service - fault tolerance, performance”. Then someone may also argue: "But after all, Go does Google, and they also have resiliency and performance." Why consider Scala "faster"?- The question is rather not how much one language is faster than another, but how much it is suitable for the implementation of a particular task. In some places, we have a very complex business logic, taking into account many integrations. If you implement it on Go, you get a lot of code that will be difficult to maintain. Over time, as new cases appear, the code becomes even more complicated, especially if many developers write it. More code means more bugs and more likelihood of non-optimality. From here and losses in fault tolerance and performance.
- If startups can afford to experiment, then a responsible large company should use proven tools. In the banking sector, responsibility is high, and Scala is considered to be a “young competitor” in relation to Java - does this bother you?- For more than 6 years, production at Scala has proven to be a reliable and suitable language for our tasks. Many FINTECH companies in the world have been choosing Scala for a long time. Recently, it is typical for Russia. To make sure of this, it is enough to enter “Scala” in the search on hh.ru.
- Opponents of Scala say "compiles for a long time" - but for you it did not become a sore point? Can you give a specific example of what happens on your projects?- Indeed, Scala compiles slower than the same Java, especially when shapeless and macros are actively used in the project. But microservice architecture allows not to notice a strong difference.
If we talk about metrics, then the project in 6000 lines of Scala code, taking into account dependencies, is compiled and assembled in 70 seconds.
- Since Scala allows you to do the same thing in different ways, do you have your own guidelines?- There are, and they appear in an evolutionary way. If a controversial situation arises on a review, a vote is created in our Scala chat in Slack, and the team chooses a rational approach. Further, the result is recorded on the tablets in the wiki.
- Does using Scala cause you to “cycle” more often, while you would use ready-made Java solutions with Java?- Recently, many “correct” asynchronous Scala libraries have appeared. Previously, you had to use Java-analogues, or in rare cases, write something different.
- And from this something of yours open source?- We try, but, unfortunately, for security reasons, not everything is in open access. A safe toolbox opens, like
DSL for Aerospike .
- Scala is more popular abroad than in Russia - does this mean that you have more contact with the world community than you would with Java? Do you go to foreign Scala conferences?- Indeed, Scala-stack in the world is much more common than in Russia. But this is not a problem, developers rarely have problems with the language, and besides, we all communicate with code. If we talk about specialized conferences, we try to send someone to listen to or speak to the largest of them every year.
- Tinkoff.ru uses Scala is not the first year - and what has changed during this time in the company using the language, what are the trends?- Every year we find Scala more and more applications, from microservices to big data. Even testers use it to automate their processes. I am sure the trend will continue.
- During the time that you use the language, a lot has changed in the industry: for example, Kotlin recently addressed the asynchrony issue that was important for you with the help of Korutin. If you were just starting now, would you still choose Scala, or go some other way?- Kotlin has also been gaining momentum lately, but the language is still very young. Moreover, when choosing a platform for the implementation of specific systems, in addition to its capabilities and prospects, the number of developers available on the market is of great importance. There are more rockers on the market. If we started all over again, we would certainly choose Scala.
Olga Shpuntenko
- How many developers in Tinkoff.ru, and how many of them write on Scala?In total, we have about 600 developers across the country, 70 of them are rocky.
- Since there are far fewer Scala developers than Java, to look for such is a pain, and you have to “grab at everyone,” or not?- We do not hire everyone on the keyword Scala or Java in the resume - the candidate must still undergo a technical interview. In addition to the fact that Scala is not a very popular language, it is practically nowhere to learn. In universities, this is not taught, even Java is still taught a little - all in C ++. There are several class courses on Coursera, and everything is limited to them. And from a small number of people who master the language themselves, not all are interviewed.
But at the same time, we cannot say that the selection of rocky is a pain. Yes, there are no queues under the windows of those who want to write on Scala, but interest in functional programming in the IT community is growing every year (and not only in Moscow), and this is good news. There are not many companies in Russia that use Scala, but they exist. And we are pleased that Tinkoff.ru is associated in our country with functional programming.
- Does your Fintech School , where there is a Scala direction, help you cope with this “nowhere to master”? What part of its graduates still work for you?- Yes, we made Scala one of the courses' courses for a reason. The participants of Fintech Schools work not with abstract, but with quite real technical tasks, and immediately find out how the processes in our company are built. And we are improving the school's programs, we are learning, we are experimenting, and, as a result, we get more graduates who are more prepared for solving real problems: every new school graduation turns out to be better and better. As a result, 80-85% of graduates remain to work with us.
“You have Java to Scala jobs, and this is another promising way to get rocky: take javista and finish teaching. And how much scale and effective channel of getting Scala-developers did this become in your case?- In our case, the channel is quite large: more than half of the rockers at the time of starting work in the company were javistami. We learned to retrain javistes to rocky in a fairly short time, in just a few months. For those who want to retrain, this is a good opportunity to learn a language right now, which will be popular in two or three years, and get paid for it, and not do it in your free time “on the knee”, when you have no one to ask and no one to correct and direct in the right direction.