Monthly Archives: ಜುಲೈ 2010

Inception Meets Programmer

”Dreams feel real while we’re in them. It’s only when we wake up that we realize something was actually strange.”

Inception is different like The Matrix, but different. It has programming concept, idea of functional programming, elaborated.

A software program which can have many methods, and methods within methods, nested methods. Main() program calls all these methods internally, and comes out of each method. Finally fall back to normal.

When you replace methods with dreams you understand Inception movie story.

Brain which can run multiple dreams, you can feel one dream at given time, you can be in only one dream. CPU can have one method executed at one cycle, while others in queue state

Methods share variable, take different type of parameters, are alive when in execution and dies when return statement is called. Calling methods will be return to active mode and thus leaving behind called methods.

Dreams shared by people, more than one guy i.e. Cobb, and with team. He, his team recruits person/character to share the dream.

Methods which call methods need to remember point of return to resume calling function.

So in “Inception”, each team member left behind on each level is protecting the rest of the team.

Every now and then Cobb is disrupted by Mal, his wife just like some random unconditional jump/GOTO statements. 😛

Limbo is like run time error with infinite loop running on it, a state where its difficult to come back to real.

At a given point of time only one method is active, all others are in sleep mode, are in stack. One by one methods pop out from stack when return statement is called from method, as if nothing happened but achieving what methods supposed to do.

Cobb and his team comes out of dream from all levels and its exit();

Yes, I debugged Inception yesterday. Its geek movie just like all other Nolan movies 🙂

It has gravity defying antics and twists all combine in a sort of signature movie of Nolan.

Highly recommended and it deserves second view 🙂


ಟ್ಯಾಗ್ ಗಳು: , , ,