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.
Post a Comment

Popular posts from this blog

Http and TCP Load Balancing with Kubernetes

Kubernetes allows to manage large clusters which are composed of docker containers. And where is large computation power there is large amount of data throughput. However, there is still a need to spread the data throughput so it can reach and utilize particular docker container(s). This is called load balancingKubernetes supports two basic forms of load balancing. Internal among docker containers themselves and external for clients which call you application from outside environment - just users.


Internal Load Balancing with Kubernetes Usual approach during the modeling of an application in kubernetes is to provide domain models for pods, replications controllers and services. Look at the great documentation if you are not aware of all these principles.

For simplification, pod is a set of docker containers which are always located on the same node. Replication controller allows and guarantees scalability. The last but not least is the service which hides all instances of pods - cre…

Validating nginx config file using docker approach

I try to setup nginx as a load balancer. The configuration is just a file with a lot of constrains so I need a validation. There is no online validation service, as e.g. CoreOS has, and I don't want to install nginx on my laptop as I work on a distributed app.

Docker is right approach for me. Let say I have following config:


In short, I'm going to pass nginx config to running nginx instance and look to the logs.

Put you nginx.config to the temp and start the docker image:

sudo docker run --name nginx -v /tmp/nginx.config:/etc/nginx/nginx.conf:ro -d nginx It uses volume mapping so the command just starts a new docker container and mounts a local /tmp/nginx.config to the given in-container path. You can obviously change the volume path to your personal path. Is it working or not? Look at logs.

sudo docker logs nginx If there is no entry, your file is fine. In the case of an error, you can see something like this:

2016/01/08 11:37:31 [emerg] 1#1: unexpected "}" in /etc/…