Improving code quality

One can look at a software project and be dismayed at the number of problems it may have. Code quality is difficult to quantify but in general, readability, ease of maintainability and few basic bugs could be some of the things which indicate code quality.

One way to begin improve code quality is by beginning to clean up the code. One approach could be to employ the boy scout principle as a programming practice:

The Boy Scouts have a rule: “Always leave the campground cleaner than you found it.” If you find a mess on the ground, you clean it up regardless of who might have made the mess. You intentionally improve the environment for the next group of campers.

Daily lives of ancient Romans

We read about patrimony, evergetism, and other interesting practices of the ancient Romans.

Also, it is interesting that the Romans regarded the gods as merely one step above the humans, who were in turn seen as one step above animals. So, the cultured Romans did not believe in a servile relationship with gods unlike the peoples of Eastern regions of those times.

Slavery was seen as quite natural and part of daily life, although some of the followers of stoicism later on did have reservations with this practice.

All these and other fascinating details can be gleaned from the fascinating History Of Private Life. This is a multi-volume work encompassing periods all the way from ancient Rome to the modern day.

Knowing when one is about to make a mistake

One of the sure ways to know when I’m about to make mistakes is when I suddenly feel super-clever and feel like I can do anything. In most cases after such a feeling comes, I end up doing something I regret.

The Dunning-Kruger effect is the cognitive bias which makes one overestimate one’s own cognitive abilities. One needs to keep this in mind and watch for such occurrences. It could save one much embarrassment later.

Watching for one’s own ego (as it usually ends up harming oneself) should be one of the practices and routines one follows regularly as recommended by stoics such as Seneca.

Tinkering produces marvels

When thinking of how innovations are made, one might think that this is done by some genius suddenly thinking up a miraculous idea. However, this is rarely how it happens.

For example, Penicillin was discovered “by accident” by Alexander Fleming in his lab at St. Mary’s Hospital, London after having slaved away at tinkering and experimenting for a couple of decades.

Similarly, one can imagine the marvels of the future to be invented by tinkerers and practitioners who put in the hard work which is essential for innovation.

Thomas edison

What dreams may come

Dreams are a fascinating aspect of the human experience. They seem to occur when one has temporarily lost consciousness in the from of sleep or in cases of longer losses of consciousness in the from of coma etc. Human consciousness itself is not very well understood and dreams are a still a sort of mystery. It is almost like our we run running simulations on our basic architecture when dreaming.

Also, on a few occasions, one dreams some things which help clarify one or the other thing in real life. Dreams even foreshadow what happens in the future. Also, dreams occasionally show things which happened in the past. On other occasions, one dreams things which are completely unconnected to anything at all.

The ancient Indian scriptures, Upanishads, posit the existence of a fourth state of consciousness (apart from awake, dreaming and deep sleep) which enlightened ones attain. This is the Turiya (meaning “fourth” in Sanskrit) state.

It would be interesting to see what things mankind discovers about dreams.

When things go awry

When things go awry or something unexpected happens, one can either interpret it as good or bad depending on one’s attitude. If it is good, one usually celebrates and enjoys the moment. If the thing is interpreted as bad, one can do a few things:

  1. Blame the world itself
  2. Blame other people in the world
  3. Examine one’s own doings and habits. This is the most difficult one. In doing so:
    • Figure out what one may have done that may have contributed to the unexpected occuring
    • Figure out how one could correct oneself
  4. Examine one’s thinking and figure out if one could react in any other way.

Situations are not simple in many cases. Things may turn out as they are because of a combination of one’s own doings, the doings of others and other things out of one’s control.

In any case, the best attitude seems to be that no matter what happens, one should try to accept it with equanimity even though this can be very hard.

As Nietzsche put it:

“My formula for greatness in a human being is amor fati: that one wants nothing to be different, not forward, not backward, not in all eternity. Not merely bear what is necessary, still less conceal it—all idealism is mendacity in the face of what is necessary—but love it.”

– Friedrich Nietzsche


The future exists!

In the millions of years of evolution that humans have been through, the moment when we realized that the future exists was quite significant. This idea cannot be emphasized enough.

Other animals do not have a concept of the future. They live day by day and only live on survival mode.

However, the human brain has developed enough that one can grasp that there is actually a tomorrow. So, one realizes that by making some sacrifice today, the future can be made better.

Thus humans work and save and build families so that they can live comfortably in the future. Humans could then move from mere survival mode to the comfort & prosperity mode. This is thanks to the millions of years of evolution of our brains and the development of consciousness to what it is today.

Taking for granted

One can get into taking for granted when things go well. Taking India, for example, it pays to remember the quagmire of the License Raj. The nation was in dire straits in 1991 after decades of centralized mismanagement. It had come to the brink of defaulting on its obligations. The central government had to use the nation’s gold bullion as collateral in return for a loan from the IMF. Under the able leadership of P. V. Narasimha Rao, India was able to adhere to the terms of the IMF and liberalize the economy in return for getting bailed out. In doing so, Narasimha Rao was saving the civilization from economic collapse. Today, India is seeing a return to some level of prosperity, although it is by no means out of the woods yet.

A much worse scenario was seen in other countries like Romania. As part of a government mandate, women were required to have as many children as possible. Given the overall poverty, children ended up getting abandoned and orphanages overflowed. Many lives were lost because of centralized mismanagement.

What decentralization and the great benefits property rights brings to societies cannot be underestimated. Central planning and central management bring no accountability and any mistakes made affect vast numbers of people. On the other hand, economies that are antifragile are managed locally. Any mistakes made only affect locals and such mistakes are corrected because it is much easier to enforce accountability.


In programming, an algorithm is a way to codify a pattern which someone has recognized in solving a problem or a number of problems. In solving problems using mathematical tools, one comes up with theorems and rules. In computer programming, one comes up with algorithms.

Freedom and responsibility

Just having a lot of freedom could make one complacent and follow a hedonist path. The word hedonist is derived from a Greek word meaning “sweet”. We know from contemporary studies the harmful health effects of sugar and sweet.

There is an Indian festival called Ugadi in which a sweet and bitter food is consumed as a symbolic reminder that one must expect and be prepared for both sweet and bitter experiences. Just consuming sweet experiences and expecting life to only provide such experiences could make one weak. If mixed with a suitable amount of responsibility, freedom can be well tempered and made to last longer.