Jul 26, 2007

'Stranger Than Fiction'

I loved the movie. Just loved it.

Writing anything about it felt like me spoiling it for you. So here are some of my favorite quotes: (tx imdb)

Dr. Jules: Hell Harold, you could just eat nothing but pancakes if you wanted.
Harold: What is wrong with you? Hey, I don't want to eat nothing but pancakes, I want to live! I mean, who in their right mind in a choice between pancakes and living chooses pancakes?
Dr. Jules: Harold, if you pause to think, you'd realize that that answer is inextricably contingent upon the type of life being led... and, of course, the quality of the pancakes

Book Channel Host: So, can you tell us the title of the book you haven't written yet?
Kay: I'm calling it Death and Taxes.
Host: Death and Texas? Hey! I'm from Texas!
Kay: Wha?
Host: Yep! San Antone.
Kay: No, no, no, no. Death and Taxes. Taxes. TAXes.
Host: Oh! Death and TAXES! Like the Ben Franklin quote.
Kay: Yes.
Host: Oh now I feel really silly.
Kay: [under her breath] You should.

Jul 22, 2007

Try, Then Add

It is very important to write your computer program piece by piece. I am writing this post as I have seen many people sit down and type in a whole program based on their 'knowledge' (=assumptions) and then ask "hey, can you tell me whats wrong?" when the program does mysterious things. At this point, if time is also against us (as is usually the case), little can be done.

Try it bit by bit in isolation and see for yourself that it works. Don't assume anything. Test everything. THEN incorporate it into your code.

A big program will have so many moving parts. If it is also doing mysterious things, there will definitely be lots of flying monkeys and clowns on crack. If you try to make sense of such a freak show, you will experience a pain that could have easily been avoided.

If you have already clumped together all the square pegs, round holes and chewing gum, the best bet would be to take your code apart, try (copy-paste) it piece by piece and put it together into a new program.

Personally, though I've inherited some hairballs at my day job, I've had the good fortune of at least being able (=time,budget) to rewrite them altogether.

Good programming languages make 'trial & error' approach painless. I love playing in Python and Lisp primarily because they make this experimentation easier and natural. However, "Try, Then Add" is a good habit while programming in any language - even if it is in COBOL. Doing it in COBOL will be a pain in the neck, of course - but I double dare you to not do it.

Imagine my joy in finding something that makes "Try, Then Add" easier for JavaScript! [Learning JS from the Command Line]

Further Reading:
What is REPL?
Programming Bottom Up

Jul 19, 2007

The Book Solution

To keep my mind creatively engaged, I decided to read like crazy. I used to read a lot but I slowed down a bit the past couple years. First there was a road trip phase just after I got my driving license, when my friends and I went on road trips almost every weekend. After that wore off, I spent most of my time hanging out with friends, watching movies almost every night, playing racquet ball every single day, snow boarding on the weekends & kayaking on balmy days. These were good things except that my reading took a beating.

My friends got married, relocated, busy, overworked or simply lazy. With more time in my hands, I went back to reading, like a child going back to sucking its thumb when too many things change at once. I even considered getting a dog - I love dogs - but my rootlessness made me think that that might be a bad idea at this point in time.

Tim Ferriss had a point when he said that reading fiction is the best way to take your mind off of the day's events. Reading a short story every night felt so good. I have a paperback edition of 'Selected Stories of O.Henry' - I read a story a night. I have not done this in weeks as it gets late for me to get into bed. I should resume this as I felt so relaxed. I especially liked 'While the Auto Waits' and 'The Higher Pragmatism'.

Not only did I want to start reading a lot again but I wanted to get back into the habit with vengeance. So I dusted (shelf) / borrowed (kcls) / bought (amazon) these:
  • "Man's Search for Meaning" -Viktor E.Frankl
  • "Issac Newton" -James Gleick
  • "Making Comics" -Scott McCloud
  • "A Pattern Language (Towns, Buildings, Construction)" -C.Alexander et al
  • "Prank the Monkey" -Sir John Hargrave
  • "Test-Driven Development" -Kent Beck
  • "Simplify Your Life" -Elaine St.Jame
  • "The God Delusion" -Richard Dawkins
  • "Stumbling on happiness" -Daniel Gilbert
  • "Ender's Game" -Orson Scott Card
That should keep me busy for a while, don't you think? ;-)

I chose each of these books carefully - mostly based on recommendations from people I respect in that area: primarily Phillip Greenspun, Aaron Swartz, Manikantan SSA, Raganwald and Ben Casnocha.

Right now I am reading "Man's Search..." and "Making Comics". Both are extremely interesting in diametrically opposite ways.

I have started working out every day - which is a good thing too. I feel much more energetic than, say, a month ago.