Saturday, July 21, 2012

To OOP or not to OOP

My original objective was to just check what best ORM solution is currently for Microsoft technolgoies, then find out a good sample and customize it for my purpose. I stumbled upon number of articles. Notable amongst them were: “Object-Relational Mapping is the Vietnam of Computer Science” and “Why Objects Suck.
These articles, even if old, seemed relevant to me. It took whole lot of time to read them (incluiding referred and linked articles) and understand. Especially the Vietnam analogy article by Ted Neward takes lot of patience to read (but its interesting anyways). 

I thougth its worth writing about my learning after having read so many things.

First of all, object oriented programming is not a magic silver bullet. There is literally a war going on between proponents and opponents of OOP. Summary of opponents’ opinions is:
  • OOP makes things complex for simple stuff
  • there is insufficient justification to use it on real world problems given the frequent requirement changes (reworks in inheritance etc) and,
  • problem of OR mismatch impedance is too difficult to get away with in real world domains  
Of course, proponents have their own views along with favorite languages and tools that solve problems for them. But I felt opponents had stronger and generalized voice.

Secondly, OR mapping is really stupid thing to worry about. It is matter of choice and comfort of programmer. Now, I am really doubtful that people in our team are using either object orientation or OR mapping techniques (be it LINQ or ADO.Net or NHibernate) that extensively. However, as a group lead of programmers working on different applications, I need to make sure that there exists common understanding between the team and code is written is such a way that it can be transferred to other developers easily. Moreover, given the nature of data centric outputs demanded out of applications that we develop, sticking to relational philosophy seems more appropriate.

Finally, to work in OOP fashion or not is most often the matter of technical consensus within team or the authority of architect or tech lead to drive it.

Lastly and frankly speaking its really unjust to decide programmer's (whether fresh or inexperienced) ability based on his knowledge of OOPs concepts and unfortunately I still hear interviewers reject candidates based on this premise.

Friday, July 20, 2012

Indefinite existence - a stretch of imagination

Sometimes I fear the idea of death or in general, non-existence. Why do I have to cease to exist? Why can’t I live or exist indefinitely? Every time I thought about it, I found myself stuck. So I decided to try thinking other way round. What if I started living indefinitely?

Ok. Let’s stretch the imagination that I start living indefinitely. Either I would be alone living indefinitely or everybody would be living indefinitely.

If I am alone, it would be miracle of nature. Even if it is a miracle, I still would be subjected to that weakening of body due to old age. I wouldn’t expect reversal of age that happens in curious case of Benjamin Button. So let’s imagine somehow my ageing stops. My body cells keep on replacing each other periodically. But socially and personally I would be only one of my kind; becoming envy of others. People would keep on dying around me; my loved ones, my near ones and dear ones everyone will be gone. That would make me very lonely in world that remains, irrelevant, unknown and sort of cast away.

Moreover, I’ll be subject of intense investigation to medical fraternity. They would want to know exactly what’s happening with me that holds my age in time. That would take my privacy away from me.  Doctors would appeal me to share and subject myself to medical investigations in the larger interest of society. They would want to know what makes me immune to ageing. Important assumption here is that I would also be immune to other diseases as well. That pretty much means my life wouldn’t be normal at all. I will be so famous that I wouldn’t be able to lead normal life at all. I would be subject to constant curiosity, jealousy and may be hatred.

On positive side, I might try to contribute to humanity positively by doing something constructive like writing stories or making films or by adopting newer ways of life one generation after another. Last part of adopting newer ways of life seems bit difficult. How will I make myself behave normally given so many changes around? If I want to behave normally, I will have to disguise myself and try and act like whatever generation that might be. Even if I manage that well enough wouldn’t that become a boring routine? In the end, I might get frustrated with that act of getting myself accustomed with changes around and I would want to retire in my own shell and privacy. And there will be huge cost of my privacy given the medical interest in my “condition”, which could be affordable only with sacrifice of some part of privacy and normalcy itself. What a pity that would be?

If, on the other hand, due to advanced medical research, everybody starts living indefinitely, there would be huge problems in the world. World wouldn’t remain as it looks today. There would be population explosion. Moreover, after some time, this immortality will be considered as costly privilege given the increasing cost of living. Only few would be able to afford it and that too only if they can earn it. That means one who chooses to live indefinitely must have unlimited wealth that remain constant. And he will have to work pretty hard to keep that wealth constant.

So, there would be huge competition in generating wealth and using it to remain immortal. Assuming that immortality solution is also unlimited (something like manufacturing that medicine from air and water), there will be lot of companies or corporations providing that solution and cost of solution will keep on increasing given the increasing demand for it.

Governments would impose huge taxes on immortality. There would be abundant thieves who would steal or manufacture themselves that immortality solution. And after some time society and government would be compelled to make laws to terminate such people who illegally try to remain immortal.

Socially, relations between older and newer generation would become defunct after some age. Every family will have 10 or 15 aged people surviving with that immortality solution. Everyone would become selfish in keeping himself or herself alive. Newer births would become lesser and lesser.

It is really difficult to imagine the world where solution to immortality exists. World would be grand chaos, not at all fit to live in.

So miraculous but tiresome life of intense scrutiny devoid privacy versus a grand chaos are the only possibilities of becoming immortal. There is really no point in living either of the worlds. Nature has excellent mechanism of recycling. Point worth trying is experience oneness with nature. Understanding nature… how hopeless that word “understanding” seems. “Experiencing oneness” that’s the only phrase that I feel is worth living or existing for. Only then I might find some freedom from that fear of non-existence.