A couple of people to whom I gave my wedding card, were not able to fully understand the program that I wrote in it and have asked me to explain it. Now that I have kind of settled a bit after my wedding, I thought of dissecting the program and explain it.
Let’s have a look at the code one more time.
You can also get the code from github.
Next, I create two instances of the
Person object. This is similar to creating objects in any object oriented programming language.
Information about wedding
As you might have guessed,
gettingMarried function is that one which prints the information about the marriage. I am passing a JSON object to the function as an argument with the required information.
Checking the responsibility
This is the main crux of the invitation. I am verifying the responsibility before the marriage and after the marriage.
If you look closely at the
isResponsible function, you will note that it has a special condition, which will always return false for me, irrespective of my marital status. The hidden message is that, I will never change after marriage. It’s going to be month since I am married and I can say that I haven’t changed yet. Hoping that it continues for the rest of my life 😉