I am thinking of writing a web app in Scala using the Play! framework for the front end, and probably MongoDB for the backend. Is there any reason why I wouldn’t be able to / want to use scala for the entire application? In other words, are there areas where I would be forced to use ruby or php? I like the idea of just having the full stack in Scala, but I don’t really know if that is realistic or not.
I am very new to web development, but have experience in java, which is why play framework and scala seem like good choices. But I apologize if my questions doesn’t exactly make sense.
You bring up a good question re: Scala for full stack web devel.
I would say, generally, yes, you can do it all in Scala (and compile-time checked code to boot) with one exception*, the template engine layer
Play provides their own template engine, but don’t expect to get code completion in your IDE; technically it’s strongly typed, but your IDE won’t pick up Scala code; it will be interpreted as plain text in the IDE. Loading in browser window reveals error(s) and applicable line number(s) so you do avoid runtime problems of ruby, python, php, etc. frameworks.
Same deal with Scalatra and the Scalate template engine. You won’t get that rapid-fire feedback of compiler checked/completed code that you do get when writing straight .scala file code in your IDE.
Now, if you’re an EMACS, VIM, etc. user, no great loss, but then again, having auto completed code at both scala and template engine layers is hard to beat. Apparently IntelliJ is providing a plugin this summer that will at long last provide syntax highlighting, code completion, etc. for Scalate, an amazing project that is over 3 years old and still has zero IDE support ;-(
Currently with the Eclipse Aptana plugin I use .erb support to hammer out code completed xhtml and then sbt plugins for LESS and CoffeeScript. You can make it work, just a bit of a hassle in current state of Scala IDEs.
Please correct me if I am wrong on any of this, would love to hear otherwise. As of a month ago, the below held true in my devel environment (Scala IDE 2.0)