Why use OOP?


Posted on 16th Feb 2014 07:03 pm by admin

Can someone explain to me why I should use OOP instead of procedure based code.

Im building a shopping cart and i created and Item object already and using it to hold data for each item. But this Object just has properties. I mean what methods could there possibly be for an item.

Did you know?Explore Trending and Topic pages for more stories like this.
Why would I need a Cart object either? There will never be more than 1 instance of the cart running. So what are the advantages to putting all my functions inside of a class?

Thanks, and sorry if your offended by this, im trying to go OOP i just don't see why yet.
No comments posted yet

Your Answer:

Login to answer
217 Like 8 Dislike
Previous forums Next forums
Other forums

A little help in c#
i am doing a simple paint program using c# i want to draw with the mouse so i wrote the code of the

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

Problem with creating FI documents
Hi, Experts!

when i create Fi doc. with standart transaction, i ve been had such problem

tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e

button help
i originally had this but realised it is much easier to have a button.

Code: <?php

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

What's best way to get a user's Word doc converted to simple html and images?
Hi all,

I was just wondering if anybody has any experience of this.
Basically, I'm buildin

Display the user's weight lost in the past week
Hello everyone,

I am working on a weight loss app for my site, and I want to display the user

I would like "for" to wait 5 sec
I would like my 'for' loop to wait 5 sec before second iteration.


for ($i=0; $i<10

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash