29 Oct 2011

Fear of loss

I never thought Star Wars would be so deep.  I mean, it’s only a science fiction with a lot of fights and funky machines, right?  Apparently not.

(Spoiler alert!)  Anakin (good guy) finds out that his wife is going to die in childbirth.  Lord Sidious (evil guy) lures Anakin to join his side (the dark side) by promising to teach him powers to stop people from dying.  Anakin changes sides, and before even he could start learning the powers, his wife dies.  Anakin continues to stay with Lord Sidious, however.

Now, if Anakin really only wanted to save his wife and if he didn’t really have the ‘power lust’, he should have left the dark side and gone back to where he belongs—to the Jedis.  But he decides to stay on the dark side.  Maybe saving his wife was just an excuse he had for himself... he was fooling himself thinking that he’s doing it out of love while in fact he was only after power.  It can be argued that he didn’t go back because the Jedis wouldn’t accept him again after all he had done.  That again goes back to the fear of losing his position.

Master Yoda would say in a scene, “The fear of loss is a path to the dark side”.  Anakin proves that by transforming into Darth Vader.

27 Oct 2011

Success is relative

Success is easy.  If all you want is some kind of success, getting it won’t be very hard.  So it’s essential to know what kind of success you want.

Vast majority of the people either didn’t like Google Buzz or they weren’t as excited about it as Google would have wanted them to be. But there are people who like Buzz.  And many of them are upset that Buzz is being killed.  If you look only at those users, Buzz is a success.  Same with Google Wave.  Wave is still up and running, and those who’ve seen the possibilities of Wave are still using it.  If you look only at those users, Wave is a success, and there’s point in working on improving it.

But Google decided to dump both Buzz and Wave because they want a different kind of success.  Success is relative.  Do you know what kind of success you are after?  Do you know what kind of success will make you feel good about yourself?  Discover that first—achieving it won’t be too hard.

23 Oct 2011

Star Wars

I saw Star Wars, The Phantom Menace today.  It was kinda better than I had expected, but not something I’d recommend others to watch.  Some quotes from the movie, as usual.
  • Concentrate on the moment.  Feel, don’t think.  Use your instincts.
  • May the Force be with you.
  • Whenever you gamble, my friend, eventually you’ll lose.
  • The choice is yours alone.
  • You can’t stop the change, any more than stop the suns from setting.
  • Hard to see, the dark side is.
  • Fear is the path to the dark side.  Fear leads to anger.  Anger leads to hate.  Hate leads to suffering.
  • Your focus determines your reality.

21 Oct 2011

Processes

If someone is writing a lot of shell scripts for their own use, they probably believe in defining and following processes.

16 Oct 2011

Very high level programming

James Iry has written an excellent post on why calling C “portable assembly” is wrong.  The part that inspired me to think is the one about undefined behaviour.  He says:
The C standard says a bunch of stuff leads to undefined behavior. Real compilers take advantage of that to optimize away code, sometimes with surprising results.

What assembly has undefined behavior on that scale? mov al, [3483h] ;(Intel syntax) is going to try to copy the byte at 3483h into the al register, period.
Essentially compilers understand the intent of our statements and can rewrite the program for us if they can prove that the rewrite does not change the program’s behaviour.  Compilers understand a lot of “low level” operations so they are smart enough to rewrite them for us.

One thing you would have noticed if you’re a programmer is that formidable amount of coding time is spent on handling corner cases.  Most of this corner case complexity is caused by the lack of understanding our tools (compilers, runtimes, etc.) have of the program’s intent.  Let’s take an example code snippet:
List<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 10; ++i) {
  list.add(300 * 2);
}
Compilers of today can rewrite this code as:
List<Integer> list = new ArrayList<Integer>();
int __tmp = 300 * 2;
for (int i = 0; i < 10; ++i) {
  list.add(__tmp);
}
This is a very simple optimization that saves CPU time.  This is possible only because our compilers know that a loop repeats the execution of its body over and over again, and that the value of 300 * 2 cannot change over time.

All the languages and other tools we have today are only aware of low level constructs, or code blocks.  They don’t understand, for instance, connection between two functions in a program.  What I think future holds for us are tools that understand very high level semantics.  Tools that can detect if you have two conflicting features in your product.

Another example.  If a Blogger blog uses a classic template, that blog should not have Layouts tab in the UI.  Because Layouts tab is only for manipulating a Layouts template.  Currently this idea is beyond the scope of tools, so we implement this manually: there’s a block of code that determines if the Layouts tab can be shown for a specific blog or not.

If a code change accidentally makes the Layout tab available to classic template blogs, no tool can find it today.  The only way we can detect such an error is by having tests.  Awesome as they are, tests are just band-aids.  Some day there will be tools that would know that classic templates and Layout tab are in conflict.  Those tools will flag an error if we link to the Layout tab of a classic template blog.  (In other words, a few more levels of indirection is due.)

14 Oct 2011

You are that

A famous quote of St Teresa of Avila: “More tears are shed over answered prayers than unanswered ones”.  I saw this quote first in the movie Capote.  (Spoiler alert!)  Writer Truman Capote wants something “bad” to happen as that would make his book more interesting.  That “bad thing” eventually happens, and he spends the rest of his life in guilt.  He chooses St Teresa’s quote as the epigraph for his next novel, which he’d never finish.

From the way the movie is shot, and from my own way of thinking, I interpreted the quote to mean “what you’re praying for is probably not what you actually want”.  Today, more than 5 years later, I happened to come across this quote again.  I am seeing it now in a completely different way.  St Teresa could have possibly meant that the more you yearn for something—the more you cry for it—the more it’s likely to happen.  If you didn’t want something so badly, maybe you won’t get it.

What’s my takeaway from this?  “When your eyes are blue the whole world looks blue.”  I used to have a negative attitude towards everything, filled with negative thoughts.  It was only natural that I saw the quote the way I did back then.  But I am becoming progressively positive.  Now I see the quote in a different, positive way.

Whoever said we create our own world is very right.  Our world is as wide or narrow as we want it to be.

10 Oct 2011

Thinking about thinking

Yesterday I accidentally discovered something: I think in written language.  As I thought about it more, I found out that I also think in visuals.  Unsurprisingly, most of my learnings have come from reading, writing, and watching movies.  Listening to teachers’ lectures has been effective learning for me only in exceptional cases.  That’s also why I cannot listen to podcasts, no matter how hard I try.  It could also be the reason why I don’t usually win oral arguments.  Talking doesn’t stimulate my thinking enough to come up with good points for arguing.

A few things I am wondering about:
  • Thinking is not just talking to oneself.  It can also be reading an imaginary book... or watching an imaginary movie.
  • What are the other ways people think?  (Please leave a comment if you have any insight into this.)
  • How and when did I acquire these thinking methods?  How did I think before I could read and write?  As a kid I must have thought a lot more than I do now.

3 Oct 2011

Reasons

Dry leaf falling in wind.
Orchestra of a million things,
Happening over an eternity.