Your experience with Java is hugely different than mine, then.
I have clearly not so much experience as you, but I am a Software Developer since being a school boy so my experience is about 25 years using more than 10 different languages (and I admit I am also a little tired of learning new ones every few years).
- Embedding a large String in a source file.
Large strings I do usually read from external templates (not necessarily XML which I find ugly and inefficient for most cases). Although the """ is a nice feature it is IMHO no major benefit.
-Information passing. Our code is littered with Java classes like this:
class TransactionData { private Date date; private Long transactionId; public Date getDate() { return this.date }
[...]
Object oriented programming can also be exaggerated... - Although Java is an object oriented language not everything must be necessarily packed into it's own class. I only have few such boilerplate code because if I have too many too similar classes I do combine them or make one parent class. For years I developed in VB where neither inheritance exists, but I learned from this, that in many cases re-combining existing classes is a very useful option.
But in many cases, it's a useless data holder class created for the sole purpose of passing information back and forth between two different Java classes.
Then maybe a different way of passing data around would be a good idea - but that said, I know that in most projects there is a large stack of frameworks used like Hibernate, Spring and the like. Once tripped in there, it's hard to get out and forces you to that coding style.
-Null checks. Our Java code is just full of code like this:
SomeType x; SomeOtherType y; SomeThirdType z; x = doSomeCalculation(); if (x != null) { y = x.getY(); if (y != null) { z = y.getZ(); }
Yep, that one I really know also - I didn't think of this so far because I wouldn't have expected a solution for that. ;-)
Scala has Options which shortcut the whole procedure and let you write the exact same logic in a much simpler way.
One concern that I have in general when the discussion comes up of writing something in a shorter way is readability. I remember some famous "one-liners" from C++-Programmers that nobody could understand. I know developers who forget very fast of what and why they did...
-Inheritance. We have a number of interfaces and abstract parent classes that are used left and right in the Java code. Every time a method changes in one of the interfaces,
we have to re-write the class hierarchy or insert an intermediate parent class.
I think I did not get exactly what you mean here. But I remember times where refactoring was very hard manual work. Maybe from those times I do think 10 times when designing interfaces before I start with the implementation.
Scala traits give Java multiple inheritance without the multiple inheritance headaches of C++.)
Not everything that can be done should be done. Since working with Java I consider the restriction to single inheritance as a good idea. Although I do most projects alone, I have seen enough foreign code that drove me crazy.
-Cases. Java has a nice switch construct... for numbers.
Yep, I know this one and I argued about that. - But it should come with Java 7 ASFAIK.
-Exceptions. In Java, you have to explicitly catch all of your checked exceptions or declare them to be thrown. In Scala, all exceptions are unchecked.
I really like to have the option to use checked exceptions! And you can also use unchecked exceptions if you like - and guess what: you neither need one of those you can also live without them (at least in your application, not talking about the core classes, but I have created wrappers where I liked it).
-XML. Java uses XML like crazy, and the APIs for reading and writing it are awkard
Oh what, really? Are you talking about Java? Or are you talking about some frameworks or 3rd party libraries you are using?
Scala has syntactic support for XML right in the source files. var x : Node = Blah blah blah.
I avoid XML wherever possible - since the hype started.
I would be shocked if a Scala re-write wouldn't put the number closer to 40,000 and make adding new features even faster. To really see the power of it, play around with Scala.
I also work in a tiny company - and so for me it is also very important that each shot hits. I cannot start a project in a new language then finding out that something important does not work there. I already suffered much from being the "early adopter". And Scala would be for me an early adoption because of the tools around that are not yet mature (e.g. IDE integration).
But all that said, I heard a lot about Scala in the last months (e.g. from JavaPosse ) and it may be really an option for me in a few years and maybe it has grown to the killer programming language by then. ;-)