Yann Régis-Gianas, lecturer/assistant professor at the University of Paris Diderot - Paris 7, has chosen Scala and the Simply Scala web site to help him teach the Advanced Object Oriented course this fall. Here he explains why.
The aim, he says, is to guide students to a deeper understanding of the object-oriented paradigm. He explains that Scala offers modern answers to many of the underlying issues, the problems of decomposition, modularity and correctness, for example. Scala features allow students to practically explore both the object oriented and functional approaches to problems.
The teaching challenge is to present the concepts in such a way that the student gets a real feel for the O-O benefits, the trade-offs and what are the key questions to ask.
- How does an object oriented programmer decompose problems? What is this thinking process good for? What are its limits/drawbacks?
- Why is the modular object oriented approach famous for its scalability? What are the pros and cons of class-based programming with respect to modularity? What are the design patterns and modern programming mechanisms that help working around these problems? How to write reusable generic components?
- How do you move from safety to functional correctness? How to get static guarantees about O-O components? What does a modern type system prove? How to write a hoare-like specification that is suited for OO programs? How to prove or, at least dynamically check, them?
It is important that students can test their understanding quickly without wasting time on setting up their PC with a complete IDE. Simply Scala provides a nice solution, not only allowing the students to create and run small Scala programs directly from a browser but also providing a Scala tutorial and reference. A nice way to learn Scala, but the majority of his course participants are French speaking so Yann joined forces with Anthony Bagwell, the Simply Scala site creator to provide a French version of the on-line Scala tutorial.
He says it is not long before students understand the basic concepts and are ready to use Scala's advanced features to appreciate the benefits of functional decomposition, bounded polymorphism and a rich type system.
- They quickly grasp when the OO approach is not as relevant and see when a functional decomposition would be better to deal with a specific problem. In Scala the program can be express as a function composition. The students soon become aware of the benefits of referential transparency. Scala's distinction between 'val' and 'var' is a first step in that direction.
- The mixin composition mechanism as well as the higher-order bounded polymorphism of Scala are a must-know to write modular reusable components. Yann says that the fact that most of the standard design patterns are made redundant in Scala is probably an excellent indicator that it is a good replacement candidate for Java.
- Scala's rich type system is strong enough to embed GADTs, some form of dependently typed programming and type classes and provides a great laboratory for students to experiment with type-level encoding of functional properties. Furthermore, there are some neat unit testing frameworks in Scala. Not only are they good to know and but also allow behaviour driven development to be explored.
Yann says that "Scala provides a excellent teaching language for object orientated concepts and Simply Scala a great place for students to get started, and all in French too!"