Posts

Abstraction - The most important concept of CS

I was actually thinking if I exaggerated by terming Abstraction as the most important concept in Computer Science but actually No and I will tell you why.  Abstraction is the key to understand everything in Computer Science, to uncover every other concept. Once you get this, you will crack every concept with much ease. Computers and computing are the fastest-growing fields in the world, we all know it. It's like a beast that's growing every day and engulfing every aspect of life. What is abstraction? In simple terms, abstraction is hiding . It's the covering up of something messy and complicated with something that's relatively easier to look at. So every concept that you may try to understand is presented to you in an abstracted form. It's covered up and to actually understand that, you would need to dig deeper , to actually see what's hidden . The easiest example that comes to mind for abstraction is the concept of memory.  On the surface, we talk about let...

What is the difference between definition, declaration and initialization?

I will answer this question in a general and complete way and not with respect to any programming language There is a hell of a lot of confusion between declaration, definition, and initialization. Sometimes they all look similar and sometimes completely different. Before understanding the differences, It is very important to be aware of two things: The difference between declaration, definition, and initialization varies from one programming language to another. Each programming has its own way of doing these three things. The “thing” which you are defining, declaring, or initializing also affects the difference between the three of them. That “thing” can be a variable, a class, or a function. All of them have different meanings of definitions, declaration, and initialization. Once we are aware of the above two things, most of the doubts get cleared and we stop seeking exact differences because it’s not there. In general terms ( irrespective of any language or “thing”) The declaration...

Object vs Instance - What's the difference?

Object-Oriented programming can be a bit confusing at times as there are concepts with very minute differences. The worst thing is that the more you read, the more you get confused as 100 people have 100 interpretations of the same concepts. When you can verify something physically and explain it in the simplest possible explanation, that concept can be said to be cleared. Coming back to the question, Objects and Instances are almost similar and are often used interchangeably but with a small difference. Let's take a Story. Suppose You are God and You are given the task to make a new species called  Males.  So you start designing your species.   All the males will have hands, legs, eyes, nose, etc. These features/states can be called attributes/properties . All males can run, walk, talk eat, etc. These are the behaviors/functions of males and can be called Methods . Once you have designed the properties and behaviors of your new species, Your class is ready. So basically ...