views:

736

answers:

12

Hi,

we are considering Scala for a new Project within our company. We have some Junior Programmers with only PHP knowledge, and we are in doubt that they can handle Scala. What are your opinions? Some say: "Scala is a complicated beast!", some say: "It's easy once you got it." Maybe someone has real-world experience?

+1  A: 

My initial thought would be that Scala will be too heavy for them but then I guess because Scala is an OO/Imperitave/Functional hybrid, one could introduce them to the OO/Imperative part of scala until their comfortable, but then again they will probably have bad PHP habits in Scala since scala authors mostly prefer the functional style over the imperative one.

So, it could work, but I would do it for a research project, and definately not for a flagship one.

Edit: Perhaps this should be said also: It seems that functional/OO hybrids like Scala is becoming more popular especially because of how functional languages handles parallel processing as opposed to how we know it in languages like in Java. The amount of cores found in a chip is increasing rapidly, so this is important. However, mentioning PHP, it seems that you are developing web server scripts where threading is less important. PHP doesn't even have threads.

This raises another point. Do you want to develop Scala Web applications i.e. Lift. If so then you have a doubled up learning curve which should also be considered.

Hannes de Jager
A: 

I would not recommend it. My experience of Scala is only from homebrew projects, but I would imagine the currently lousy IDE support, quite frequent API changes and a very flexible syntax (that allows one to hang himself and everybody else participating in the project) would cause a lot of problems in a bigger, more official project.

ponzao
I agree in the sense that I think any problems wouldn't come from the language itself, they'd come from contextual issues stemming from Scala being a fairly young language.
Seth Tisue
The IDEs are not lousy (try IDEA9 CE) and the language does not have "frequent API changes" unless you are using the 2.8 snapshots, which is obviously *not recommended* if you want stability. I have been using 2.7 with no API issues whatsoever!
oxbow_lakes
The IDEs are lousy if you don't have the luxury of changing due to bad Linux support in IDEA and the fact that I really don't want to start learning a new IDE just for Scala, luckily Vim works fine with Scala as well, but it is annoying to have to manually compile all the time to check the compiler has enough hints to know what it should do. Going from 2.6 to 2.8 there have been a lot of changes and a lot of the examples found online don't specify in which version they features are available. I like the language I really do, but it is not yet production ready in my opinion.
ponzao
"Bad linux support"? I have a colleague who is using IDEA on Linux just fine
oxbow_lakes
Mileage clearly varies. I haven't been able to get it to work on 64bit Linux and a friend of mine 32bit didn't work well either, but I just took his word for it. This was about two months ago so the situation might have changed of course, I'll have to look into it.
ponzao
+13  A: 

I guess Scala could be used as a "beginners" language. Even though there are tricky ideas behind it, you dont have to use/explain them in the beginning. If you explain pure OO with Scala, I would say it is straight forward and easily understandable. As Scala reduces a lot of code overhead from other languages it might even be easier to learn concepts with Scala than with Java/C++.

A major drawback I see with Scala as a beginner language is the lack of documentation. Don't get this wrong, the official Scala doc is very good and also the few books that are available are quite useful to get the details of the language, but those have not been written for beginners. For example in Java you find hundreds of books titled something like "Learning OO with Java" you wont find that for Scala which may be a show stopper.

As Hannes mentioned, only do new language introductions within research projects and not productive or even flagship projects. If you have some juniors, that makes the situation even better, take some internal tool, you always wanted and needed and let them create it during a research project. This is also a nice opportunity to experiment with different development-processes. And your juniors most probably like to be challenged and will deliver a good prototype and a very well proofed opinion if Scala can be used as a beginner language.

Nils Schmidt
*Programming in Scala* is definitely written for beginners. Also, most things you learn using Java can be directly applied to Scala. Indeed, you can use all your favorite Java libraries in more or less exactly the same way.
Apocalisp
+5  A: 

I believe that most people moving to Scala are experienced and enthusiastic coders. I'd suggest that you get in-house experience with a Scala project with your senior programmers first before forming a strategy for mentoring your junior coders. I'd also suggest that you only involve people who are eager to join in.

Don Mackenzie
+4  A: 

I would advocate it. But with the proviso that you have clear guidelines on what language features are acceptable for your team. For example, coding primarily in an imperative style (which is familiar for Java-trained people), or perhaps limiting the employment of recursion or closures.

Also plan for seniors to mentor the juniors. This may take the form of any combination of: pair programming, code reviews, info sessions, regular discussion forums, etc.

The opportunity that scala presents for vastly improved coding on the JVM is too great to pass up. When your seniors get into it I would not be surprised if they find renewed passion for development. When your juniors get into it they will be learning best practice JVM development from the start.

Synesso
+4  A: 

If you choose to go this route, perhaps they'll find easier to use the Scalate framework than a more traditional one like Lift, since it allows mixing HTML with Scala, much in the same way as PHP works.

Daniel
+3  A: 

Scala is a very 'normal' programming language. Any programmer should be able to learn this language. The people that have difficulties learning Scala mostly are experienced with imperative languages and are surprised by the functional concepts. So unexperienced programmers may learn it even faster. In my opinion should be no problem, to assign it to juniors. From a management point of view, I would assign a junior and a senior developer as a team (or more of both, depending on the size of the project).

Mnementh
+11  A: 

"My coworkers will not understand Scala" is simultaneously overstating its difficulty and insulting your coworkers.

  • Scala is not that difficult. It's just another programming language. Any trouble that a junior programmer has with Scala is going to be more or less the same trouble he would have with any other language.

  • Your coworkers are smart. Of course, I don't know them, but it's a pretty safe bet unless your company is the kind of organisation that hires stupid people, in which case, you have bigger problems.

That said, at my company we have some core products developed in Scala, and we don't find that people have any more trouble with it than Java. The code is generally more clear and concise, easier to generalise and reuse, etc.

Apocalisp
+1  A: 

I think it depends whats more importent for you. If you want to learn as possible about OO Programming and the standard stuff its a bad idea.

But what you really give them is a opportunity to learn something really cool and unique. Witch can be good motivation. Scala has many cool stuff in it. If you can handle Scala you can handle a lot of otherstuff as well.

Talk to the Programmers (all of them) and tell them why you wanne to use scala. Ask if the have to motivation to make and learn something not everybody can do and go the extra mile?

If the are go with it!

nickik
+1  A: 

Imagine that you would have picked Java and asked whether they could handle Java. If your answer is they could, then they can probably handle Scala.

Scala is only marginally more difficult due to:

  • No great IDE support. The support ranges from poor to good. Not necessarily an issue for a PHP programmer.
  • Documentation not as rich as Java

Both Java and Scala have new challenges for a PHP programmer (JVM, new libraries, compiled language, statically typed).

I don't think Scala is a complicated beast, but you do need to understand some of the syntactic sugar and design principles, which would be true of learning Java as well.

huynhjl
A: 

Give them IntelliJ and throw 'em in the deep end.

Ben Hardy
A: 

Here is a blog post I recently stumbled upon:
http://james-iry.blogspot.com/2008/07/java-is-too-academic.html

It shows that even Java can be too academic to be understood by programmers which have no experience in functional programming. On the other hand, Scala allows to write code the "imperative way", so you can avoid all the FP stuff if you do not understand it. In my opinion, Scala is much more concise than Java, so I guess a "junior programmer" should be able to handle it.

Michel Krämer