Friday 11 November 2011

A Thesis on Program and Exceptions


A program is very much like a train which runs on track of instructions.



While an Exception is an end of line in the track of instructions. As Exceptions are events for which no instruction is given to the computer. So on reaching such an event (end) the program crashes.

In the above picture the train (program) is about to crash on reaching the end (exception). 
Exceptions are therefore called events for which no instructions are given to the computer. In other words the program runs out of the track of instructions.
While exception handling is very similar to safe changing of track of the train.
Just ponder upon the following picture.

The try-block is very similar to a radar that detects the exception before hand if it finds any exception it lets the program on a safe track called catch-block.
Isn't it amazing! to think like that.

Thursday 10 November 2011

There are 3 features of OOPs


Following are the 3 features of OOPs:
1) Abstract-o-Encapsulism (Combination of Visible & Invisible data)
2) Polymorphism
3) Inheritance

I just decided to combine the 'Abstraction' and 'Encapsulation' together to form 'Abstract-o-Encapsulism' which is simply ‘Combination of Visible & Invisible data’. As I am convinced that 'Abstraction' and 'Encapsulation' are just 2 aspect of the same thing.


A Grand Linkage:
Likewise, 'Abstraction' is CAUSED by 'Encapsulation'.
So the Equation is,
'Abstraction' + 'Encapsulation' = Whole Truth (Complete Data)
Now,
'Abstraction' = partial Truth (Data) which is visible.
'Encapsulation' = remaining partial Truth (Data) which is invisible.
Therefore,
Partial Truth (Data) which is visible + Remaining partial Truth (Data) which is invisible = Whole Truth (Complete Data) in other words, "Everything around us is Abstract-o-Encapsulism".



- By Suneet K. G. Chaudhary
[E-mail: skgchaudhary@gmail.com]

Wednesday 9 November 2011

Abstraction is Magic (in context of OOP)

I have just discovered a synonym for Abstraction and that is 'Magic'. Anything which you feel like Magic is an Abstraction for you. And most importantly Abstraction is all around us.
For Eg: When a Magician brings out a flower from an empty box. You have absolutely no idea, how the flower reached inside the empty box. There is obviously some way but its hidden. The magician Encapsulates the way through which the flower entered the box. Now, thats what I call an Abstraction.
Similarly, when you use 'Facebook' ever wondered how it works. Its a complete Abstraction. Remember there are hard working developers working behind the scenes for your comfort on Facebook.