3
$\begingroup$

I work in a startup where each week, a member of the team does a short presentation (30-60 min) on a subject in front of the others. It is a very informal and relaxed session, but now it is my turn and as an intern, I feel concerned about being boring and failing to show my colleagues the interesting features of the subject I picked, which is the programming language Scala. They are all familiar with Java (on which Scala is based) but probably not with functional programming.

So, here is my question: How should I do my presentation to actually entertain them and have them learn some useful bits ? For instance, which kind of "live" examples / exercises could be interesting to demonstrate the particularities of the language?

$\endgroup$
3
$\begingroup$

Just a couple of ideas here for an easy intro to Scala, though not very deep. Note that there is an online Java to Scala converter.

The first idea is to translate (offline) something you are currently doing in Java into Scala and show it to them. The converter will make this trivial. They are already familiar with the code's structure.

The second idea, assuming that you are doing something like Swing, is to use anonymous functions (lambda expressions) as listeners in some code your colleagues are already familiar with.

The third is to use the fact that Scala does an even better job than Java 8 at pattern matching for typing functions. You could show them something that uses, say Consumers or BiConsumers and matches by structure rather than type names. Of course, you can already do this in modern Java too.

But the above ideas build familiarity without inducing much confusion. The ideas are all in Java, but the syntax is a bit different.

Then, if you have time and know the language well enough, you could develop some simple class from your own app in Scala directly, using pair programming. All you would need to do is get started, so if you run out of time things should still be fine. Here you can introduce a few things that are not the same as in Java. The earlier steps should ease the path to this step.

$\endgroup$
3
$\begingroup$

I'd start with something useful that takes yards of code in Java and only a few lines in Scala (assuming there are such things).

After two or three examples like this, you'll have hooked your audience. Move into a compare/contrast of language features. Talk about what's easier in Scala. For fairness, talk about what's easier in Java. Then move to how/whether you might adopt Scala in your workplace - or why it wouldn't be practical now but under what circumstances it might be.

$\endgroup$
  • $\begingroup$ Could you add an example of something that is expressed much more concisely in Scala than Java? $\endgroup$ – thesecretmaster Aug 17 '17 at 0:23
  • $\begingroup$ Nope @thesecretmaster. I don't know Scala. $\endgroup$ – G. Ann - SonarSource Team Aug 17 '17 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.