Showing posts from March, 2021

Entropy & Information Theory

 For the last couple of months, I have spent a long time researching entropy. It would be an understatement to say that there is absolutely no law that governs our existence as the second law of thermodynamics. The second law, however, only hints towards entropy. The third law of thermodynamics defines it. I hope you are aware of what entropy is. Sparingly, this is how we define entropy: Entropy is the total number of possible arrangements of particles in a system. As per the second law, the total entropy of an isolated system can never decrease. There is a striking similarity between entropy and information. If you are a computer scientist, you might know about Maxwell demon's paradox which was solved by information theory in the late 20th century. The solution claimed that the thought experiment for the paradox violated the second law of thermodynamics and hence not applicable. The paradox is still being discussed and debated even today. I am not going to talk about the paradox

Comments in a Code v/s Code Readability

 Recently I have earned readability (a Google certification for language expertise) in Java and JavaScript. Over the past few months, I have been a readability reviewer for most of the code that is usually checked in by my team to Google's codebase. I am an exhaustive code reviewer. I only accept code with the highest standards and best practices followed (Okay, enough of blowing my own trumpet!). One of the most popular questions that I usually receive is - "Shall I add a comment here to make things clear?". Most of the time my answer is a clear NO ! I am adding this small write-up to explain the reason. I really believe that writing code is very similar to writing a very simple story without any twist. The variables are the characters. Expressions provide a characteristic feature to a character. Each function narrates a conversation between variables much like an act in a play.  While reading a novel the reader's mind tries to guess what could be coming next. The re