Seeking exchange with C/S educators on teaching Scala

Hi all,
I teach computer science in a german high school (Gymnasium), and I train other teachers before and on the job. At the moment, we teach and train mostly Java. I’m considering switching to a different language and Scala ist a possible choice, but that’s a big decision for anyone’s own classes and an even bigger one for migrating other teachers state-wide.

Scala seems promising for several reasons as it interacts well with the Java ecosystem, allows functional as well as oo programming (both would allow a friendly migration from Java) and has a slightly cleaner syntax.

I’m seeking exchange with other educators on the subject. Do you know know anyone who teaches Scala to programming beginners? Who teaches Scala at high school or college? Do you know of any online material on the subject?

Thanks in advance!

Greetings,

Urs

3 Likes

It’s great, that you want to make Scala the language taught in schools. I teach an “FP with Scala” course myself, but at third year university level, so my students all know at least Java and probably at least one or two other languages at that point.

You may already have noticed, that most material for teaching Scala is aimed at people already familiar with Java or at least some other OO language. The only source I found for beginners without another programming background, is this book: Introduction to Programming and Problem-Solving Using Scala. The author also has a video lecture based on it on Youtube: https://www.youtube.com/playlist?list=PLLMXbkbDbVt9MIJ9DV4ps-_trOzWtphYO

I think, that Scala could be much better suited for beginners, as you have a lot less required boilerplate that needs explaining. Depending on your timeframe, it may be worth it to wait for the release of Scala 3 (which should be soon). Things like main functions and being able to write a def without needing an object around it make beginner programs easier and you can introduce OOP later. When teaching Java as a first language, I always found that a “Hello world”, that requires classes, access modifiers, static methods and arrays before you even get to the “print” part, just confuses beginners.

There are also worksheets, which allow these in Scala 2 already, but I don’t have any experience with them.

2 Likes

Thank you for pointing out our materials, @crater2150.

@LTB, I’ve been teaching CS1 and CS2 to beginner programmers at Trinity University for about ten years now. I think it works very well. The materials for CS1 are listed above. You can also find the course materials from the last time I taught CS1 at https://sites.google.com/a/trinity.edu/csci1320-f19/. This has links to individual playlists for each chapter in the book.

Note that the approach that we use begins with the REPL and scripts and we continue to use scripts for quite a while. Starting in Fall 2019 we began doing an OO approach earlier where I have students start to write object and class declarations instead of just using the scripting capabilities. I had students use VS Code with the Metals plug-in. I give them a starter setup with sbt as well since that seems to be the easiest way to get going with things on a student’s personal computer.

I’d be happy to answer questions you might have about how and why I do things the way I have chosen to do them.

1 Like

Thank you for your quick replies, @crater2150 and @MarkCLewis,

You may already have noticed, that most material for teaching Scala is aimed at people already familiar with Java or at least some other OO language.

Yes, I have. That’s not a problem for learning, but I can’t find anything on teaching.
Thank you also for the book and video recommendation, I’ll look into them.

I think, that Scala could be much better suited for beginners, as you have a lot less required boilerplate that needs explaining.

I agree.
@MarkCLewis, I also see tremendous advantages in a REPL because “edit/save/compile/run” becomes “type one line/get immediate feedback”. I’ll look into your materials, thank you for the pointer.

While I don’t use it, you might want to look at Kojo (https://www.kogics.net/kojo). Depending on your objectives it may or may not be a good fit. I’m not fond of such specialized tools for college-level CS majors, but I think they can be very good for other groups. I’ve used Greenfoot in the past for teaching Java and Kojo would allow a very similar pedagogical style but for teaching Scala.

1 Like