Posts tagged: ruby

More Coursera courses

In the recent months I participated in more online courses on Coursera. Once again it’s time to share some impressions. If you care only about functional programming I suggest you skip directly to Programming Languages section of this post, but I highly encourage to read reviews of two other courses as well.

Think Again: How to Reason and Argue

Some time ago I’ve been quite interested in proper ways of arguing and in spotting logical errors in argumentations. Needles to say when this course was announced I enrolled without hesitation. It looks that this subject draws a lot of interest since this was in fact one of the most popular Coursera courses to date. The course lasted 12 weeks, which in my opinion is very long for an online course – even Compilers took only 10 weeks. The course wasn’t very time-demanding, taking about 2-3 hours a week to watch the lectures and possibly another hour to complete the homework. I didn’t get the textbook so I did no additional reading but I guess this would take another 3-4 hours a week.

The course was divided into 4 units. Unit 1 was about analysing arguments: identifying premises and conclusions, separating relevant argumentation from verbiage, distinguishing between valid and invalid arguments, rephrasing the arguments and so on. I’m good at pure sciences and not really good at humanities so this unit was a bit hard for me. Still it was interesting. Unit 2 made a turn towards propositional and categorical logic. This on the other hand was easy for me, but I felt this was only dry theory and there was no demonstration how to apply it in analysing or giving arguments. Unit 3 covered inductive arguments, causal reasoning and probabilities. Once again the material was easy for me and interesting, but it wasn’t placed in a larger context and few applications were demonstrated. Finally Unit 4 focused on logical fallacies and refuting arguments, which are the topics I’ve been waiting for the most. The presentation of material was very good and I had the feeling I understand all of it, but when it came to tests it turned out that I actually have problems with applying in practice what I have learned. This was a bit frustrating. Oh well, I guess I wasn’t born for the humanities.

Think Again was the most fun online course I have participated in so far. This is mostly thanks to the great lecturers Walter Sinnott-Armstrong and Ram Neta, who put a lot of work and energy into lectures to make them both interesting (even entertaining) and informative. I think few things could be improved in this course. When it is redone in late August (that’s the current plan) I highly recommend it to anyone

Heterogeneous Parallel Programming

The subject of Heterogenous Parallel Programming was parallel programming in CUDA. This is a subject I got interested in recently so I decided to participate. While Think Again was one of the best online courses I took, this one is by far the worst. It’s hard for me to explain how big disappointment this course turned out to be, though perhaps I shouldn’t be so harsh on it because I decided to quit during the third week.

Heterogenous Parallel Programming was supposed to start in early September. It was delayed by almost 3 months and began at the end of November but even then it was clear that the course is not yet prepared. There were numerous technical issues with the online platform used for homework submission though this can be forgiven. What I find unacceptable however is the delayed delivery of the course material. The delays resulted in extending the course from initially planned six weeks to eight weeks, which some people on the forums have complained about and I totally agree with them. I know that it’s hard to take many online courses when they overlap and extending the course by two weeks might be a real issue. I also found the level of material covered in lectures to be unsatisfying. The course assumed knowledge of C. Still, lectures focused mostly on discussing very basic C language constructs and algorithms, e.g. during first week one lecture gave a lengthy explanation of converting index of a two-dimensional array into a linear index. Come on, this is basic C! If it was assumed that participants know C why go into details of such a basic algorithm? This was in fact the problem with many lectures I’ve watched. The pace was slow and the focus was put on C instead of CUDA. Sadly, all the lectures ended with the information that in order to learn more I need to read the book. Perhaps unsurprisingly the book is authored by professor Wen-mei Hwu, who is also lecturing in HPP course. This was really disappointing and I decided to drop out of the course when I realized that I would learn a lot more about CUDA if I spent three hours a week reading the documentation and tutorials instead of participating in this course. There were lots of other minor annoyances: course staff decided not to use the standard Coursera interface and instead created their own, which often had mistakes and broken links. While most courses send 1-2 emails a week, the staff  of HPP kept spamming the participants with tens of irrelevant emails a week (up to four a day), notifying people that “we just enabled some option” and two hours later “we changed some layout” and so on. Luckily the notifications can be turned off, but this also means you won’t get the relevant ones.

So is there anything good to be said about HPP? Luckily, yes. Professor Wen-mei Hwu was very responsive and replied to many objections people have raised in the discussion forums. As you see from the above review I am not convinced by these explanations, still it’s a big plus that he took part in the discussion. I don’t know how this course has ended. I guess that you can learn CUDA from it if you really want but judging by the first weeks of the course it’s better to just grab some online tutorials.

Programming Languages

Programming Languages is a currently ongoing course that covers different aspects and features known from various programming languages. The topics include recursion, scoping, higher-order functions, pattern matching, algebraic data types, parametric polymorphism, currying, type inference, laziness, memoization, macros, inheritance, mixins and many more. As you may have noticed most of these features are typical to functional languages and indeed the courses focuses on functional approach to programming. Languages used in the course are SML, Racket and Ruby, though the course is not about these languages per se – they are only used to demonstrate various features a programming language can have.

