On app.net (the alternate Twitter) someone posted a link to this AlJazeera editorial, Lance Armstrong: A Cheater? Five reasons why we don’t care. It more or less says what I think about the whole Lance Armstrong thing.
I wear the LiveSTRONG band to remind me of Amy, and Helen, and Michele, and Riley. Not that I need reminding but in some way it focuses me on the positives their lives brought to mine, and helps me past the hole their various cancers left in my soul.
Maybe we should allow performance enhancing drugs and treatments in sports. I’m sure there is example after example of training methods and techniques that are legitimate in today’s competitions that were illegal in years gone by.
I’m sorry that his reputation and efforts are now being smeared. And I am saddened by the amount of schadenfreude some news agencies and bloggers are displaying. It seems the we as a society delight in making heroes only slightly more than we delight in tearing them down.
Finally, all of this reminds me of my favorite quote, from Theodore Roosevelt:
“It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming; but who does actually strive to do the deeds; who knows great enthusiasms, the great devotions; who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be with those cold and timid souls who neither know victory nor defeat.”
Tomorrow will mark the start of week five of Functional Programming Principles in Scala and my frustration level with the course continues to grow. While I like the way the course is presented - through topical videos that include interaction opportunities for me, I am unhappy with the assignments. There are two aspects to my dislike: one - the highly “computer science-y” angle all the problems take, and two - the lack of evaluation on my assignment submissions.
This week’s assignment centers around Huffman Coding. I had to look it up. Turns out its a lossless compression routine developed in an MIT Ph.D thesis. After many hours of diagramming and thinking about it I now think I understand it enough to tackle the assignment. Only the level of effort published for the course is 5 - 7 hours per week and I’ve already invested more than twice that on week four and I still have 90% of the assignment left to complete. Tomorrow a new round of video lectures will be published, and a new assignment will be made. Whatever I am learning about functional programming is being lost in the chaos of just trying to keep up.
The course does have a forum and it is fairly active, but I have stopped trying to use it as a resource and it only serves to batter my already bruised ego even more. There are any number of “the assignments are too easy” postings. Or “I completed week four using only ‘one-liners’”. That I’m not finding the assignments easy, and that my submissions aren’t filled with one-line solutions makes me think I’m doing it wrong.
Which brings me to my second gripe. When I submit my assignment it gets scored - not evaluated, not critiqued. There are over 40,000 people signed up for the class so there is no way all assignments submissions could be evaluated. What happens is your work is tested against a master set of assertions and, if it passes those, you get all the points. There’s also some “style” checking to prevent you from using non-functional attributes of the language. There is no evaluation of your code to say, “that’s a good approach”, or, “you shouldn’t do this and here’s why…”. Each week has built on the concepts of the previous week, but I have no confidence that my understanding of the previous week is solid. Throw in the assignment complexity issue from above and you have a recipe for frustration and anger.
There have been people asking for the solutions to the assignments to be published, however the course staff has pointed out that this course will likely be offered again and will use the same assignments. The explanation given was that it would require too much work to develop new assignments and the scoring tools each time it was offered. So not only are our submissions just scored and not evaluated, there is no feedback at all as to how these problems ought to be solved.
I’m just an old-fashioned brute force programmer who got his start on punch cards and paper tape in the 1970s. My code may not be elegant or sophisticated, but it works and it has always been written with an eye toward maintainability. Spending several years on call for a batch billing system that ran between 2 am and 6 am every night I learned to write code that worked, and if it didn’t work, was understandable to people who were half asleep while trying to fix it. The ‘one-liner’ solutions that seem to be the rage with functional programming strike me as being extremely difficult to maintain in the middle of the night. I’m not going to write off functional programming as a good approach to some problems, but I am disheartened at the direction this course has taken.
I’m into the fourth week of my functional programming course on Coursera and while I like the course and the way it is presented through Coursera, I do have a couple of quibbles.
On the course description for my class the effort required of the students is given as 5-7 hours per week. I have easily invested twice that each week of the course so far. It may be that I am a slow learner and just need more time, but I think the time estimates are optimistic at best, and wildly off at worst. The set of lectures for the fourth week are two hours all by themselves. I fear the amount of effort to keep up with the class is only going to grow.
The course format says that class will consist of video lectures of 6 to 15 minutes length. The first week had 6 videos ranging from 4 minutes and 22 seconds up to 14 minutes and 32 seconds. The total was just under 62 minutes. Week two had 5 videos ranged from 4 minutes, 13 seconds to 14 minutes, 58 seconds, for a total of just under 53 minutes. Week three had 5 videos again, this time totally nearly 90 minutes. One video was over 25 minutes long. This week has 7 videos totally over 2 hours of viewing time.
The content in the videos is well done, and Martin Odersky is a fantastic teacher, but consuming a third of the expected weekly effort just in watching the videos once is getting away from the point of Coursera. I’ve watched most of the lectures twice and some of them three times - that’s the point of having them. Having two hours of new material makes repeat watching an expensive proposition. While you can pause a video, it isn’t easy to skip back a minute or two to rehear a point. You can grab the progress indicator and move it, but this is cumbersome. I wish they would implement a 10 or 30 second backward skip control on the player - it would make watching the videos even better.
My final quibble is the problem domains chosen for the assignments. With no prerequisites for the course I was unprepared for the rather mathematical nature of the problem sets. I understand that functional programming has lambda calculus at its root, but I wasn’t prepared for the very abstract nature of the solutions. The code for the solutions has been amazingly short and succinct, the concepts behind the solutions have taken me hours to grasp. As this is my first exposure to any kind of functional programming I don’t know if all functional programming solutions are so esoteric, or if the problem domain selected for these assignments makes it seem that way.
I am determined to complete the course – so far I’ve gotten all the available points – but I am finding it to be considerably more effort than I expected, and far more time consuming that advertised. I am getting an education in functional programming concepts in Scala from the man who created Scala – for free, so I can’t complain about the price, but I do recognize that Coursera is in its infancy and they have some course structure and presentation wrinkles to iron out.
In January 2008, Sibylle and I created a new Website for her piano studio and registered her domain. The Website was all static pages that were hand-coded. After much work I managed to cobble together a WordPress theme that mirrored her site, allowing her WordPress-backed blog to have a similar appearance. As nice as the design was, after nearly 5 years it was getting a little long in the tooth, so we spent considerable time over the summer trying to find a good WordPress theme for her entire site - both the static studio pages and the blog. One of the goals was to have a site that she could maintain herself; the initial static studio pages had all ben maintained by me.
After not finding a suitable WordPress theme – while there are thousands and thousands of themes available they all looked the same – we finally decided to use Squarespace. Squarespace is a bit like WordPress.com; they handle all the backend work, you just edit your content and publish. At first glance it seemed to be a good way to go, especially since they had a very elegant theme that suited her site’s needs and her aesthetic sense.
Unfortunately Squarespace has proven to be a poor solution. The site administration functions perform poorly when using Internet Explorer on Windows. In fact it was quite easy to rapidly mangle the layout and then not be able to straighten it out.
This week we moved her studio site to a self-hosted WordPress instance. Rather than searching for the perfect theme we decided to just use one of the default themes for now. Getting her site on WordPress where she could edit its content was more important than having the absolute perfect theme. Imagine our surprise to discover that the latest WordPress provided theme, Twenty Twelve, is not only elegant and responsive, it closely mirrors the theme we had been using with Squarespace.
After a couple evening’s work to move the content and verify everything was in place, I made the necessary DNS change last night and today her new studio site is available. Canceling the Squarespace account was quick and relatively painless. Had we canceled the account within the first 30 days we would have gotten an 11-month refund, since we are at roughly 60 days we will get a 6-month refund. After 90 days there is no refund.
I think Squarespace is a good solution - provided you don’t want to use Internet Explorer to manage your site. And provided you are comfortable in the cloistered environment that they provide.
Recently I wrote about staring a class with Coursera. The class I am taking, Functional Programming Principles in Scala is now into its second week and I am pleased with my progress. It hasn’t by any stretch been easy - after 35+ years of imperative programming trying to think in terms of recursion and functions is difficult.
I would love to write about the assignments we’ve been given and about my solutions and how I arrived at them. However, since this course, like many on Coursera, offers a certificate to participants who successfully complete the course work, there is an honor code that I am bound by that includes an injunction against making solutions to assignments available to anyone else. In one of the class forums someone asked if the solutions would be provided after the deadline for the assignment had passed and the staff response was, in a word, no. There are plans to re-offer this course in the future and it would be too great an effort if they had to update the assignments, and the automatic grading, for each class offering.
Having said that there are still some aspects of functional programming I think I can talk about here without violating the honor code. Perhaps the two biggest insights I’ve gained from the first two sets of lectures center on recursion and functions as types.
Recursion is a concept I was already familiar with but not one I’ve made great use of in my programming career. While I was in college one of my assignments was to write a program that would solve the Towers of Hanoi puzzle. This is the game where you have three posts, one of which has a stack of disks on it. The disks are stacked from largest (on the bottom) to smallest (on the top). You have to move the entire stack to a new post with out putting a larger disk over a smaller one. Programmatically the solution makes use of recursion. Recursion simply means a subroutine or function that calls itself. As long as there is a condition that terminates the recursion it works. What I remember most about the Towers problem is that the number of moves can be calculated as the 2 raised to the number of disks minus one. 3 disks = 2**3 - 1, or 7 moves. We were told not to test our solutions with any more than 5 or 6 disks as we could tie up the processor on the mainframe.
One of the tenets of functional programming is immutable variables. Most (all?) imperative languages have mutable variables. You can create an accumulator and increment it every time set condition happens. At the end of the execution you’ll know how many times that condition occurred. While there is nothing wrong with mutable state, it becomes vastly more complicated when you start having multi-core processors. Spreading the computing load of your application out over multiple processors, simultaneously, makes it possible for one instance of the code to be impacted by mutations from another instance of the code. Eliminating mutable variables avoids this complication making it easier to support concurrent execution on multiple processors.
Instead of having mutable variables you have functions, which can recursively call themselves logically mimicking the effect of mutable variables without physically altering state. At first blush this is a difficult concept to wrap your head around, especially if it has been marinating in a mutation happy imperative programming world for several decades. Not only does functional programming make heavy use of recursion, it makes use of functions as types.
Data is described in terms of its type. Character data has one type, while numeric has another. Some times are subdivided: integers and floating point for example. With functional programming you can define a new type that is a function. This week we were given a type definition of template for defining sets of numbers. And using that type you could create a rule for determining if a number was even.
type Set = Int => Boolean
val evens: Set = x => x % 2 == 0The first line defines a type, called Set as an integer that satisfies some boolean expression. The second line creates a new value, called evens that implements a rule, x % 2 == 0 to determine if the integer is an even number. (In Scala the % indicates modulo arithmetic, which simply means divide and keep the remainder, so x % 2 divides the number by two and if the remainder is 0 we know it’s an even number.)
THe hard part about evens is that is doesn’t contain a single number. It is just the rule for determining if a given integer is an even number. evens(1) would return false as 1 is not an even number, evens(2) would return true as 2 is even. I spent most of the week struggling with the idea that any Set I defined didn’t actually hold any numbers - it just held a rule for determining membership to the set.
Our assignment this week centered around creating some functions to manipulate our newly defined Set type, including intersections, unions, differences, and contains. The hardest of these required determining if the numbers granted membership to the Set also satisfied the membership requirements of a predicate (another Set) either singly or the whole set. All week I kept thinking I could do this with a loop and some tasty mutable variables - but that would be imperative coding and not functional. Once I found the solutions to the problems I was struck with how simple they were - in most cases a single line of code. Simple in implementation but massively dense in concept.
Functional programming has its roots in lambda calculus, and I suspect a healthy does of symbolic logic. Calculus and algebra where not my favorite subjects in school, so I’m not sure I’ll ever be a functional programming convert. I am convinced that the future of programming will depend upon functional concepts as our processors aren’t going to get faster, they are just going to have more cores. And in order to utilize those cores applications will need to be capable of maintaining their internal start without mutable variables.
A fascinating article by Adam Fletcher which outlines a four-year computer science curriculum using Coursera offerings. It even leaves room for non-computer science based courses to round out the knowledge base gained. While I don’t think brick-and-mortar schools are over, I do think that in addition to their physical campuses, universities need to develop robust, active, and engaging virtual campuses.
Simply wonderful.
I’ve lived most of my life under one or more of these tornado tracks.
Through a colleague I recently learned about Coursera. Coursera provides over 120 free, online courses from 16 top universities. What sets Coursera apart from other online course offerings is the level of interaction and feedback provided. I have watched a couple of Stanford courses in the past year, working through the assignments on my own. While I have learned from these experiences, there has been no official feedback from the lecturer and no way for me to participate in the class.
Coursera aims to provide an interactive experience, complete with grading and, in most cases, some kind of certificate upon successful completion of the course material. Lectures are broken into short 8 to 12 minute videos about a topic. These videos have embedded questions in them that all students must answer before continuing. Assignments are machine graded making it possible for very large groups of students to receive feedback about their work.
This TED talk by one of the founders of Coursera, Daphne Koller, explains the genesis of Coursera and their goals and ambitions.
I’m signed up for Functional Programming Principles in Scala, which is offered by École Polytechnique Fédérale de Lausanne and taught by Scala’s creator Martin Odersky. Through a forum posting on the course page I understand that there are over 30,000 other registrants for this course. So far I’ve completed the tools setup and example assignment. I’ve also been active in the course forums. The actual course begins this week and runs for the next seven weeks.
I am excited about the potential distributed learning like this offers. That I can take a class about Scala with the language creator - for free - along with 30,000 other people is astonishing. There will always be a need for brick-and-mortar universities, however the ability to augment and enhance one’s education with interactive online education from top educators global represents the future of education. I’m thrilled that I have this opportunity and I look forward to participating in many more Coursera courses.