Hacker News new | ask | show | jobs
by bkeroack 4364 days ago
I've asked before but I'm going to try again: are there any resources out there for learning Scala that do not assume a Java background?

I have no Java experience (I'm primarily a Python developer) and therefore find most of the documentation difficult because I'm not at all familiar with the Java ecosystem (maven, jars, weird reverse-DNS naming convention for packages, JDBC, etc). Am I expected to first become a Java developer before I can even start with Scala?

3 comments

I've been working with scala for about 1.5 years. My background previously was mostly Python & R for the previous 10 years although I had been working w/ Java a little here and there for about a year prior to switching to Scala.

I didn't encounter any difficulty picking up Scala - my main resources at the time were "Programming in Scala", poking around StackOverflow and my group's existing code base. If anything I think my background with Python & R helped as I was already familiar with a lot of the functional-ish approaches from those languages (e.g. lambdas, maps, etc)

As Kev009 pointed out, using something like IntelliJ helped immensely as well as it handles a lot of the boilerplate-y stuff.

Nice. That's very similar to my background (R & Python). There's no existing codebase though, we are doing everything greenfield in Scala.

I'll give IntelliJ another try, thanks.

Coursera has a couple of Scala courses: try the introductory one "Functional Programming Principles in Scala". I'm not sure when it will be offered next, but they've given it a few times already. It doesn't require any Java knowledge.
Thanks for the suggestion, I looked through that Coursera course. I'm reasonably comfortable with the language fundamentals, it's more about the toolchain and using third-party libraries like the Slick ORM. I find the quickstart inscrutable (maybe it's just me).

As a counter example, I was up and running with Go in 15 minutes.

Slick in my experience is pretty unusable even for experienced Scalaphiles. I couldn't use it until I wrote a wrapper for it:

https://github.com/zenbowman/slickint

And even then, I think I by far prefer raw SQL to Slick. If you stick to the standard Scala libraries, they are pretty well designed, and I second taking the Functional progamming in scala course. There is some discussion of the toolchain in Lecture 0 of that course.

Interesting, thank you. Do you have any ORMs that you recommend above Slick? I think raw SQL is probably a deal-breaker for us.
Nope, Slick is the best one that I ran across for Scala.

I just found writing the classes painful so I wrote slickint to deal with generation of classes, and it was reasonable after that.

The things you identified you will need to know and would be proficient knowing them. JDBC not so much but depending on the libs you use, you could be using it indirectly. Same story with maven, knowing how to look up stuff on mavencentral will help but beyond that you don't need to care.

Knowing a little Java would help when calling into Java libs but an IDE like IntelliJ that can help you understand conversions would do well too.

A lot of people convert from languages like Perl and Ruby without tremendous difficulty. I can only recommend diving in to make a real assessment, prejudices and phobias will otherwise prevent understanding.