Monday, July 31, 2006

Element of practice in programming

Sportsmen, artists, musicians... all follow a system of practice and tournament|product|concert. In the tournament they have to be perfect, but that perfection comes from hours of practice, mistakes, and explorations that happen during training. Software developers on the other hand are always working in tournament mode... cranking code for clients. This is not good, because they do not get a chance to practice, explore, make mistakes, and polish their skills. Some might argue, that their practice happens at work. But such practice is very limited, because at work, developers are always working under time pressure. For practice to be effective, it must happen in a pressure free environment where the trainee can explore, repeat, and perfect her skills.

A Kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. Dave Thomas, has combined the principles of Kata and coding practice to create a unique form of coding exercices called code kata.

In very simple words a Kata can be any coding exercise that will help you practice an element of coding and learn. When a coding kata is done in a group it is known as a coding dojo. These are very simple concepts (but effective) and have very simple rules to make the excercise effective.

Dave Thomas suggests these simple rules for a succesfull kata.

" What makes a good practice session? You need time without interruptions, and a simple thing you want to try. You need to try it as many times as it takes, and be comfortable making mistakes. You need to look for feedback each time so you can work to improve. There needs to be no pressure: this is why it is hard to practice in a project environment. it helps to keep it fun: make small steps forward when you can. Finally, you’ll recognize a good practice session because you’ll came out of it knowing more than when you went in." - Dave Thomas

The following rules for conducting a coding dojo are posted on the Agile Finland groups wiki

Rules of Dojo

The rules and workshop agenda presented here are preliminary and will be changed based on the experience gathered from previous sessions. 

  1. There is a coding challenge that is announced beforehand.
  2. There is a room with one computer attached to video screen.
  3. The presenter explains the coding challenge and starts the Randori with a pair from audience.
  4. One half of the pair is changed every 5 minutes. (Personally I think 5 is too short, maybe 10 would be better - Parag)
  5. The pair on the keyboard should continuously explain what they are doing.
  6. The pair on the keyboard should stop when someone from the audience falls off the sled -- and only continue when that someone is back on track again.
  7. The pair will use TDD (Test-Driven Development).
  8. All produced code will be made publicly available using Apache License, Version 2.0.
  9. The programming language to be used is announced in advance per session.
  10. The maximum number of participants is limited to 15.

These techniques are extremely effective in improving software development skills. From now on, be sure to carve out some time every week for individual or group practice sessions, and share you results with the rest of the user community by posting your experiences as comments to this blog.

Wednesday, July 26, 2006

Podcast Session at Omniscient

Had a very interesting podcast listening session at Omniscient today. We listened to an audio interview of Martin Fowler from Bruce Eckel's thinking in code series.

Martin Fowler spoke about a lot of things ranging from MDA (and WHY IT CANNOT WORK), why he stays away from multi-threading, his thoughts on authoring and refactoring.

He explains why programming cannot be thought of as constructing a bridge. The only people who seem to think that programmers are a commodity are those who have not written a line of code in years.

I would really like the team to give some feedback on what they learned from the session, what they liked, and what  they did not like.

Java SE 6.0 has smoother rendering

Prior to Java SE 6.0, there were some issues with Swing painting.
  • When a minimized swing window was unobscured, it took a while for it to repaint. Till then the user saw a gray box. I think they also call it the "gray rect" problem :-)
  • Assume that the application is blocking the event dispatch thread (maybe because it is performing a large computation or loading a large file...). If we minimize and application, then it will not show a painted window upon unobscuring untill the event dispatch thread is unblocked. (offcourse we should not block the event dispatch thread for such a large task. Ideally a task larger than 250 ms should be started in a seperate thread)
In Java SE 6.0 these issues are resolved with "true double buffering". Java maintains a buffer that keeps an image of the onscreen window. This buffer is updated whenever the contents of the onscreen window are changed. If we minimize and then maximize the window, the window will not be repainted from scratch, instead it's image from the buffer will be copied to the video memory (using the toolkit thread). This elliminates the "gray rect" problem since the window will be displayed immediately without any time lag. Since the buffer is maintained in the hardware (most likely video RAM), it is true double buffering.

