Posts

Code will be read more than it is written

Image
This might be obvious, but code will be read more than it is written. Barring exceptional circumstances, you will certainly read the code you write at least once - when you first write it. Then a bug appear in testing, and you will have to read that code again to fix it. Then the product side request a change, and you will have to read that code yet again to change it. Then you switch team and now someone else is maintaining your code, so they have to read it whenever the need arise. Et cetera et cetera. Of course, not all part of your code will get to be read over and over like this, only select ones will. Some is just already reliable enough with no requirement change ever happening to them. While the others are left collecting dust unused until they meet their inevitable end when the encompassing feature/product get shutdown. However, most of the time you cannot be sure which one is going to be which, so I reckon it's better to just make sure all your code is easy to read. Havin...

An Introduction to Message Queue

Image
Just the other day, a friend of mine asked me to explain Google Pubsub to him. Being a good friend, I explained it to him in a few sentences and he seemed to get it at the time. However, a while later after he tried it for himself, he asked me a few follow up questions of which I couldn't answer in a few sentences like before. So we started a voice call and I went on to launch a rather lengthy explanation complete with analogies and the like. He still sounds somewhat unconvinced. Maybe I lost him somewhere along the way with my crappy analogies? Anyway, this back-and-forth made it dawn on me that the concept of message queue may not come naturally even to seasoned engineer like my friend. I myself understood Google Pubsub relatively quickly because I have prior encounter with Kafka after all. Therefore it is very reasonable for people - including experienced engineer - to not grasp the concept on first try. So here I am. Writing an article so I can just point people here in case I ...