Technology and Product Feature are two parallel lines that keep advancing in different planes. A typical challenge for a CTO is to ensure the features of a product are usable while keeping up with the technology advances – iow keep both engineers and the customers happy. Quite often a project meets one or more of these challenges:
- technology is so outdated/unsupported (or process complicated) that no engineer wants to touch the code
- no unit/integration tests that can help in detecting code issues when some thing is modified
- lack of willingness of engineers to work on old technology
- lack of willingness of engineers to adopt new technology
- customer is asking for new features, but cost to maintain is unjustifiable
- management is uninterested because status quo is good enough
Step-in Refactoring. Made popular by Martin Fowler’s seminal book “Refactoring“, this discipline gave legitimacy to engineers to make a case for change without sacrificing product features. Its almost an art-form to change parts of the code to newer technology yet continue to deliver the features. I consider refactoring as an Advanced Species Engineering Skill. Its easy to write code. Its not so easy to write code under constraints. Its much less easy to change code and also change other people’s minds. But how much refactoring is sufficient to declare victory?
Remake movies are some what like refactoring. Its still a different end-product but customer expectation is somewhat same. The story-line has to be faithful to the original but it should still evoke interest in the audience. The audience are not coming in just for the story, but looking for a modern plot-setting, spell-binding animation, a better emotional quotient or intriguing twists not in the originals. Perfect Murder, Ocean’s 11 are some good examples. Of course many bad remakes have failed at the box office too. Interestingly we see remakes from just 30-40 years after the originals. Is audience memory short? Not quite. The audience interest is more in the differential than in the integral. But how much differential is enough to evoke interest? And how much of a time gap is ideal to create a retelling?
If there is a competition among stories that are retold, Ramayana would beat them all by any parameter you look at – time, language, quantity, quality, depth, authors etc. Tradition has it that Ramayana happens in every 24th kalpa of a manvantara. The master story teller vAlmIki goes into incredible details of some events, does remarkably accurate psycho-analysis of characters, yet leaves ample scope for someone else to fill the gaps. Pretty much every Indian regional language (and oriental too) has a retelling – kamban, vishvanAtha satyanArAyana, mAdhava kandali, tulasidas and many more have given it extensive treatments. Even as recent as Maniratnam’s Ravan. All these retellings have variations – highlighting some characters, a few punch dialogs, skipping some events, juxtaposing with regional trends and so on. So has anyone attempted to refactor Ramayana? Guess what, bhAsa, a dramatist from ~450 BCE does exactly that.
In his pratimA-nATakam (House of Statues), bhAsa picks up some events of vAlmIki’s rAmAyaNa, but charmingly refactors the events yet fitting with the original storyline. Every twist in the plot is fresh and original. Some of the timeless dialogs of modern Bollywood cinema can trace its origins to here. We’ll see that in a minute. But here are some of the differentials
- All characters are made to look good, including kaikeyI and rAvaNa ! Talk about improving the design!
- kaikeyI asks only one boon of dasharatha’s, which was his promise to her father to make bharata the king
- On hearing this, Rama automatically gears up to goto the forest without bring prompted by dasharatha’s, and so is sItA
- bharata comes back from his grandpa’s place waits in the outskirts of ayodhyA in the House of Statues, where dasharatha’s statue is also kept. He learns that the house honors only his dead ancestors and is sad to know about his father’s demise
- In the forest, rAvaNa meets rAma as an ascetic who attempts to do shrAddhA of dasharatha, but deceives rAma to take sItA away. lakShmaNa has been sent on an errand to pick up some materials, so he isn’t even in the scene
- The entire kishkindhA, sundara and yuddha kANda-s are skipped, rather told in a single line and the story ends happily in rAmA’s coronation.
None of this make sense to a rAmAyaNa reader, yet the drama is skillfully weaved and is so convincing. So convincing, that I will leave you with a scene from a Bollywood movie. Translations are in Hindi to give a dramatic effect, but you are welcome to imagine with your mother tongue.
The scene is from sixth act. bharata hears about sItA being taken away by rAvaNa and blames kaikeyI for this situation:
भरतः – य: स्वराज्यं परित्यज्य त्वन्नियोगात् वनं गतः । तस्य भार्या हृता सीता पर्याप्तः ते मनोरथः ।।
jo apne rAjya ko chod-ke van gaya, unkA patnI mA sItA-devI ko apaharan hua hai. ab tum bahut khushI hai na, mA?
कैकेयी – भवतु इदानीं कालः कथयितुम् । त्वं न जानासि महाराजस्य शापम् ।
haan, ab sach bolne ka vakt aagaya. putra, tumko maharaj-kA shaap nahi pataa hai
भरतः – किं शप्तः महाराजः ?
mummy, yeh kya bol rahi ho? pitA ka kya shaap thA ?
कैकेयी – सुमन्त्र । आचक्ष्व विस्तरेन ।
sumantra, zara flashback batao (sumantra is the minister)
सुमन्त्र: – कुमार । श्रूयताम् । पुरामृगयां गतेन महाराजेन कस्मिंश्चित् सरसि कलश पूरयामानः वनगजबृंहितानकारिशब्दसमुत्पन्नवनगजशंकया शब्दविधेन शरेण विपन्नचक्षुषः महर्षेर्चक्षुभूतो गुनितनयो हिंसितः ।
(suno beta, bahut din pehle, jab aap ke pitA hunting gaye the, tab ek blah blah blah… )
This is how a flashback should be – a samasa-packed one line punch! kaikeyI sends rAma to the forest so that he can escape from the curse of the blind sage whose son was killed by dasharatha thinking it was an elephant which made a noise. She then proceeds to say she wanted Rama to go to forest only for 14 days, but by mistake asked for “14 years”. bharata then asks if the elders knew about this and kaikeyI confirms that vasiShTha, vAmadeva and other RShi-s know about this. bharata is relieved and asks for forgiveness.
Its mind boggling to think of the literary freedom of those times. By effectively refactoring the events, bhAsa still maintains the storyline and engages the audience. The biggest question is how did the audience “tolerate” this? I guess we can assume there were no liberals in ancient India. cArAvAka-s yes, but thankfully no liberals. And bhAsa’s refactoring has survived for 2500 years!
So next time when you are stuck on a refactoring problem, pick up a bhAsA’s work. He may give you a clue or two about how to dramatically change the code, yet keep the SLA engagement intact.