R
R
Roman2015-07-12 01:57:14
PHP
Roman, 2015-07-12 01:57:14

Where to start in Scala (?) developer from the PHP world?

Good time!
What is already there? I have experience in development (including commercial) in php / js / python, I wrote a little (only for myself) in java.
Why? I caught myself thinking that I was trying to write OOP code based on some principles of functional programming (data immutability, cleaner functions, using method passing as functions / lambdas, etc.), as well as a lot of contracts and not very successful attempts to screw strong typing. PHP is already more of a hindrance here than it helps to write code. Plus, of course, the expansion of horizons.
What for?It is supposed to write server parts for the web (api, mostly) as a complete replacement for PHP in future projects. Accordingly, as part of the training, it is supposed to take one of my existing small projects and rewrite it in a new language (most likely for experience and on the table .. or find a customer who agrees to this).
While I looked closely at Scala. Zero experience. Conciseness, strict static typing and functional style are captivating.
Based on the above, there are two questions:
1. Is Scala an adequate tool? What are the alternatives/pitfalls?
2. Please recommend articles/tutorials/courses (good books with an emphasis on practice are also good) on Scala (or another language if the answer to #1 is "no").
Thank you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
C
Condensed milk-chan, 2015-07-13
@wing_pin

1) Yes, quite a suitable tool. I myself came to Java and Scala after Ruby and Node.js
2) There is a good book "Scala for the impatient"

K
Kirill Zakharov, 2015-07-12
@yTko

Twitter had a good project for learning Scala - twitter.github.io/scala_school/ru
I personally liked PlayFramework 2 at one time (I wrote my diploma on it), but there I really wrote more in Java than in Scala.
And so I agree with unabl4 - for simple and not very APIs, this will definitely be overkill, because then at one fine moment it turns out that only 1 person who wrote all this can support the whole thing.

O
OnYourLips, 2015-07-12
@OnYourLips

2. Please recommend articles/tutorials/courses (good books with an emphasis on practice are also good) on Scala (or another language if the answer to #1 is "no").

The first thing I'd look at is https://www.playframework.com/
Looks sparse compared to modern PHP frameworks, but in Scala it's mainstream: lots of books, community, etc.
1. Is Scala an adequate tool? What are the alternatives/pitfalls?
Look at job offers in the place where you are looking for work.
This will be the answer to your first question.

D
Dmitri Sinitsa, 2015-07-12
@unabl4

1) Personally, in my humble opinion, the rock for all sorts of web APIs is overkill.
Such things do not need functionality, monads, higher-order functions, etc., etc.
That is, as an academic language - it is excellent, you can "think" in this language.
But, it seems to me, it is better to write as simply as possible (what, for example, promotes the Go language).
2) Course on coursera, of course. I went through it myself and was very pleased.

A
Alexey, 2015-07-17
@Venje

To write effectively in Scala, you must first learn Java SE. Scala somehow translates all of its high abstractions into Java concepts. And in order to understand this whole thing even better, you need to understand the principles of the JVM. Usually all this is used to create more or less global, highly loaded, distributed applications. There are more and more Scala vacancies over time. But the language is not without its problems, just look at the bug tracker and Paul Phillips talks. Nevertheless, it is actively developing, the community is growing. The Dotty project has been launched, in which the compiler will be rewritten to make it simpler and more people can figure it out in order to contribute.
PHP is great for most web projects. Switching to Scala is only worth it if you want to develop something more global and complex with a large code base.

M
mpolk, 2015-07-19
@mpolk

1) For web development, Scala in its current state, I'm afraid, is not very suitable (yet?). The Rock itself is a mature and practical language. But in terms of level (quality, completeness of coverage of typical tasks), generally accepted for web development on the Rock, PlayFramework, in my opinion, falls short of either the Rock itself or PHP frameworks. Personally, when trying to switch from ZendFramework to Play, I felt a very noticeable stiffness. The natural desire to build the resulting html, as a composition of the results of the work of several relatively independent modules, ran into technical difficulties and the need to fence crutches. True, PlayFramework is actively developing (I suffered with version 2.2), and perhaps soon it will be brought to a decent level.
At the same time, I use Scala with great success and pleasure to write daemons that monitor and maintain our network (I work for an ISP company).
2) I read the original source, Martin Odersky "Programming Scala", and finished it with articles on scala-lang.org for relevance (the book describes not the latest version of the language, 2.8). Very satisfied and highly recommend.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question