HN user

hszeeks

18 karma
Posts0
Comments5
View on HN
No posts found.

I find the characterisation of Scala very inaccurate.

It is nothing like Java at all. A Scala code would look so different compared to a Java code.

For an example, in Java you would create a class with static variable as a Singleton object. In Scala, you just create an Object.

Type inference, Option type, pattern matching, it is nothing like Java with FP shoehorned in.

you are right, should have said "i think it is a simple language".

<edit>

what makes me think it is a simple language (especially if you are writing microservices):

- class is a class, and you don't really need to explain the modifier

- object is just an object, like if a class is instantiated, and it is a singleton

- trait gives you mixin, cake pattern / self type

- Future makes async programming simple

- for yield -> to avoid nested map / flatMap

- val for everything, instead of final static

- case class, such a life saver to build immutable data objects

Some libraries like Slick adds up complexity but the benefit i think far outweigh the difficulty of learning it.

If you keep the Scala feature you use minimal, it should not get too complicated.

First step was to learn SBT, which in itself is simple (building projects, dependencies, plugins).

Later we have them do scala exercises (scala-exercises.org) to understand Scala basics, and the philosophy behind Scala, onboard on Framework (Play/Lagom).

Then we move on to Slick, and then Future API, error handling with Try, for yield comprehension, map and flatMap, collections, and of course implicits.

The rest would be comments on pull request.

Extremely excited with the release!

I work at a fashion renting company and our backends are built on top of Scala stack.

Contrary to popular belief, Scala is actually quite a simple language. Most of our engineers came from PHP or Python, or Ruby and all have expressed how type safety gave them great assurances that everything works if it compiles.

On top of that the behaviour of the language is very predictable! We almost never use debugger because we can predict quite successfully what went wrong in case of bugs.

Lagom was such a nice framework, coupled with Akka service discovery makes building Event Sourced application so simple.