Scala, strictly personal
A concise (ahem) personal history of my programming career. At least, the part I wish to share with you all; there are some episodes better left alone…
A long time ago, in a reality far, far away, I started programming.
I did not start with C, though: before C there was dBase III, Clipper and Pascal. And Lotus 1–2–3, but I’m willing to forget all about that period ;-)
Then came C. And I was happy: a very concise language with regard to possible constructs. Straightforward and rather functional programming, although the term “Functional Programming” was not really mainstream at that time.
TDD (Test Driver Development) was not even invented, so unit-testing was non-existent. The result of my programming was tested by Testers (intentional capitalisation!) and they did a thorough and often complete job. The number of programming errors were few: sometimes a minor memory management (for which C is notorious) issue, but those were sporadic.
Life was good. Productivity felt high. Problems were solved, practical problems. I like solving practical problems. That’s what clients pay me for.
Then came an assignment where I had to use C++. Unhappiness arrived. C++ is a usability disaster: unreadable, many more possibilities to make errors.
My first C++ program was a C program with the ‘structs’ replaced with ‘class’. Actually, I was the disaster, not C++!
After a while my brain made the switch to Object Oriented (OO) software development and my opinion of C++ changed to a very positive one. Still remember those sessions with Eric Hop, a.k.a. Eric++ ;-)
Productivity soared again and happiness returned. With a very low-volume nagging feeling in the back of my head: productivity seemed good, but not as good as before C++…
Java felt like C++ without the headache of memory management, but with Exceptions, Null and without Templates, which were added to Java 1.5 as Generics. Java made me feel a bit sad: performance was dramatic at first, resources were hogged and productivity was down again (boilerplate, anyone?). Was I going to the same process of C to C++ again? This time the problem was not the paradigm shift, but the standard library of Java. Many methods, many new idioms and rules to learn. Limited documentation was one of the major problems, as is usual with new products and especially programming languages.
With Java 1.5, after many years of wondering if Java was the solution or part of the problem, generics made life a bit better. Still, the necessity for frameworks like Spring, felt like Java was only a small part of the answer to the question of development life.
Some years ago, in 2008 I think, I started noting Functional Programming: libraries for Java, old programming languages (Lisp) and new (to me, at least) like Haskell and OCaml.
I noticed that a lot of advantages of FP reminded me strongly of C. So I started looking into functional stuff. And came across Scala, which was (and is) advertised as a hybrid language where the best of OO (yes, I know now, that that is rather a contradiction) and FP with a nice learning curve.
Groovy? No, thanks
Although Groovy seems to solve some short-comings of Java, it is not even near a solid solution for programming. This is obviously my opinion, but the consistent lack of Groovy use in the Enterprise seems to confirm my opinion.
The main problem with Groovy for me is the complete lack of any direction! Throw a Java source file at it and it will happily execute and/or compile it. Is it compiled or interpreted? Some functional possibilities are provided, but included method / function names are not always what one would expect.
The support in my favorite IDE is disappointing, although it has been part of the core plugins of that IDE for years.
Question to JetBrains: why is the Groovy plugin still part of the main download?
TL;DR: Groovy seems inconsistent and without direction. Not a step in the right direction.
So Scala it was and is. Gatling is a very nice example of how Scala made me very productive in the area of performance tests, outperforming collegeas using more ‘traditional’ tools, which required them to use loads of XML (shudder) and low-level, boilerplate programming.
Scala is a real step ahead: very dedicated team of well-managed & directed developers and architects; the direction is set by that team (or a subset of that team) led by the ‘inventor’ of the Scala language.
Last, but not least: Scala runs on the JVM. So what? The JVM is a platform that is available in every and all enterprise environments. This in total contrast with niche languages like Haskell, OCaml and their offspring.
NB: the number of programming languages currently being born or promoted is staggering! Selecting a non-Java language for your or my future is risky, to say the least: guess wrong now, don’t work later :-(
Some essential libraries (frameworks?):
- Akka is another example of where other paradigms shine. Taken from erlang, Akka makes working asynchronously easy and fun.
- akka-streams is a Reactive Streams ‘standard’ implementation. I have a lot of experience with RxJava, so I’m keeping an eye on this effort
- akka-httpis the succesor for Spray. I have done some trivial tries in Spray and it takes some time getting used to. Biggest issue: in sharp contrast with Akka itself, the documentation is meager, to say the least…
- Play! Framework is a very nice, high-level way to build sites, including REST. It allows for quick prototyping with all the power of Scala.
- Spark. Yes, Spark. I’m now starting on a project with Spark. And Solr on top of Cassandra. Heaven :-)
And now for something completely different?
This was the part where I would brag about my forays into Haskell territory… I don’t think I will continue that route. Just not enough practical use. The number of opportunities for Haskell, or for that matter any pure FP job, are extremely limited. The increasing number of job-openings in the Scala environment is a clear sign which way I will go.