The course is very demanding. During 10 weeks there will be eight sections of the material. Each section has usually over 3 hours of lectures. It takes about 4-5 hours to watch them due to the breaks you will likely take between the lectures as well as the time needed to test on your own the demonstrated code. Homework is also time-consuming. It took me about 3,5 hours to complete the first assignment and 2 hours to do the peer review of other participants’ solutions (that’s part of the grading). I think this is quite a lot given my background in functional programming. Others have reported times of up to 12 hours and I know many people have given up on the course because of the difficulty. I myself have given up not because of the difficulty itself but simply due to the lack of time. Sure, learning more about SML and Racket would be fine but I’d rather spend those 8-12 hours a week working on Haskell. I still watch some of the lectures that cover topics that interest me.

While I think that making the course material challenging as it is now is a good thing I don’t like the strict policies about deadlines. There are about 9-10 days for each assignment and the hard deadline comes only two days after the soft one. Given that the lectures are released in the middle of the week, people working full-time will have to put a lot of work to successfully complete this course. That’s a pity, because the course is awesome and relaxing the deadlines would make it accessible to a wider audience without lowering the quality of material. Still this is a highly recommended course.

7 Languages in 7 Weeks. Book review

I already mentioned a couple of times that I’m new to functional programming. My fascination has a very precise starting point. It was thanks to a book “Seven languages in seven weeks” by Bruce A. Tate. I found out about the book somewhere in October 2011. It was yet another publication from Pragmatic Bookshelf series that I wanted to read. As the title suggests, it presents a guide to seven programming languages and I knew none of them: Ruby (“It’s something like Python, I guess”), Io (“WTF?”), Prolog (“How does programming in logic look like?”), Scala (“Oh, a friend uses it so it must be practical”), Erlang (“Oh, I heard it’s something like Haskell”), Clojure (“I think I heard something about this LISP thing…”) and Haskell (“Oh, I heard it’s something like Erlang”). So generally I had no clue what these languages are, but I knew I’d like to learn them, especially that I haven’t learned any new language for about 2,5 year. David Thomas and Andy Hunt in “Pragmatic Programmer”, that is a modern programmers bible – if you haven’t read it yet go grab a copy, I’ll wait – recommend that a programmer should learn new language every six months. Looks like I had a lot to catch up. And then somewhere in the beginning of December I found Polish edition of “Seven Languages in Seven Weeks” in a book store. I couldn’t miss such an occasion.

The idea of learning a programming language in one week is a bold one. Learning seven languages in seven weeks seems even bolder. Bruce Tate says it outright: reading the book will require a lot of work and assumes readers good knowledge of programming in general. And it really does. The first language, Ruby, was rather easy, mostly because it is similar to languages I already know. The second language, Io, was my personal failure. I could not grasp it. Despite it’s simplicity I had problems understanding the basic concepts of the language (mostly passing messages) and the official documentation offered little help. This discouraged me a lot, but luckily the next language, Prolog, turned out to be extremely fun. In fact I put down the book and started reading online tutorial on my own. From it I learned about tail recursion using accumulator. Language number four was Scala. I was looking forward to learn it, as I’ve already heard some stuff about functional programming. Unfortunately, Scala turned out to be disappointing to me. Not that it’s a bad language. I think it can be great, but I wanted to learn functional programming. Scala, being a hybrid language – both object oriented and functional – didn’t provide me with good clues where the object programming ends and the functional begins. I liked the concept of folds, though. Erlang was next. I liked it because of it’s similarity to Prolog, but honestly speaking I didn’t put much effort into learning it. Following Erlang was Clojure, a dialect of LISP for the JVM…. ops, I skipped that chapter of the book! Seriously, I did. I wanted to learn LISP and in some strange way I drifted away from Clojure to Scheme. I’ve read the R5RS language specification and The Little Schemer – I’ll definitely write about it on this blog. Finally came Haskell. I was anxious to learn it and I must say that the purity and logic of this language keeps me fascinated for the last three months

Ops, I strayed away from the book itself. Well, the book’s nice but I’ve certainly read better ones. In fact if I were to rely only on it I wouldn’t learn much. Many topics are covered very superficially (good luck understanding monads!) and to fully understand them I had to spend hours reading tutorials on the web. I realised that when I was learning Erlang I just started reading Learn You Some Erlang for Great Good and after completing eight chapters from it I read the book only to conclude that I already know all of that. But I think that’s irrelevant. I think that the most important thing about “Seven languages…” is the fact that it’s motivating. It made me learn languages on my own and that’s great, cause I haven’t done it for such a long time. It also exposed me to the basic concepts of functional programming and I am thankful to Bruce for that. To me it was one of the most influential books in my programming career, but honestly speaking you can do without it and learn these seven languages just as well, providing that you can keep yourself motivated.

P.S. While I was reading the book I found Ben Nadel’s blog to be very supportive.
P.S.2 This is not a concern for most of you, but I found the Polish edition of the book to be poor. Translation is sometimes wrong, unclear or hard to understand. Code listings contain lots of mistakes, including translating some of the language keywords.

Staypressed theme by Themocracy