SitePoint Sponsor

User Tag List

Page 2 of 6 FirstFirst 123456 LastLast
Results 26 to 50 of 136
  1. #26
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Archbob
    But in working with php/mysql, I haven't seen a reason to go OO at all. All the data is stored in the Database as an array and its just as effective an quick for me to write functions to manipulate the data as classes.
    I don't agree.

    As example a page which displays data from 2 separate databases..
    Offcourse you can keep the $from, $where, $limit of each database together yourself, with a class it would (imho) require less effort to not mangle them.

    Quote Originally Posted by Archbob
    I would say only use OO if you see a clear advantage, don't just use it to "look cool" or "look professional" because its not worth it and the code in reality isn't any better.
    I agree, but that is true for each technology/methodology..

  2. #27
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To look professional, you have to be professional, it takes a particular expertise for that. To get that particular expertise, you need to know how to use the tools of the trade, and in most cases, those tools do include object oriented programming for one.

    There are of course, others but it just dumbfounds me why in this post, and others that you have made, you have a complete disregard of the true meaning and purpose, and are showing a total lack of knowledge for object oriented programming.

    Yet, here you are (again) making a statement that one shouldn't use, nor even consider the use of, object oriented programming.

    Not sure who you are trying to impress, but I'm certainly not impressed. If anything, I'm more annoyed and worried that some members actually pay attention to you

  3. #28
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not to hijack the thread but this reminded me of something and i couldn't find the thread that touched on this. but i remember an ealier discussion of frameworks and turning each type into an object, what i mean is something like

    class string, class array, class integer, etc.

    i remember reading it, but i don't remember all the pros and cons and i can't seem to find the thread when doing a search.

  4. #29
    SitePoint Addict
    Join Date
    Aug 2005
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think people that replied to me are missing my point. So this time I will make it very clear so you understand what I was trying to say!

    PHP has a easy learning curve, so people tend to only do what is absolutely necessary to perform a task that they wish to do. Look at the thousands of script you can buy or get for free. Some are very dangerous, most others have terrible logic, basing most of their coding on core functions when other core functions are faster and more resource friendly for what they are trying to do! Why does this happen, because people don't take the time to understand that reinventing the wheel is important for bringing better logic to the over all design!

    So using the OO way and still writing terrible logic will do nothing but have people believe you understand what you are doing when you don't which will just create more dangerous scripts to learn from for free on the Internet! Sure you might call me cynical, but following coding standards is principle that very few people live by and the others that don't follow those standards tend to make up their own which only tells me they think they know more than what they really do!


    So use what ever you want to use. But you should start asking your self this...

    'Is what you just copied or wrote truly the best way to do what you want done'

    You can be sure it will never be the best until you try to do it many different ways, and even asking for help may open your eyes to other ways that you have not ever learned!

    Quote Originally Posted by Thomas A. Edison
    I have not failed. I've just found 10,000 ways that won't work.


    printf

  5. #30
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and I would bet that your "bottlenecking" is more theoretical than real.
    Superstition is not theory

  6. #31
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by Archbob
    If your writing a massively OO PHP guestbook, you've probably taken it a bit too far.
    What if you write a small OO guestbook?

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  7. #32
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    An oo guestbook?
    Hello World

  8. #33
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by DougBTX
    Yea, we probably share something there. Seems like an inherant mistake to me to have a "single use object", because if you only need to use it once, why bother with an object?
    But if I test it, then I've used it twice...

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  9. #34
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OOP is the reason why C++ was created, it was created with the idea of developing large programs above 50 000 lines of code.

    Can anyone imagine 50 000 lines in procedural programming, and how would they be kept up to date

  10. #35
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lastcraft
    But if I test it, then I've used it twice...
    That is a concept that is difficult to understand unless you have been there (and back).

    I think one of the great misunderstandings about OOP is not understanding that it is about design more than coding. Think about the number of new design possiblities that occur when you add functions to a language. Well, adding classes adds additional new design possiblities. I think that some programmers see OO as competetive to procedural, rather than seeing it as expanding their design possiblities.

    Lastcraft once quoted a coworker as say that OO is about the connections between the bits of code that make up a program, rather than about the code itself.
    Christopher

  11. #36
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by printf
    Why does this happen, because people don't take the time to understand that reinventing the wheel is important for bringing better logic to the over all design!

    So using the OO way and still writing terrible logic will do nothing but have people believe you understand what you are doing when you don't which will just create more dangerous scripts to learn from for free on the Internet! Sure you might call me cynical, but following coding standards is principle that very few people live by and the others that don't follow those standards tend to make up their own which only tells me they think they know more than what they really do!


    So use what ever you want to use. But you should start asking your self this...

    'Is what you just copied or wrote truly the best way to do what you want done'
    There is one problem with your statement. Should we stop using Linux because only God knows what incomplete idiots worked on it ?
    Of course not, because it is TESTED BY THE COMUNITY

  12. #37
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No one in their right mind would right a 50,000 line php file, thats what includes and modules are for.

    Despite Dr. Livingston's "true meaning and purpose" post, there is no "true meaning and purpose" in programming. You write code to achieve a specific purpose and try to make the code moddable. Whether you do it in OO, straight procedural, or functions, is up to you. One is not better than the other.

    Yes, it is possible to write really crappy OO code or try to implement OO everywhere(even when its not needed).

    Do I use OO in C++ and java: Yes
    Do I use it in PHP: Sparingly


    I prefer to write files with functons I regularly use instead of writing classes, it works easier for me that way and its very easy for me to go back and edit later. I've programmed lots of forums and CMS system and I haven't really run up agianst a case where using OO beats using function straight out.

    Its one of the reason I don't like .NET as much as PHP because its forcibly makes you use OO, even on a small application wher its not needed.

    OO is completely different from procedural of functional programming and for desktop apps, it needs to be used. But for the most common web apps, I just don't see too much of a need for it.

  13. #38
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I think one of the great misunderstandings about OOP is not understanding that it is about design more than coding. Think about the number of new design possiblities that occur when you add functions to a language. Well, adding classes adds additional new design possiblities. I think that some programmers see OO as competetive to procedural, rather than seeing it as expanding their design possiblities.
    So, you see OOP as an extension to procedural ? That means you understood nothing.
    Those language additions are nothing more that helpers. And it's not about expanding design posibilities, it's a whole paradigm shift.

  14. #39
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Archbob
    No one in their right mind would right a 50,000 line php file, thats what includes and modules are for.
    Includes and modules are part of the code, although you set them in different files

  15. #40
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    Includes and modules are part of the code, although you set them in different files
    Yes, but it makes scripts so much easier to edit when they are in separate modules and files.

    I hate those scripts where all the admin function are in one huge file.

    I've done displaying information with too databases first using a simple function with 3 or 4 parameters. Its pretty easy, pass the function the limiter values twice(one for each db) and remember to close the connection at the end of the function.

    BTW: There are reasons to switch to php5 besides OO.

  16. #41
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Archbob
    Yes, but it makes scripts so much easier to edit when they are in separate modules and files.

    I hate those scripts where all the admin function are in one huge file.

    I've done displaying information with too databases first using a simple function with 3 or 4 parameters. Its pretty easy, pass the function the limiter values twice(one for each db) and remember to close the connection at the end of the function.
    You are wrong if you think include files and modules will make it easier to write 50000 lines of code.

  17. #42
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Archbob
    I hate those scripts where all the admin function are in one huge file.
    What if the user of your CMS files deletes by accident one of the module files?

    Wouldn't it be better, if they are placed in one huge file, compressed and then sent to the user? While the original modules stay for documentation and eventual updating and bug-fixing by the project admin.

    So one huge, compressed user file, and images

  18. #43
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    So, you see OOP as an extension to procedural ? That means you understood nothing.
    Those language additions are nothing more that helpers. And it's not about expanding design posibilities, it's a whole paradigm shift.
    I nowhere said that OOP is an extension to procedural. I said that each adds new design possiblity. I'm not sure what "extension to procedural" means, but you would have to ignore the history of the development of programming languages to say that OOP concepts were not built procedural concepts.

    As for catchy phrases like "a whole paradigm shift", I'm not sure in substance what that means. To clarify, would you call the advent of procedural languages "a whole paradigm shift" from the machine and assembly language days that proceeded them?
    Christopher

  19. #44
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    As for catchy phrases like "a whole paradigm shift", I'm not sure in substance what that means. To clarify, would you call the advent of procedural languages "a whole paradigm shift" from the machine and assembly language days that proceeded them?
    I think he was refering ideas in an article quoted a couple of days ago where the paradigm of the RAM going to the CPU being replaced with one where the CPU goes to the RAM.

    Douglas
    Hello World

  20. #45
    Level 8 Chinese guy Archbob's Avatar
    Join Date
    Sep 2001
    Location
    Somewhere in this vast universe
    Posts
    3,741
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    What if the user of your CMS files deletes by accident one of the module files?

    Wouldn't it be better, if they are placed in one huge file, compressed and then sent to the user? While the original modules stay for documentation and eventual updating and bug-fixing by the project admin.

    So one huge, compressed user file, and images
    Well, alot of the times, thats not the way it works. Lets say you are selling a script and the buyer wants to mod it. I'd much rather have 40 separate files that are named properly than look one huge-*** file.

  21. #46
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by REMIYA
    What if the user of your CMS files deletes by accident one of the module files?

    Wouldn't it be better, if they are placed in one huge file, compressed and then sent to the user? While the original modules stay for documentation and eventual updating and bug-fixing by the project admin.
    Just include some tests to make sure all the files are there that the user can run on install, and you'll be fine

    Douglas
    Hello World

  22. #47
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh Dear...

    Yes, but it makes scripts so much easier to edit when they are in separate modules and files.
    Well, you wouldn't have to edit anything, if you had a -BEEP- abstraction and an Interface to work with, would you?

    But of course... You don't have that luxury with procedural programming, do you? Tell me something, with all this editing of your files, exactly what are you doing? What are the possibilities huh?

    The possibilities of introducing new bugs... Alas, you are including a lot of 'module' files, so which file has the bug... A few hours later, after looking through God knows how many files, you may find the bug at some point during your working day.

    Sod that, that isn't software development

    You are wrong if you think include files and modules will make it easier to write 50000 lines of code.


    I would think that it would make your life a damn sight harder and even more unbearable?

  23. #48
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DougBTX
    I think he was refering ideas in an article quoted a couple of days ago where the paradigm of the RAM going to the CPU being replaced with one where the CPU goes to the RAM.
    I got that. I just wanted to clarify how the phrase "whole paradigm shift" was being applied now to programming. He stated it in such a way that I might think the OOP was the only "paradigm shift" is programming. And that is assuming that OOP is a single "paradigm".
    Christopher

  24. #49
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Archbob
    Well, alot of the times, thats not the way it works. Lets say you are selling a script and the buyer wants to mod it. I'd much rather have 40 separate files that are named properly than look one huge-*** file.
    Modularising code into files and proper naming have little to do with either procedural or OO programming. The original point that you are twisting is that OO is one battle proven way to deal with large codebases.
    Christopher

  25. #50
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I nowhere said that OOP is an extension to procedural. I said that each adds new design possiblity. I'm not sure what "extension to procedural" means, but you would have to ignore the history of the development of programming languages to say that OOP concepts were not built procedural concepts.

    As for catchy phrases like "a whole paradigm shift", I'm not sure in substance what that means. To clarify, would you call the advent of procedural languages "a whole paradigm shift" from the machine and assembly language days that proceeded them?
    Quote from a previous post:

    I think that some programmers see OO as competetive to procedural, rather than seeing it as expanding their design possiblities.
    From one point of view, you are right. From another you are wrong. It takes quite some time for a programmer thinking in procedural to think OOP and when he finally makes the switch, there is no way going back. And that's what is called a paradigm shift. And IMHO it's a mistake to consider OOP as an extension to procedural for better design. That's why we have UML. But then again, maybe I haven't understood you.

    And of course, procedural programming was also a paradigm shift. And OOP isn't perfect and something better will come along.


Bookmarks

Posting Permissions

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