> >> In fact, it turned out that learning Scala made me a better Java > >> programmer = win for my employer > > ... as soon as you keep working for him.
Hi Fabrizio, I agree with Viktor on this point. I believe learning Scala makes me also a better Java programmer because it allowed me to view some problems under a different perspective and possibly to find a better, shorter, more readable and then more maintainable solution for them. If people in your development team are used to share their knowledge with techniques like pair programming, code reviews and meetings, the whole team will take advantage of these new problem solving possibilities. And these advantages will remain even when (and if) the developer who introduced them for the first time will leave your company. As for the Dick example, I think it really demonstrates in which way Scala could be better than Java. I don't know if that could be the same for all the Java developers (or at least for the biggest part of them), but honestly I better understood what his Java code snippet does only after I read the equivalent Scala version. That is only marginally dependent on the number of LOCs of the 2 versions. IMHO what really makes the Scala version more readable is its declarative style (allowed by the functional capabilities of the language) compared with the imperative one of the Java version. My point is that Dick's code is more readable in its Scala version not only for him but also for me. So I suppose it will be easier for me to maintain the Scala version of the Dick's code even when he will leave my company. Normally we are not concerned about verbosity or poor readability of imperative languages just because we are used to them after years (or decades) of C and Java programming. But I believe that the functional paradigm, and the declarative style programming it implies, could dramatically improve the productivity of a team when its members will master those concepts with the same familiarity they currently have with object oriented programming. SQL probably represents the easiest demonstration of what I am saying: how do you think your productivity could be affected if you should imperatively say to your relational DB how to access, join and filter its tables instead of declaratively ask for the result you need? Bye, Mario twitter: @mariofusco -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
