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

Batch Related Pricing
Hi, I need some clarity on the batch related pricing

For example the following are the b

date("now") prints out wrong date ?
Hi Guys
Anyone know why and how I can fix it ?

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

Syntax Help
Code:


im having trouble with that code snipped
Parse error: syntax error, unexpec

MS Access data into a html table
Hi everyone, I am quite a novice at php but I have created some helpful scripts that fetch data
f

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

How to show the difference between two data field in a database with php.
Hello php gurus,

how r u all... i'm not so well facing a typical problem please help me...<

DOMDocument
Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a

Web Host List
Here is a list of web hosts that offer PHP and MySQL. It is no where near a full list, but it is mos

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