My university is using Scala for an Imperative Pro...
# random
y
My university is using Scala for an Imperative Programming course. I'm drafting an email to try to propose allowing Kotlin as an alternative. Any suggestions on points to include in favour of (or even against) Kotlin vs Scala
s
If I were a university professor, I'd feel resistant to a new language because it would be a lot of hard work for me 😄. If you can persuade them it'll be easy for them, that might help.
y
The examples given in the course and the practicals use features form Scala that look near-identical to Kotlin. I wouldn't be surprised if literally find and replace would automate 80% of the transfer
I'm willing to do the translations myself and provide commentary on them (it'll be a good exercise for understanding), but I can see that there'll still be some effort of course in changing teaching
s
I was about to say -- if you could actually complete the course in both languages, they might be up for using your work as a basis for future students to try it in Kotlin
I don't know how widely the two languages are used in different fields in industry, but an argument that Kotlin would attract more students and make them more employable could carry some weight too. Universities like to keep their "% of graduates in further education or employment" stats high.
y
A good point to mention btw is that Scala isn't the focus of the course. It's used as a vehicle for the course, but it isn't explored in depth as a language
Well, the university in question is Oxford, so I don't think the language learned will really affect the employability statistics of our CS graduates (I don't mean that arrogantly. It's just that companies snatch graduates pretty quickly from here already, so I don't know how much Kotlin vs Scala would affect that). I haven't looked up the statistics, but I imagine Kotlin wouldn't affect that that much. The argument itself though of Kotlin being more used in real-world applications than Scala is definitely a strong point!
s
Scala is certainly an interesting choice for an imperative programming course 🤔. Like Kotlin , it's certainly not a purely imperative language. Why do you think they picked it in the first place?
y
I think the course used to be in Java, and some of our professors started using Scala early on, so it naturally filled the role of "better Java". Some of the course material is ancient, mind you, mainly because no one really bothers to suggest changing it
s
Hah, I had a course that was in Groovy (of all things) for much the same reason 😄. Still traumatised from that.
I'm surprised by that though, if it were me I'd have stuck to Java (and indeed might not switch away from it even for Kotlin)
It's imperative programming after all... Much of what makes Kotlin more appealing than Java is its ability to not be so imperative
y
It's meant to be a beginner course, and so being approachable is really important (the only programming course we take before is FP in Haskell). I think being able to use light FP was deemed reasonable. What's frustrating me about Scala is that "nice" code is unpredictably bad sometimes. It has no
inline
analogous to Kotlin's, and hence everything uses closures; even their `for`loops use closures!
Scala also lacks some mutation-related functions that are really handy, like
mapTo
,
mapIndexedTo
, etc
p
It will help graduates land a job faster. Also the professor could play with Android/CMP projects at the end of the course. Scala is a boring console what it offers for UI. But of course the above point will fit a more advanced course. Some courses, especially the introduction to programming or data structure and algo, won't find much value in UI. But advanced courses like in 3rd or 4th year, let's say software architecture or software engineering advanced principles, kotlin will fit tremendously
g
I think Scala is a good but one argument for imperative Kotlin style is initiatives for competitive programming e.g https://docs.icpc.global/worldfinals-programming-environment/, https://www.jetbrains.com/icpc/