I am coming from a php background with some python as well. I want to start working on a different language for both web and mobile development. I am also interested in real time apps dealing with games.
I am looking at node.js because I can use tools like titanium and/or phone gap to have my apps ported and compiled to native java code, or in a way that makes it runnable on mobile (web views). I like this path because I can use existing JS knowledge to build apps.
I am also looking at scala. I have done some C# as well as tinkered with Java about 5 years ago. And I do like that I can use scala to make native android apps. But unlike node/js which can be made to also work on other mobile os’s, this only works on android. In a way, that doesn’t really bother me. But scala seems like it would have much better performance for gaming that JS compiled to android. But I do not know how well.
Ine the end I want to focus on socket and REST based web apps for API’s that users can have access to, as well as some mobile development. I want to get towards games and interactive apps.
The question is, what features of Scala would benefit me over the node/js side of things for making real time applications on web or mobile? I was looking at using frameworks like lift or play for web.
Node also makes real time easy with socket.io and node handles much of that in the background. This is why I think node could be a great choice. So I was hoping someone could give some insight on features in Node, that would have some benefit over scala. I don’t really want to hear ‘this is better cause its webscale or related things. I was hoping for more facts about features that would benefit what I want to do. I already understand why node is good. I just dont know much of anything about scala. Or how they may compare for what I want to accomplish.
7
I am looking at node.js because I can use tools like titanium and/or phone gap to have my apps ported and compiled to native java code, or in a way that makes it runnable on mobile (web views). I like this path because I can use existing JS knowledge to build apps.
Node is a server-side technology. You shouldn’t let your app-language decide your server-side language. Yes, there are some “synergies” to having your front-end and back-end in the same language. But it’s no silver bullet, and can cause more headaches than it solves. In fact, the majority of application writers explicitly choose not to do this.
So I was hoping someone could give some insight on features in Node, that would have some benefit over scala.
One reason NOT to use Node is that JavaScript has a lot of warts. (Search for “JavaScript WTF”.). If you want JS on the server, prepared to become a JavaScript expert (especially the warts). Also consider CoffeeScript which is helps shave off a few of the warts, but is easily turned into JS. JavaScript is also a scripting language, so tends to be less efficient than Scala.
Scala uses the JVM, and the server-side JVM story is much more mature than Node. But Scala is probably harder to get started in. I don’t know anything about writing apps in Scala, but I’d imagine that’s very immature.
Don’t think of the question as either-or. You’ll be a better developer if you try implementing in both languages. The more languages you know, the better you will program in your favorite language.
5
I agree with all that @BraveNewCurrency said. I’d like to add some comments.
Personally, I’d use Scala in the server and CoffeeScript in the client, AFAIK Play allows to integrate them in the development (placement of the folders, etc.), CoffeeScript has the same interoperability of Javascript and a nicer syntax and Scala has the same maturity and library availability of Java, with a nicer syntax (and semantics?).
On the other hand, if you don’t need the maturity and availability of libraries of Java then Node.js provides a uniform language for the development and you may be more confident with Javascript than Scala (and its ecosystem, like SBT or Maven, etc. when compared with npm, etc). It’s not a silver bullet for the system, but it may be comfortable for the developer. That really depends on the person. Personally I prefer to have types in the server, they help to use code written by other people that may not be the most disciplined or best programmers in the world, which statistically should happen quite often.
To wrap it up, for the client it’s either Javascript or Coffeescript. Scala wouldn’t make much sense there, it’s a no brainer.
In the server there are Node.js gurus doing impressive stuff, and it may be better suited for something quick (and “dirty”) if your kung fu is strong enough. On the other hand Scala is going to allow better integration into something big (and “enterprisey”) specially if you would like to collaborate with more people at some point. So that is more a matter of suitability for (a not yet specified) purpose and personal tastes.
2