I am not very certain what a toolkit thread is. Will find out, but in the meanwhile if anyone knows, please post a comment.

The fine print:
True double buffering is enabled only on the windows platform at the moment. However it is implemented for other platforms as well, and will be enabled soon.

Monday, July 24, 2006

Video By Richard Stallman

Everyone must watch this absolutely awesome video by Richard Stallman on why free software is important. He had a vision in 1983, and over two decades later he is still absolutely dedicated to it. 

Among other things, free software promotes learning, because in RMS's words when a student is doing something with a computer, maybe typing  a command, he might be curious to understand how it works. Well if he is working on a GNU/Linux box, he will actually be able to do that. This ability is the biggest advantage, because it allows students to study a system under the hoods. 


Friday, July 14, 2006

Learning 2.0

What do you think is the future of education?
ELearning?... Classroom Learning?... or Blended Learning?

All of the above have their supporters and detractors. Without taking any sides, I think each methodology has it's pros and cons. What is effective depends on the type of course, background of students, and access to technology infrastructure. However, there is a trend that points towards the growing popularity of eLearning, and not without reason. A professor in UK has abolished classroom lectures and has replaced them with podcasts, forums, email, and the like. Read more about it here.

Having taught technical courses from the last three years, I have some observations on the process of teaching & learning.

The process has various components:

  • Presentation of facts
  • Resolution of queries and doubts
  • Ensuring that the facts are retained (through questions and repitition)
  • Promoting a better understanding through discussions and thought provoking questions
  • Promoting even deeper understanding by encouraging reflection by the students (by writing )
  • Helping students understand practical applications of the concepts (through assignments and lab sessions)
  • Testing the student's understanding (through tests and quizzes)
  • Encouraging innovation in students
Maximum time in classroom sessions is taken by the first component; "presentation of facts". Is a classroom session really needed for just presenting facts? I do not think so. Granted that a classroom session helps students with their queries immediately, and it helps students stay focussed, but it is a very small advantage as compared with various other disadvantages.
  • In a classroom session the faculty has to go at a pace which is an average of the learning speeds of all the students. This is still too fast for those who need more time, and is frustratingly slow for the quick learners.
  • Not all queries can always be resolved immediately. If a course has to be taught over let's say 10 weeks, then every class has to have an agenda, because the faculty has to complete a certain portion of the course in the given time. Every class does have buffer time for answering questions, but it does not allow an unlimited number of questions. Very often while teaching I have had to stop a discussion and ask the students to meet me later to get their doubts answered, because we were running short of time.
  • Students usually do not get time to reflect over what is being taught immediately in class. The reflection has to happen later on, and questions that arise are usually answered electronically by the faculty anyways.
  • Because technology moves at such a rapid pace, the faculty may not have an answer to a particular question (the faculty's knowledge is slightly outdated). In such cases the discussion has to be deffered either to the next class or it has to be done electronically.

The primary use of real time sessions should not be to present facts, but to support the learning process of students. These sessions should focus on answering doubts, having discussions, exploring the nuances of the topic, various pros and cons, potential applications, and other similar efforts. This is an area where the faculty can contribute his experience and knowledge which will help students take their learning to the next level.

So to ask the question again. Is traditional classroom learning the best method of imparting education? Probably not. Asynchronous, collaborative, networked, experiential learning, using technological aid can be far more effective. Sorry for making that a bit complex, but I could not think of a word that correctly captures the essense of the previous sentance.

How do we go beyond traditional learning? Are there best practices? Do we have proven methodologies?

We probably don't because this is such a nascent area. Partly as a result of my observations but majorly from the observations and findings of instructors who have tried to go beyond traditional techniques, I have created a list of tools that can be used for learning.

  • Learning Management System
  • Podcasts
  • Blogs
  • VideoCasts
  • Screencasts
  • Video-conferencing
  • Online quizzes
  • Learning Journal
  • e-portfolio
I would love to hear real life experiences from educators who have used these tools.