In any endeavor, putting in the effort for the last bit is crucial. Often, it is what distinguishes success from failure.
The practice of writing history is an area plagued with errors and difficulties.
There is a well known saying:
History is written by the victors
This indicates the general assumption behind many, if not most, written histories. In hard sciences, theories and hypotheses have to be confirmed by the evidence.
Opposed to this is the common exercise of writing history where theories and grand narratives are first formed. This is followed by collecting all sorts of evidence to match these ‘theories’.
This being the case, in practice, most history books do not stand the test of time. Every few decades, many history books written in the recent past keep needing to be thrown out with only a few exceptions. So one needs to exercise caution.
In any data structure where a node has multiple children, there needs to be a way to disambiguate child nodes with the same value. This is helpful when figuring out the path to the nodes. One approach is to always use a unique identifier when constructing the path for each node in addition to its value.
In stating the truth, one may come across obstacles. However the ancients recognized the absolute power of truth.
satyameva jayate nānṛtaṃ satyena panthā vitato devayānaḥ
yenākramantyṛṣayo hyāptakāmā yatra tat satyasya paramaṃ nidhānam
This can be roughly translated to:
Truth alone wins; not falsehood
Through truth, the path of the gods widens
That by which the sages whose desires have been completely fulfilled
That highest treasure is attained by truth
– Mundaka Upanishad, 3.1.6
In overcoming limitations or in achieving goals, practice is essential. This is the idea behind Krishna’s message to renounce all fruits of action as a way to perfecting the practice of yoga. By practicing the performance of work without expecting rewards, one can gain a lot in terms of control of the mind.
athaitad apy aśhakto ’si kartuṁ mad-yogam āśhritaḥ
sarva-karma-phala-tyāgaṁ tataḥ kuru yatātmavān
This can be roughly translated to:
If you are unable to do even this, in that case, take up Yoga for Me and renounce the results of all works by becoming controlled in mind.
– Bhagavad Gita 12.11
One can always find ways of writing clean code in an iterative manner.
When writing new code, the process usually involves something like:
- Write some code which ‘works’
- Run some test cases
- Go back and clean up the code
- Rerun the tests
- Further clean up the code
- Etc etc
The idea of a republic where there is no rule by a monarch is quite ancient. During the time of Buddha in the 6th century BC, there existed many republics which were part of the Mahajanapadas.
When thinking of complex problems, a helpful approach could be to get to the essence of the problem. This is a difficult process in most cases and takes some training and experience.
Of course, one needs to also make one’s assumptions clear at the outset and then identify the first principles.
After these two steps, the complex problem may become easier to understand. Once such an approach is adopted, it becomes easier to think in terms of first principles.
Writing code is not a trivial exercise when done for the first time. However, having sufficient training material and reference documents helps a lot.
This is not available in many projects which are too new, too old etc. In such situations, the coder needs to do a lot of improvisation and head scratching especially if fixing bugs in someone else’s code.
When it comes to performing any actions, it may be interesting to think about who the doer is. The nature of consciousness is something which is not well understood.
If one understands it to be independent of the body because the same self exists during sleep, waking and dream states, the body cannot be said to be the doer.
This is the idea behind Krishna’s counsel regarding action:
karmaṇyakarma yaḥ paśhyed akarmaṇi cha karma yaḥ
sa buddhimān manuṣhyeṣhu sa yuktaḥ kṛitsna-karma-kṛit
This can be roughly translated as:
Those who see action in inaction and inaction in action are truly wise amongst humans. Although performing all kinds of actions, they are yogis and masters of all their actions.
– Bhagavad Gita, 4.18