#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7

    Object Oriented vs Procedural (Opinionated)


    Hey all. I am working on updating my work from the depreciated mysql_ to the mysqli_ and see the 2 styles being defined. I'm used to the Procedural style, but was wondering what everyone's opinion was with maybe switching to the Object Oriented style as well while updating myself to the mysqli_...
    Last edited by Triple_Nothing; December 3rd, 2012 at 12:48 PM.
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    If you're going to switch, you may as well switch all the way to PDO
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    it depends on your application. If it's object oriented, use the object oriented API. Otherwise use the procedural API.

    None of them is "better" than the other. Calling $db->query() instead of mysqli_query() doesn't make your application "more modern" or "cleaner". The different APIs just account for that fact that there are different programming paradigms in PHP.

    By the way, it's deprecated, not "depreciated".

    Comments on this post

    • requinix agrees : the correct spelling of "deprecated" seems to be deprecated
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    677
    Rep Power
    7
    Wow. Good morning. ^_^ I been seeing things as 'depreciated' this whole time! Lol. Thanks for pointing that out.
  8. #5
  9. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,008
    Rep Power
    2791
    Well things that have been deprecated do tend to depreciate greatly in peoples opinion's of them

    Comments on this post

    • ManiacDan agrees : Wah-waaaaaaaah
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [ANSI C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.

IMN logo majestic logo threadwatch logo seochat tools logo