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:
In the Hindu system of Gods, we have the trinity of:
- Brahma – the Creator
- Vishnu – the Maintainer
- 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.