Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29
  1. #16
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    4.0 isn't really an OO engine. It was a hacky addin to the existing 4.x procedural core. It is. . . not great to say the least, but for what they could do it turned out surprisingly well (no, I wouldn't use it either :P). 5.0 redefined the entire underlying engine for OO making it far more powerful. 4.x was more of a collection of functions and variables specific to a "group", or more close to a struct than an object.
    Constructor name is often the name of the class. I haven't a clue why they redefined that in 5.x especially since the BC for 5 to 4 still dictates you can use them with the exception of namespaces matching the same classname for the ending portion of the namespace.
    This is another great reason to not use PHP as your language of choice to learn OOP on.

  2. #17
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,311
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    Quote Originally Posted by Fou-Lu View Post
    This is another great reason to not use PHP as your language of choice to learn OOP on.
    Heh, that says it all for me
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  3. #18
    Regular Coder
    Join Date
    Sep 2011
    Posts
    342
    Thanks
    38
    Thanked 0 Times in 0 Posts
    When WordPress was released, it was 99% procedural! I have not downloaded the last version, I don't know if they have switched to OO.

    Every crap you will do in OO can be done in Procedural except it can be more complicated or can be too long, but still you can do it!

  4. #19
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Not even. Most of the time procedural will be less footprint and easier to perform the same task. One of the few exceptions is the privacy control which is quite complex to do in procedural. But you do take the tradeoff of re-usability, so you have to weigh which is more important to you.
    OO is a good choice for a shared system that unknown individuals could add onto. This grants me control which is difficult to implement in procedural, and if implemented improperly can result in many bugs introduced by addon code that is difficult to debug.

  5. #20
    Regular Coder
    Join Date
    Sep 2011
    Posts
    342
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Who made PHP OO? Zend team or Lerdorf?

  6. #21
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    PHP OO is developed by Zend. AFAIK Rasmus is still on the development team, but I'm not sure if he's actively participating or just consulting.

  7. #22
    Regular Coder
    Join Date
    Sep 2011
    Posts
    342
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Damn Zend!

  8. #23
    Regular Coder Custard7A's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    286
    Thanks
    32
    Thanked 33 Times in 33 Posts
    The blithering fools!

    Lol, just go use procedural and stop whining.

  9. #24
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    OO was introduced in PHP3 though internally it was not true OO of any description just emulation of objects, Zend changed this and it grows with every version.
    Lerdorf is not a gigantic fan of OO ala MVC etc
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  10. #25
    Regular Coder
    Join Date
    Sep 2011
    Posts
    342
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by firepages View Post
    Lerdorf is not a gigantic fan of OO ala MVC etc
    Elaborate...

  11. #26
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    Read my sig
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  12. #27
    Regular Coder
    Join Date
    Sep 2011
    Posts
    342
    Thanks
    38
    Thanked 0 Times in 0 Posts
    So this guy does not like MVC? And moreover, in which year he made the statement?

  13. #28
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    2006, in Zagreb , I don't know what he was wearing though
    Last edited by firepages; 11-22-2012 at 11:25 PM.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  14. #29
    New Coder
    Join Date
    Sep 2011
    Posts
    47
    Thanks
    1
    Thanked 15 Times in 14 Posts
    I think some of you guys have already said this with other words. But I think that when it comes to PHP and the choice of OO or Procedural you should really go with what you're most comfortable with. For example if you've for example been working a lot with C or any other procedural programming language you will probably find it more comfortable to keep using the same methods. And that's completely okay, because as many of you have already written there is not downside in performance when it comes to using procedural language. And according to me many well-commented procedural scripts are often easier to understand that mediocre OO-scripts.

    Though if you're and hardcore Java programmer you might prefer the OO-way. And then that's definately the way to go as you will feel more comfortable with that. If you're a newbie; well then just go with what feels best for you. Try some OO-programming and see if you like it.

    Personally I'm mainly working with procedural PHP code. Though I'm aware of some of the advantages of OO. And if I run into a problem which would be much easier to solve with OO programming, well then I'll do that.

    Just don't feel like you have to choose a specific side in this ever lasting battle. Just follow your heart


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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