Ruby is awesome …
A couple of days back, I picked up Ruby as a programming language. And to say I was blown away would be an understatement. I am a huge fan of Python - for its ease of use, agility in development and most importantly its object oriented nature. Ruby provides all these and adds to it a few killer features.
Some of the things I founds really interesting:
1. Code blocks - If you have actually used function pointers in C/C++ and realised how big a pain it is, then this is one really satisfying feature.
Eg:
def callback(name)
if(name == “sriyansa”)
yield(name)
yield(name)
else
yield(name)
end
end
When this function invoked as follows with a code block, each yield in the above snippet executes the code in the block.
callback(”pappu”) { |name| puts “Hello World …#{name}” }
Imagine how easy it would be to implemet a co-routine library with this feature and the things possible with recursive code blocks.
2. Mixing of classes - Somebody has implemented a cool module. And you want to use the implementation. Just mix these with your class definitions.
Eg:
class MyClass
include Comparable
def <=>(ext)
int.var <=> ext.var
end
end
The above implementation mixes the operators [<, <=, ==, >= and >] to your class implementation. For 6 lines of code.
3. Extend your class anywhere - You do not like an inbuilt class implementation. No Problem. Exten it. Unlike C++, Ruby does not believe your classes should be rigidly defined. One can write
class String
def myfoo
puts “pappu”
end
end
to extend the standard String type in the language.
4. Intuitive interfacing with C - So easy that I got an interfaced class running in 30 minutes from scratch. I remember struggling for a couple of hours for doing the same thing in Python.
And now I have to try Rails and see what is all the fuss about?
ps :: Why the **** is my code formatting getting lost … !@^!*&#^*_@(_!(#)#
Trois couleurs [Bleu, Blanc, Rouge] - Krzysztof Kieslowski
Stupidly deleted my earlier post. Reposting it again. Also please note the spoilers warning - *SPOILERS AHEAD*
In this ambitious project, one of the most acclaimed filmmakers of recent times, Krzysztof Kieslowski, takes on the issues of Liberty, Equality and Fraternity - the pillars of the French republic in particular and democracy in general, symbolized by the three colours in the French flag. His attempt, with three separate storylines is as much to put these traits in the perspective of contemporary French society as to also answer his own question “Do people really want liberty, equality, fraternity? Is it not some manner of speaking? “
Bleu (Blue) the first movie of the trilogy deals with the grief of Julie, admirably enacted by Juliette Binoche, who has recently lost her composer husband and daughter in a car accident with her being the only survivor. Here, as in the rest of the trilogy, Kieslowski gives a very personal and individual twist to the meaning of Lberty. Julie initially attempts suicide and then cuts herself off from her old life in her attempt to liberate herself from her grief. Gradually though her old life creeps back bringing with itself the liberty that Julie so desperately seeks.
Blanc (White) is less a French and more a Polish movie. It is the story of Karol Karol, a Polish immigrant, whose French wife Dominique deserts him, leaving him bankrupt and heartbroken, on the grounds of his incompetence in the bed. Karol meets a fellow Pole Nikolaj, who takes him across to Poland in a suitcase, where Karol reinvents himself as a business magnate. In his quest for equality with Dominique, Karol elaborately stages his own death, gets her into Poland and makes love to her in her hotel room, finally leaving her to be deemed insane for believing he is alive. Karol’s quest for revenge is his search for Equality.
Rouge (Red) is the only movie in this series which deals with an entire gamut of characters rather than having a single focal character. This is interesting because both Liberty and Equality can be seen as individual traits, while Fraternity clearly needs numbers. Also the plot here is much more complicated, starting with the chance occurrence of Valentine (the central character if one has to be identified) meeting a retired judge, who spies on the telephone conversations of his neighbours. This narrative is intertwined with the life of law student Auguste, a mirror for the narrating the life of the retired judge. The judge and Valentine grow closer always knowing that theirs was a meeting that would never be fruitful. To quote the judge, “… you are the girl, I never met”. The movie in the end is about fate. How our lives are shaped by the people we meet and how different it could be if we met somebody else. The denouement brings together all the major characters in the trilogy together as the survivors of an accident (it had to be fate). Finally Liberty, Equality and Fraternity meet.
A discussion on every aspect of these movies would be big project in itself. I would however restrict myself to things that I personally found interesting.
- Camera speaks - Kieslowski’s movies are known for their frugality with dialogues. All three movies share the same trait. He chooses the camera to say things rather than the character. Be it the unshakeable strength of Julie, or the unabashed devilishness of Dominique or the uncomplicated goodness of Valentine, it is the camera which says it all.
- Use of colours - Each movie features prominently its theme colour. Blue is the colour of the trinket that Julie takes with her when she escapes her past life. Blue is the colour of the pool that she endeavours to lose herself in to find her liberation, only to rise to surface, her face silhouetted by a red light. Similarly it is white snow of Poland that heralds the equality of the Karol. And the constant flashback to his wedding with Dominique, she being in white reinforcing the belief of status quo that Carol probably seeks. There is also a nice interplay of white and black throughout the entire movie. In red; well you cannot miss the red. It is everywhere to the point that I sometimes felt irritated (probably Auguste smokes Malboros because the pack is red).
- The old lady - All the movies have a common scene where an old lady tries to put a bottle into a waste basket as the central character looks on. It is only on the third movie that the character actually gets up and helps the old lady in her task. My friend Supriyo reasons that Kieslowski does this because the director himself believes that of the three traits, it is Fraternity that is to be valued most. It is interesting to see the scenes in this light, because one can then understand several other parts of the puzzle - on why the third and final movie had to be red, or why the colour red is omnipresent in the movie, while in the other two the references are more subtle.
- The accident - Red and the trilogy ends with an accident where the sole survivors are the characters from the three movies. This can probably be summed up in Kieslowski’s own words, “In ten phrases, the ten commandments express the essential of life. And these three words-liberty, equality, and fraternity-do just as much. Millions of people have died for those ideals“. Kieslowski’s wants to stress through the accident and the death of the so many that regardless of what happens the ideals of French Revolution will not be lost to humanity. (The ten commandments reference here is to his earlier work Decalogue)
- The intertwining of the narratives - The end in Red is clearly the case in question, but the each movie is linked to the other in numerous other subtle ways. The characters of White appear for a moment in Blue and the vice versa and all finally come together in Red. Going back to the use of colours each movie while predominantly shaded in its theme colour also uses the others to bring out the effect that the three ideals do not and cannot exist in vacuum.
As with all good movies Three Colors asks more questions than the answers it provides. It actively engages the viewer in a game of guessing, providing hints and suggestions all along the way without ever explicitly telling out what is it that the director intends to say. Maybe the intent is to engage in a conversation with the viewer about these traits and their relevance in today’s world. On these grounds the movie scores a perfect ten.
Postscript:: One can read much more comprehensive individual reviews of the movies at Roger Ebert’s site. (Blue, White, Red)