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

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

Displaying Column Names
I have a question regarding the ability to show the column names from my table/query.
What I'm lo

Simple Variable Question
Hi everyone.... again,

I am really getting into php still. Learning more every day. I love it

LIMIT $start, 10... how to pass last value queried into next page with GET??
Ok I know how to display the first or last 10 results of a query...

$result = mysql_query(&q

DataTable Help Required
Hi all I am creating an app that utilises and MS Access back end and queries it quite a bit at vario

onClick='location.href=index.htm'> not working
Below is my code:

echo "<input type='button' value='redirect' onClick='location.h

Recode Abap Dynpro into Web Dynpro
Hi All,
A client has asked us to look at rearchitecting a custom transaction that was developed

Creation of Raw Exposure manually
SAP Gurus

I am creating Raw Exposure ( Hedge management ) thru T Code TEM10 with followin

Getting Resource id #11 while trying to connect..
So i tried using "DEFINE" for the first time and im using the variables i defined to conne

Ajax Error since Upgrading to 3.5
Ever since upgrading my site to .NET 3.5 (I needed LINQ), I've been getting this annoying error on o

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