📜 ⬆️ ⬇️

Scala is worse than Java. At least half of Java projects

So, in my post (comment. Per. Yes, Virginia, Scala is complicated! ) I agreed that Scala is too complex for most Java developers. That post caused a lot of discussions, most of which distorted its meaning. Now I am writing again, hoping to clarify what I was actually talking about and why I need all this.

But first about me. My name is David Pollack. I have been an active member of the Scala community since November 2006. I am the founder of the project Lift.
A few more important points worth mentioning are:

All of the above can be summed up: “I have considerable experience in coding on Scala, teaching Scala and presenting Scala to a wide variety of people and organizations. I communicated with enough people who use Scala or are going to do it in order to accumulate a large amount of data to analyze the success factors of Scala. ” This does not mean that I believe that I am right, and everyone else is wrong. But this, however, suggests that people who use rhetoric with the transition to the individual as an argument - do not have weight in this discussion. [Update: re-reading the post fogus ' ah ... I misunderstood it. I think fogus and I came to the same conclusions. I remain unconvinced, not declaring it to be the ultimate truth. However, I apologize for the rigidity of fogus ' and his post!]

After all this preparation, let me express my conclusion:

This statement is no more debatable than:

Although I said “Scala is hard for some developers” in my previous post, I will be much more specific this time. I'm not saying that I find Scala difficult. However, I see a lot of developers for whom Scala is complex and presented his reasoning here and here . For this class of developers, the cost of Scala outweighs its benefits.
')
Discussion

One of the things I'm particularly weak about is spelling. My brain just does not remember the spelling of words. When I was the editor of a student newspaper, one of the journalists threw a phrase in my face that only lazy people did not know the spelling (it was 1985 ... until spell checkers). I wrote an integral on the chalk board (this was before the white boards) and asked to solve it. She said: "This is mathematics ... it is difficult ... And I am talking about such a simple thing as spelling." Well, as for me, I can solve the integrals in a dream, and I cannot correctly write the word even if my life depends on it. Different people have different skills.

Different people value different things. There is a whole class of people who love computers and love to write code. I am among them. And there is a class of people who would not put programming in the top 5 of their favorite activities.

There are many programmers who have chosen a career in software development, but do not have a certain combination of innate abilities and desires. There are schools that develop these abilities and give motivation. But no blogging and bragging can change that.
For those who lack innate coding abilities and interest in personal growth, Scala is burdensome. And if too much of this burden on Scala will be around (read - failing Scala projects), Scala will stop growing, and this is a serious suboptimal situation for people like me who invested more than $ 600,000 into the Scala ecosystem. Read more about the motivation at the end of the post.

One of the key arguments against my post “Virginia” was that we should use all Java developers as they are, because Scala is not so good as to cause a significant increase in the overall level of these programmers. I quote myself:
I agree with Paul Snively that Scala can be learned . That is why I have been actively promoting Scala for many years. The thing is that Scala is studied by a certain kind of people . This view does not include those who do not want to learn, and those who lack the ability to do it (just as there are those who can write code in PHP, but are not able to program in Java.)

The essence of what I am saying is the fact that there is a class of programmers for whom Scala is not suitable , and I have been talking about this for almost four years ... maybe longer, but this is the oldest post I could find. My position at the time is not too different from what many are coming to today: teaching and dismissing developers who are becoming less productive switching to Scala. In addition, it is completely obvious to me that there is a group of purely Java programmers who have not worked with Scala for at least the past three years. Thus, my position remains unchanged all these years.

What has changed in my understanding is that I realized that there are a huge number of companies where the programmer appears at the beginning of the working day, participates in several meetings, writes a few lines of code and goes home. I have had experience with three companies of this type in the past year. Some are implementing Scala, fighting as hard as they can, trying to do everything right, despite problems with Java code rewritten in Scala, the search for developers and internal resistance within the company. Others decide not to implement Scala (although they have a little Scala code that the manual does not know about, this code is supported by one person for whose tasks Scala is significantly better than Java). Still others decided to return from Scala back to Java, because the organizational costs of replacing half of the developers, sending 25% of the remaining courses to expensive, and refusing to outsource part of the projects outweigh all the benefits Scala gives to the three best programmers in their team.

