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.

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

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

I need help on this PHP code
Hi everybody, I made some kind of mistake while editing the code below. As you see, at the 3 row my

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

Object Interfaces
EDIT: Never mind, I just updated to php 5.

Hey all,

I'm currently experimenting with p

Problems with array
This code is the last lines in an upload script that uploads 4 images at the same time and writes th

Help with search.php
Hello All

I need the search engine on a site I am building at the moment to display the searc

Values disappear from my array :( HELP!
hey all, I have a lil mysql/php/apache script that queries a database
and pulls put 5 integers.

Thought I has this figured out especially after all the help i received?
Cags, Salathe, Daniel helped me with this yesterday, but not sure i took it all in.
I am attempti

php forms and database navigatio
Hello,
I'm new to php and i'd like to post the following.
I have written code to get records f

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