I'm a soon-to-be PhD student on the field of Information Security. In the following months I'll have some spare time and I want to invest that time on learning a new language.
Thing is, I'm torn between Python and Scala. I really like Python for it's readability, its community, its relation with Linux and its style. On the other hand, I'm a Java developer for years and I don't want my knowledge of the Java ecosystem go to waste. Scala adds a whole new level to this ecosystem and is a powerful language. My thesis was also written in Java. But it's not as readable and has a steep learning curve.
I don't have the time to invest in both languages. I want to pick one and stick with it. In what terms should I decide what to learn?
If you're already working on the JVM, Scala is the logical choice since you can re-use a lot of your Java knowledge / libraries.
Starting with Python would be like starting from scratch, it's a very different mindset than Java/Scala and the lack of type safety irks me a bit, although some people like it.
Python is purely Object Oriented whereas Scala is multi-paradigm(OO as well as functional). Depending on how you want to use it in future that should be one point to consider. Wrapping head around FP may take some time.
You need to say what you want to do with the language.
Scala is very good but it runs on Java. Depending on context, that may be a good or bad thing. If you intend to use it somewhere where JVMs are already being used, Scala is good option.
Python , though is immensely popular. The number of packages written for Python outstrip those written for Scala by at least 10-fold. Python is decidedly object oriented, but can behave functionally though added functions like lambda() etc. The ease of learning Python and large package repository of Python makes it extremely good for prototyping, and getting things done.
The major disadvantage of Python versus Scala is that it is significantly slower than Scala. However, depending on what you have to do , the relative slowness may not matter. You see 2 ms on Scala verus 10 ms on Python is still faster than the blink of an eye and may not matter. If speed does become a bottleneck for you, there is ALWAYS the option in Python to write a C-extension and get faster speeds than even Scala.
So if you want to learn an all round language, with wide applicability, large number of available packages and are more interested in doing cool things and exploring your programming chops, I'd go for Python.
If on the other hand, you intend to work on a specific niche project on a distributed system (like a server farm or a cluster) and you know exactly what you are doing, Scala is good.
In the end, all I'd like to say is that if you have this question of whether you should learn/use Scala instead of Python, you probably shouldn't waste time learning Scala.
Scala is like that 400 watt, Ti-Sapphire, pulsed, mode-locked infra-red laser. If you don't know whether you should buy one, you don't need one.
Python is like the 5 watt blue laser with a LED that can transform into a swiss-knife, screwdriver, LED torch, length mesaurement sensor and so on. Even if you don't know what you'd use it for, it's going to teach you a lot about other things and is always cool to have around.