23 Jun 2011

Woody Allen

I saw Manhattan first.  And then I saw Vicky Cristina Barcelona almost immediately.  When VCB was just over, I was terribly depressed.  I had to go for a long aimless walk to pull myself back together.  I saw it again day before yesterday.  This time I could see a lot of resemblance to Manhattan.

Manhattan was made in 1979.  VCB in 2008.  29 years is a long time.  When the core of the movies of resemble each other, it only leads me to believe that Woody Allen hasn't found a convincing answer for his questions in these 29 years.  This kind of repetition is probably unavoidable when you are an honest artist struggling with an impossible puzzle.

(I realise there's another possible explanation.  VCB does have some solution for the puzzle, only I fail to see it.)

19 Jun 2011

Go: first impressions

After having written about 300 lines of Go code for something meant to be used in the real world, I have mixed feelings about Go.

Things I like
  • Static typing done really well.  Lightweight interfaces (see Rotting Cats section of Go tutorial), type inference, closures, etc. make the language fun like a dynamic language.
  • Clean standard library.  The interfaces are well thought out, and names are picked well.  Effective Go, the document that describes the design/style ideas used by the Go project says "long names don't automatically make things more readable" and I can't agree more.
  • Google App Engine support for Go.  This is the deciding factor for writing my current app in Go.
  • Object oriented programming without fetters.  There are no classes.  There is no type hierarchy.  You can define methods for any type, even those defined by a third party library you don't have source code for.
Things I have to get used to
There are certain things that are not entirely new to me, but I have almost forgotten because I have been coding mostly in Python and Java.
  • Values are different from pointers.  I can define a method on a type like this:
    func (o MyObject) Increment() {
        o.count++
    }
    But this will silently fail because o's type is not *MyObject.  So when I call myo.Increment(), myo is passed by value, i.e., a copy of myo is passed to Increment, not a reference.
  • Crashes and core dumps.  Because the code compiles to native code, you can easily crash your program by dereferencing a null pointer or accessing a nonexistent index in an array.
Things I don't like
  • Errors are returned, not thrown.  In most modern languages your code is mostly free of error-handling because either you want to propagate it to the caller or you can handle them all in one place (with a try-catch).  Go doesn't have exceptions.  So you have to check for errors after calling every function that may return an error.  If you forget to do that, too bad, the error is silently ignored.

16 Jun 2011

What I miss in Sydney

It's been two and a half months since I moved to Sydney.  Life in Sydney is pretty good.  But of course, there are things that I miss:
  • Lunch time, random coffee breaks, random dine outs, etc. with Ajay.  Now, if I am bored I cannot walk over to his desk for a random chat or go with him to get something chocolaty to eat.  The fact that he and I share similar taste in several things make our conversations lively.  I miss all those conversations and occasional silent lunches with him.
  • Tea breaks and occasional lunch with Jhinuk.  We have different philosophies, our views of life are very different.  Yet, we get along very well.  She's one of the few people I respect a lot.
  • After he moved to Bangalore, I don't get to meet Bharat often.  But when we do meet, it's always a pleasant experience.  He is the only one who understands my unclear frenzied ramblings.  He is the one I ask when I have any science question.  He is the one I have gone for aimless walks with.  Only when I think about him now I realise how rich our years together have been.
  • Rice and dal.  And parathas.  And coconut chutney.
  • The freedom of having my own transportation.  I realise that I am not the kind that can use public transport for travelling.  Should buy a bike soon... maybe next year.

Deteriorating relationships

What I was thinking so far: I get to know a lot of people.  With some of them I become kinda like a friend.  Most such "friendships" deteriorate over time; I don't remain friends with most people for a long time.  For some unknown reason the relationship doesn't work out.

What I think I have found today: When communicating with a person becomes hard, I stop talking to them.  Suddenly one day I decide I won't discuss serious issues with them.  That's pretty much the end of that relationship.

Takeaway: Keep talking to your spouse.  Even if you think/know that you would only annoy them.

11 Jun 2011

Life - 4

Life is like a place where you won't get lost no matter which path you walk, but you might if you stay put.

(Originally tweeted a few months ago.)