News for hackers. Stuff that matters.
Re:Using Scala to handle exponential growth at a startup by pkulak on Tuesday December 18, 2012 @12:42PM (#4938566)
As far as I know, Scala can't give you _better_ performance than Java, but I also can't see it being too far off.

I've never really seen the benefits of Scala. Everyone whines about Java syntax, but it's really not that bad. Verbose, sure, but it just doesn't seem like time spent typing is where my productivity goes. Maybe I'm just getting old, but I no longer care about language syntax as much as I used to. A preprocessor to give me Java 8 lambda syntax would probably solve all the issues I have with Java right now.

Re:Using Scala to handle exponential growth at a startup by leothekim on Tuesday December 18, 2012 @01:22PM (#4938740)
"A preprocessor to give me Java 8 lambda syntax would probably solve all the issues I have with Java right now."

That's one of the things that Scala gives you: the functional features are there now and have been for almost ten years.

Still, I know where you're coming from. I was a die-hard Java guy until I gave Scala a shot. I'm not looking back, though I do think that Java's tooling is much more mature than Scala's.

Re:Using Scala to handle exponential growth at a startup by jbooth on Tuesday December 18, 2012 @01:58PM (#4938924)
Scala has much worse tooling (SBT is an oxymoron), and it's much harder to read than Java.

Conceding that it's more fun to write, I think 'harder to read' is more important. Scaling refers to team size and amount of functionality in addition to requests per second.

Re:Using Scala to handle exponential growth at a startup by felipehummel on Tuesday December 18, 2012 @04:41PM (#4939744)
The "much harder to read" varies greatly between codebases. Most "sane" codebases are 90% (random percentage) as easy to read as Java. Just collection initialization, transformations, simple pattern-matching, method invocations... Some times there is an ugly nested flatMaps/maps/filters. But in my experience, in general, they're more the exception than the rule.
Re:Using Scala to handle exponential growth at a startup by jspthrowaway2 on Tuesday December 18, 2012 @02:08PM (#4938990)
It's also the slowest compilation I've ever seen, even with really clever custom tooling.
Re:Using Scala to handle exponential growth at a startup by felipehummel on Tuesday December 18, 2012 @04:45PM (#4939764)
Scala compilation is indeed slow (although I think C++ is worse). But I always have a "sbt ~compile" running, compiling every file as they change. So the compilation time is pretty much irrelevant to me. While using eclipse, I guess, you'd get the same speed too.
Re:Using Scala to handle exponential growth at a startup by runT1ME on Tuesday December 18, 2012 @04:14PM (#4939624)
I didn't either, until I tried it. On one level, yes, it's java with type inference and lambdas and saves you typing. When you dig a little deeper in scala, things like case classes (immutability), pattern matching, for comprehension (monad syntax) suddenly fundamentally change the way you program.

Code becomes a lot more clear, explicit, and... fun. I recently talked to a dev who used Akka with java for a network server, and he ended up coding it in 'an object for each callback handler' style.

When I asked why he did it that way, he said nesting callbacks to sequence operations would get too ugly fast.

This is trivial in scala. The language flaws in java ended up dictating the architecture of his entire application, and for the worse IMO.

Re:Using Scala to handle exponential growth at a startup by negrolious on Tuesday December 18, 2012 @04:18PM (#4939644)
"A preprocessor to give me Java 8 lambda syntax would probably solve all the issues I have with Java right now." Xtend seems to do this and more http://blog.efftinge.de/2012/12/java-8-vs-xtend.html
Re:Using Scala to handle exponential growth at a startup by killface on Tuesday December 18, 2012 @12:44PM (#4938575)
I think the benefit is that people don't want to say they're Java programmers. It's like a hipster thing. Most modern scala programmers don't even use the language correctly, or couldn't write "hello world" if it wasn't in the play framework.
Re:Using Scala to handle exponential growth at a startup by martinced on Tuesday December 18, 2012 @01:13PM (#4938701)
I think you mistook HN for YouTube.
Re:Using Scala to handle exponential growth at a startup by jspthrowaway2 on Tuesday December 18, 2012 @02:10PM (#4938999)
He raised a point, though a little abrasively. You left an entirely content-free response. Who mistook what for what again?

Attack his point and win, instead of pointless drivel like this.