What is the difference between Procedural Programming and OOP Programming ?

In Procedural Programming we use a list of instructions to tell the computer what to do and here we divide the program into small parts called functions. In PP, If you want a computer to do something, you should provide step-by-step instructions on how to do it and it follows top down apporach. It means Procedural Programming takes on applications by solving problems from the top of the code down to the bottom. The main issue in PP is that if a developer wants to edit a code he must edit every line of code that corresponds to the original change in the code.

Object-oriented Programming is a programming language that uses classes and objects to create models based on the real world environment. An object is a component of a program that knows how to perform certain actions and how to interact with other elements of the program and objects are the basic units in OOP. In OOP It is easy to edit and maintain the code. Also other developers can understand the program after development.

A method in OOP is like a procedure in PP and method is part of an object.In object-oriented programming, you organize your code by creating objects, and then you can give those objects properties and you can make them do certain things.

  • Object-oriented Programming uses methods and Procedural Programming uses procedures.
  • Object-oriented Programming uses objects where Procedural Programming uses records.
  • Object-oriented Programming uses classes where Procedural Programming uses modules
  • Object-oriented Programming uses messages where Procedural Programming uses procedure calls.
  • In PP, Most function uses Global data for sharing that can be accessed freely from function to function in the system and In OOP, data can not move easily from function to function,it can be kept public or private so we can control the access of data.
  • PP does not have any proper way for hiding data so it is less secure and OOP provides Data Hiding so provides more security.
  • PP follows Top Down approach and OOP follows Bottom Up approach.
  • In POP, Overloading is not possible and In OOP, overloading is possible in the form of Function Overloading and Operator Overloading.

I saw a simple example about PP & OOP when I searched  🙂

A simple way to compare both programming methods is to think of Object-oriented Programming as  learn to read picture book. As children see pictures of simple objects like a house or picture they know that throughout the book when they see a picture of the house it represents the word house. The children can then read through the book as words are substituted throughout the story with pictures.

In Object-oriented Programming the classes could represent the pictures in the learn to read books. A house could represent a class and anything the developer wants to have included to describe that house like the color, size, number of bathrooms etc.

In Procedural Programming the learn to read book would be words on the page without pictures to help guide the young learner through the book. If the story was changed in the beginning of the book it could disrupt or make the story later on in the book not make any sense. Although learning to read the book would make programming with Procedural Programming simple, it would make it difficult for other readers in the case of the book or programmers in the case of Procedural Programming to add to the story.

Advertisements

How to install google chrome on ubuntu

Ok get the terminal and again you have to only give some commands…..

First you have to give the link for chrome.
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Screenshot from 2016-04-09 09:00:32

Ok now wait…. It is downloading…

Screenshot from 2016-04-09 09:03:21

After that enter below command…
sudo dpkg -i google-chrome*

Screenshot from 2016-04-09 09:07:51

Ok now you have installed chrome. But if it will give error try this force command.

sudo apt-get install -f

Screenshot from 2016-04-09 09:12:38

This steps worked for me. Try these and thank you….. 🙂

 

How to install sublime text-3 in ubuntu

Ok first get the terminal……

Screenshot from 2016-04-06 13:53:21

It is very easy.. now follow this commands…..

  • sudo add-apt-repository ppa:webupd8team/sublime-text-3
    now it will ask your password. so give it :D
    Then again you will have to press enter. wait....
    ok now enter below command.

 

  • sudo apt-get update

    wait and enter this command

  • sudo apt-get install sumblime-text-installer

    Ok now you have installed sublime text editor…..