Scala for business

Thank you for inspiration :slight_smile:

Prolog

There are said:
Scala combines object-oriented and functional programming in one concise, high-level language .

Object-oriented

Frankly, the business processes change much more often than data scheme. So that, it is usual to separate data from data processing. We see pojo\row\case classes very often.
It is just syntactic sugar in many cases.

Functional

Functional paradigm has strong association with immutability.
To say the truth, business do not pay money for immutability, it does pay money for mutability which is some kind of changes is this world(It is ironic statement, I am sure everyone know the power of functional style here, see GOTO 2018 - Russ Olsen 26:21).

Today any modern language has functional features. I think It cannot be advertisement anymore(see Why Isn’t Functional Programming the Norm? – Richard Feldman 38:03).

Summary

It seems the main poster is not business oriented at all.

How business can choose scala

It tries to save money of course :slight_smile:

I have made comparison between scala,kotlin,groovy because they are high level languages which have operator overloading at least.
‘+’ symbol means the language can win.

Note: It is my personal human opinion, which is based on discussions I have read on this forum.

Stage 1

It is good question whether it is more important the performance or the binary independence.

Performance

It just decreases hardware costs and response time.

  • Kotlin +
  • Scala +
  • Groovy -

binary independence

Binary dependencies increase time and cost to upgrade 24*7 systems. It increase cost of its management. Binary dependencies has reason in middle level, but it is just additional costs in high level.

Binary dependencies dramatically increase cost of business analysis and acceptance testing.

  • Kotlin -
  • Scala -
  • Groovy +

Stage 2

It can be very important to know how much code we have to write to provide productive environment to high level programmers. However, the more project is the less important it will be.

reusage of our types between external libraries

  • Kotlin -
  • Scala +
  • Groovy -

It is really wonderful, how much work they have done in dotty.

Stage 3

The question is how much comfortable and productive it is to write programs.

succinct syntax

  • Kotlin +
  • Scala +
  • Groovy +

Language injection

There are always more productive declarative languages in some domain area. It is sql for example.

  • Kotlin -
  • Scala +/-
  • Groovy +

Scope reusage

import

It is comfortable with external libraries, which are rarely used.

  • Kotlin +
  • Scala +
  • Groovy +

Aggregation

It is comfortable with external libraries, which are often used.

  • Kotlin +
  • Scala -
  • Groovy +

Inheritance

It is comfortable with root scope

  • Kotlin +
  • Scala +
  • Groovy +

Debug comfort

It actually depends on ide but we cannot make code in notepad.

  • Kotlin +
  • Scala +/-
  • Groovy +

Custom workflow in development

It is a good way to save money in domain specific area.

  • Kotlin -
  • Scala +*
  • Groovy +

* - I hope Bloop will be soon in production with intellij idea

Stage 4

Compatibility with other java frameworks

  • Kotlin +
  • Scala +/-
  • Groovy +

Summary

Scala can win against kotlin because it saves money by library reusage with custom types. (collection, anorm, some serialization and so on)

A dynamic language wins in cases where binary incompatibility is more important than performance. Nevertheless it requires writing many additional libraries and ide improvements to gain additional profit.

It is quite interesting that it is really difficult to choose between scala and a dynamic language. When a customer wants the best from two worlds. He wants low costs, high performance and development speed. He does not want to hear about kitchen syndrome :slight_smile:

The best from two worlds

Ability to enable dynamic invocation between modules(jars)

It is not silver bullet. Nevertheless, there are always layers where code change more often, so such feature can save money. Lambdas are implemented via dynamic invocation in java.

Language injection

Comfortable index- based database access

More powerful string interpolation

Scope reusage

1 Like

It seems that the irony was too hard. I have made changes: