Skip to main content

Posts

Showing posts from June, 2017

Inheritance in OOP: Introduction

In the previous section, we talked about what Object-Oriented Programming is and what are its key concepts or features. We defined them in a very brief and formal way. As I promised that we will discuss each of those in details, here it is. I will try to be as natural as possible. Inheritance is that feature of Object-Oriented programming which allows developers to borrow code from a prototype (class) and extend it, by adding more properties to it and behaviors to manipulate those properties. It reduces the size of the code with a big margin by creating is-a relationships between objects. This line might sound confusing but don’t worry. You will see in the coming section that how it reduces size of the code. The more common properties and behaviors a program have, the more usable inheritance will be. It allows you (the developer) to implement the real world parent-child hierarchy in a computer in a robust way. Here, I will tell you all I know about inheritance, how to implement...

What is Object-Oriented Programming? The concept of Class and Objects

Object-Oriented Programming is a powerful way to address the task of programming. Programming methodologies have improved dramatically since the invention of the computer, primarily to support the growing complexity of programs. For example, when computers were first invented, programming was done by toggling in the binary machine instructions using the computer's front panel. As long as programs were just a several hundred instructions long, this way worked. As programs grew, assembly language was invented so that a programmer could deal with bigger, more complex programs, using symbolic representations of the machine instructions. As programs continued to grow, high-level languages were introduced that gave the programmer more tools with which to handle complexity. The 1960s gave birth to structured programming. This is the approach supported by languages such as C and Pascal. The use of structured languages made it possible to write somewhat complex programs fairly easily....