Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: OOP vs Regular

  1. #1
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default OOP vs Regular

    So, here's the ultimate question. OOP, or plain ol' PHP?

    I haven't bothered to learn it, normal PHP has been fine for me up until now, but it's becoming something that everyone is starting to use, and I'm worried I'm missing out. What are the advantages between OOP and just regular PHP? I mean, obviously for functions (encypting passwords, grabbing user details from database upon every page load) it'd be ok. But for everything? Half the apps I look at nowadays are full of it, when PHP would be fine.

    I think I'm going to buy a book specifically on OOP (that's after my book on AJAX ships from Amazon.com, that is ). But I was interested to hear people's opinions on it

  2. #2
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    OOP for me is basically easier debugging for me AND the end-user. It also makes my code much more efficient (if I say use classes).

    By using a class the end-user would simply have to re-define or change a few variables to make the script do a completely different thing. You can also create a different way of debugging for things such as queries by making a function for a query which (if the query went wrong) could report the error.

    There is a lot of great and useful things you could/can do with OOP which is why I like it

  3. #3
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    I would say all decent coders use OOP, when doing larger script adleast.

    It basicly allows you to update the code quicker, saves time and makes the code neater. So rather than making 10s/100s of edits if you wish to add something you can make a few edit on your class/function files.

    Been using OOP for almost about 10 months.

  4. #4
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    It depends if its for a client or you. If its for you, use a little OOP, but it can be messy. For a client, dont use alot of OOP (so much that it confuses them) but make it look neater and dont go OTT

  5. #5
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    I disagree, most people who want work doing would rather have OOP as it makes it more simple.

  6. #6
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by Luckyrare View Post
    I disagree, most people who want work doing would rather have OOP as it makes it more simple.
    But if your making it for yourself, your more likly to take less care, meaning having to go through e.g. a 600 line file to edit 1 function.

  7. #7
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    If you have problems looking though classes then you should split them in to organizable named files. eg. admin.inc.php, users.inc.php so on.

  8. #8
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Quote Originally Posted by Luckyrare View Post
    It basicly allows you to update the code quicker, saves time and makes the code neater. So rather than making 10s/100s of edits if you wish to add something you can make a few edit on your class/function files.
    That's what everyone has said when I've asked them. My rebuttal to this, is that you can do it with vanilla PHP anyway. I'm using custom functions at the moment, which I include into scripts when I require them, which is practically what OOP is anyway, just without classes and the object variable type.

  9. #9
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    If you would like some reading about OOP, you can buy this months .net as they have a article regarding it.

    Very basic article tbh, you can get more information on the technique on php.net

    php.net/oop

  10. #10
    Join Date
    Nov 2007
    Posts
    25
    Tokens
    0

    Default

    OOP Just makes it easy to debug things, and easier to organise.Although it is generally only used for larger scale projects.
    RuneScape is fo' sho!

    Hey, you! Guess what! Join #habbox-chat



Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •