Programming Loops and Hindu Trinity

While reading Thomas Cormen’s Algorithms Unlocked, I chanced upon the theory on loop invariants. For a loop invariant to help us argue correctness, we need to show three things about it:

  1. Initialization
  2. Maintenance
  3. Termination

In the Hindu system of Gods, we have the trinity of:

  1. Brahma – the Creator
  2. Vishnu – the Maintainer
  3. Shiva – the Destroyer

In programming, we have loops – they can be initialized, maintained and terminated.

Similarly in life, we have birth, life and then death.

It’s so analogous to see both in action here. Probably computer science can one day develop more due to the hidden knowledge of Hinduism. Or probably it’s just common sense.

Whatsoever it may be, it felt good to draw this analogy today.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s