Skip to main content

Have you tried Scala?

Yes, and I like it
18% (151 votes)
Yes, but I don't like it
5% (43 votes)
No, but I'd like to
22% (181 votes)
No, and I don't want to
16% (134 votes)
38% (313 votes)
Total votes: 822


You could just do this in 8 lines of Java

I've never tried Scala but you could just do this in 8 lines of Java and keep it readable and familiar: public static int loveMatch(String name1, String name2, String compWord) { int [] tally = new int[compWord.length()]; for (char c : (name1 + name2).toCharArray()) for (int t = 0; t < tally.length; t++) if (c == compWord.charAt(t)) tally[t]++; for (int i = tally.length - 1; i >= 0; i--) for (int j = 0; j < i; j++) tally[j] += tally[j + 1]; return tally[0] * 2; } ...and the author shouldn't blame Java for his implementation not supporting "is"... what's that all about?

You could just do this in 8 lines of Java

Hi there, I'm the author =D I know that Java example wasn't very good, it was just what prompted me to write it. And so ah-ha, here's a good way to learn a bit of Scala instead of re-writting it in Java... Personally, I find the Scala code much more concise and readable than the equiavalent Java code. That makes it much easier to ensure that it's correct, and easy to modify. I love getting rid of the for loops, the indexes etc etc, no need to have to do any math in my head to understand the code :) Yes yes, I am a very lazy programmer ;) Regarding keeping things "readable and familiar:", i'm sure at one stage all Java was not readable or familiar to you, so you learnt the language, and discovered that Java was far more concise, powerfull, flexible, readable etc than things before it. I would hope you're not going to stick to Java for the rest of your life? Once you've accepted that you are going to learn a new language, Scala, Groovy etc the power that come along with the language make it clear that they are more powerfull and higher level than Java. Not sure what you're referring to here: "...and the author shouldn't blame Java for his implementation not supporting "is"... what's that all about?" Cheers. P.s. even shorter: var loves = "loves".toList map( x => "roger federer maria sharapova".toList count(x == _ )) while (loves.length > 1) loves = loves zip(loves tail) map {x => x._1 + x._2} println("3 line compatibility = " + loves.head * 2 + " %")

38% have never heard of Scala? Don't you guys/gals browse dzone?

there's no "not yet, but who knows about the future" option, nor a "magical brownies" option so that one's the best alternative.

more options

There should be another option for this poll... "Yes, and I don't understand it yet."

maybe in a few years

If it's still around circa 2012 I might be tempted to give it a try. For now, I consider it just another overhyped fad like so many others that sweep this profession constantly.

maybe in a few years

Then I hope you benefit from the investment some of us are making. That's okay.

maybe in a few years

I'm pretty confident that in a few years Scala will be just another "has-been".

maybe in a few years

Either way, there'll be benefits.

Pleasantly surprised

I'd eyed it for years then actually started learning it better in the past month or more. I'm quite surprised at how much I like it.

A promising JVM compatible language

Scala includes a number of exciting features (from ML, and LISP - which are languages I've always admired) and throws in some new ideas based on accidental complexities of other popular languages, including Java . However, what makes Scala so exciting is the fact that the question "But, Will it replace Java?" is basically moot. Giving that it targets the JVM, it's not hard to envision an application containing components written in Java *and* Scala. As someone who hasn't been sold on using pared-down scripting languages, I can see myself leveraging Scala's rich functional and type inference capabilities in a way that allows the accompanying Java code to be cleaner.