Sep 4, 2011

Scala is so very hard ... not

It is a bit tiresome to read about how hard Scala is to use. If Scala is hard, then so is every other modern language. Yes, even Java, the favorite language to compare Scala to. For old farts like me, the increased complexity has been gradual, but very real non the less.

When I started as a junior programmer back in the eighties, recursion was considered really advanced and difficult to grasp. A few years earlier, Ada was criticized for being too large and complex. A few years ago, Visual Basic came under fire for much the same reason. Progress is controversial.

So is Scala hard and complex? If you intend to use all of Scala, then it certainly is. But few people have the need to use all the nooks and crannies of a programming language. And we see many features only as consumers, not creators. For instance, when coding Java, I use generics a lot, but I rarely create generic methods. It's not needed for business applications.

The days when one could learn everything in a language lie way back in time. No longer can you judge complexity of a language simply by adding together the complexity of all the parts of a language. Judgement must be metered out in light of the intended application.

Scala is very easy to learn enough of to get started. The road from there may take you to easy or hard parts of Scala, but that's no different from other modern languages. If you need to code complex programs, it gets hard. (Of course, some things may be easy in one language, hard in another, but you can't escape essential difficulty.)

If you don't need to write DSL parsers, you can safely skip that part of Scala. If you find yourself in a project where it's needed, and you find it difficult to understand, Scala is the least of your problems.

If you don't write libraries or application servers, you probably don't need to worry too much about monads, currying or partially applied functions.

If you don't need XML... You get the drift.

To summarize, as a general programming language, Scala is easier than most languages. It has some features that could be considered hard, but just like Java, that's parts that's either not used in day to day programming, or that should only be used when the task is inherently difficult. Don't worry, be happy.


No comments:

Post a Comment