Skip to main content

Coursera: Functional Programming Principles in Scala by Martin Odersky

It's almost half year when I found a link on Twitter when someone pointed out to new course of functional programming in Scala. The course prepared Martin Odersky who also recorded all video materials. All enthusiastic programmers know that Odersky is author of Scala programming language. I've studied hard so after couple weeks I obtained a certificate. I have to note that it was my first meet with coursera itself and it left as best impressions as it could. But lets start from the beginning.

The course took 7 weeks. There was also first, zero, week which supposed to define targets, make people to understand topics etc. Everyone could also follow steps how to setup scala environment from the scratch along with Eclipse and SBT. SBT build system was new for me and I already put it into my notes as thing I need to study later. Contrary to course recommendations I used IntelliJ Idea all the time and I've not met any problem. It was just about the first setup of your environment but nothing new for me as I already made few REST services in scala using Spray. But back to the course itself.

Martin Odersky published couple of videos every week. The total length was about 1 hour (per a week) so nothing which would consume some significant part of your time. I've already have couple real experiences, some books too, with Scala so first weeks was crucial for me. As the name of course indicates, it's not only about scala itself but about functional programming. This was the point of first weeks. I finally found out basic terms, designs and flows how modern functional programming works. Well, everyone attended some course regarding functional programming at a college but this was really good.

The work of every week was covered by one or more exercises. Despite my original feeling I have to say that those exercise were brilliant and seems for me that it was the crucial part of overall understanding. My original feeling was much more worse that today - three months after the end of course. Why? It seemed for me as little bit academical. What's going on?

Odersky and his team prepared skeleton in scala, provide couple tests in the solution and lead you to provide the rest of missing programming code. The solution was compilable all the time but those tests where failing. You supposed to read the tutorial for an assignment and put missing code in there. The difficulty was changing in the time, especially assignment at the end of the whole course was little bit hard but everyone will understand working with collections or stream approach in scala to death :-)

The problem I pointed out few lines above is that I spent a lot of time with reading and undestanding of the problem itself, e.g. how works very popular game of infection, or how they design the skeleton, e.g. words decomposition in the assignment of anagrams.

Once you was satisfied with your solution you just use git with SBT's commit and send your solution to repository. I've already written that original solution already contained few tests. The lecturer developed more non-public test used to testing when someone committed his solution. This sometimes arouse passion because you have developed your solution, your tests works so you decided to commit it to coursera's repository. After couple minutes when their tests were done you found out that your solution is not working for large data. What to do now? You do not have that test, you even do not have attributes of large test. One can just look into his code and try to find problem without any real point where to start.

The last thing was the only issue on perfect course in all other respects. There was also a follow-up in the form of course about Reactive Programming. Thing went around Akka, async/await, Futures and promises and so on.

I really enjoyed the course. After few moths I have to say that it's much more efficient than any kind of reading - obviously because of assignments. It turns out into my almost primary target where to learn new things as there is multiple things to learn.


Popular posts from this blog

Performance Battle of NoSQL blob storages #1: Cassandra

Preface We spend last five years on HP Service Virtualization using MsSQL database . Non-clustered server. Our app utilizes this system for all kinds of persistence. No polyglot so far. As we tuned the performance of the response time - we started at 700ms/call and we achieved couple milliseconds per call at the end when DB involved - we had to learn a lot of stuff. Transactions, lock escalation , isolation levels , clustered and non clustered indexes, buffered reading, index structure and it's persistence, GUID ids in clustered indexes , bulk importing , omit slow joins, sparse indexes, and so on. We also rewrite part of NHibernate to support multiple tables for one entity type which allows use scaling up without lock escalation. It was good time. The end also showed us that famous Oracle has half of our favorite features once we decided to support this database. Well, as I'm thinking about all issues which we encountered during the development, unpredictive behavio

NHibernate performance issues #3: slow inserts (stateless session)

The whole series of NHibernate performance issues isn't about simple use-cases. If you develop small app, such as simple website, you don't need to care about performance. But if you design and develop huge application and once you have decided to use NHibernate you'll solve various sort of issue. For today the use-case is obvious: how to insert many entities into the database as fast as possible? Why I'm taking about previous stuff? The are a lot of articles how the original NHibernate's purpose isn't to support batch operations , like inserts. Once you have decided to NHibernate, you have to solve this issue. Slow insertion The basic way how to insert mapped entity into database is: SessionFactory.GetCurrentSession().Save(object); But what happen when I try to insert many entities? Lets say, I want to persist 1000 libraries each library has 100 books = 100k of books each book has 5 rentals - there are 500k of rentals  It's really slow! The inser

Java, Docker, Spring boot ... and signals

I spend last couple weeks working on java apps running within docker containers deployed on clustered CoreOS machines . It's pretty simple to run java app within a docker container. You just have to choose a base image for your app and write a docker file. Note that docker registry contains many java distributions usually based on open jdk. We use our internal image for Oracle's Java 8 , build on top of something like this docker file . Once you make a decision whether oracle or openjdk, you can start to write your own docker file. FROM dockerfile/java:oracle-java8 ADD your.jar /opt/your-app ADD /dependencies /opt/your-app/dependency WORKDIR /opt/your-app CMD ["java -jar /opt/your-app/your.jar"] However, your app would probably require some parameters. Therefore, last line usually calls your shell script. Such script than validates number and format of those parameters among other things. This is also useful during the development phase because none of us