We live in a world where the average developer writes 3250 lines of code per year (about 20 per day). This happens in Eclipse, by pressing the button “give me the pattern X” with the substitution of the code in the places proposed by the development environment. Then go for a few rallies. And they call it a working day. We can not dismiss all these developers. We cannot train them to make them better. This is the Middle. These developers can be heroes of cartoons about Dilbert (comment by a comic tape about office plankton). But you know what? These are the ones who use java. Do you know what else? Such programmers do not have the same combination of innate abilities and the desire to become better. But this is not only the case; the whole chain of management over the programmer has neither the ability nor the will to change the situation. We can not move this mountain ... or, more specifically, Scala is not so much better to dismiss 50% of unproductive developers.
So, the best direction and movement can be:
Motivation

“So what?” You ask, “you wrote so much to prove that Scala is not successful and complicated?”

I am a Scala supporter and fan since I came across this language almost five years ago. There are only a few people who moved to Scala and work with it longer than me. I am keenly interested in Scala and Lift to go further to success.

And Scala has some amazing success stories. Quotes and articles and the general feeling of something extraordinary around Scala - all this is serious and all is deserved. Scala is a wonderful language; a language that has no equal in modern programming from the point of view of its universality for solving the widest range of tasks, from simple and everyday to the most complex.

But, Scala is not a panacea. Scala is only successful where people hire great programmers. Scala allows such programmers to multiply their capabilities many times over compared to working in Java or most other languages. But in less experienced hands or, even worse, in the hands of those who are unhappy with Scala, Scala will be worse than Java. This will lead to strife and discord in the team, and, given that commands of this type are often passive-aggressive, timeliness and, ultimately, the programming language will be to blame.

In order for Scala to continue its growth, it must remain successful and a minimum of problematic projects must be associated with it. This means that you need to be open and honest about the strengths and weaknesses of Scala in order to choose the right applications for Scala and Lift. For Scala to grow, it is necessary that it be offered to exactly the type of programmers who have the right combination of skill and desire to create amazing things with Scala.
We have to accept that Scala is not going to force Java into command line utilities, CRUD, and database frontends. The power of Scala for writing ORM (sorry, Max ... Squeryl is a really cool thing) is much less than the value of Scala for the development of real-time systems, distributed, parallel applications. But most do ORM, CRUD, utilities, and other stuff in the style of fill-form-and-save-in-base. That's where the majority of developers and where the money. While cool guys develop giant fuzzy, event-driven, mega-hyper-super-colossal-real-time-super-blah-blah-blah things, most programmers do boring things, shifting data from the database and back, and Oracle / SQL offers a perfect mechanism for this.

As a community, we have to accept the weaknesses of Scala. We need to attract developers who are going to use the benefits of Scala (and there are extremely many of them). We must also actively discourage people from using Scala when there is a real chance of failure. The brand “Scala is difficult” or “Scala for really good programmers” is much better than “Scala is a risk that leads to failure from time to time”.

My motivation for writing this post was the desire to instill the awareness of what I said in the brains of the developers. I would prefer to see 5,000 new projects on Scala next year, 4,000 of which are successful than 50,000 new projects, only 10,000 of which are successful. Programmers, with abilities and inclinations to Scala, after successful experiments with the language, most likely, reading my posts, will say that I do not know what I'm talking about. The rest of the developers will repeat the conclusion ("The rock is too complicated") and not use it. And such an outcome, with much greater probability, will lead Scala to success; until it is completed so that it becomes accessible to middle peasants. This is the best way for Scala and Lift.

Oh ... and all of you, evil smart people who are pushing (or, I am sure, will soon push) boundaries, with mega-event-driven-in-mode-real-time gizmo, you will find out that Scala is a dream that has come true , and there is nothing like it (well, except maybe Haskell). So go ahead, create your cool stuff on Scala and let you succeed.

Source: https://habr.com/ru/post/134897/


All Articles