SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 58
  1. #26
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jim9,

    You're grossly overexaggerating the situation. Probably 95% of PHP code out there written for PHP4 will work for PHP5.

    Also, if you think software never breaks existing code, you're sorely mistaken. Developers try to maximize backwards compatibility, but if software is ever going to change, that's just not possible to have 100% backwards compatibility.

    But I could go right now and download a script, and I would be fairly sure there was a good chance of it running just fine.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  2. #27
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I use plenty of open source PHP apps (phpBB, Wordpress, phpAdsNew, etc).. and I mean really old copies of a lot of it from before PHP5 was available.. not a single thing broke when I upgraded my servers to PHP5. Nothing I had written myself either. PHP5 took away almost nothing, but added a lot, so very very few programs that run on PHP4 won't run on PHP5.

  3. #28
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and if they don't run fine on PHP5 there's probably a security reason for not running them on PHP4 either ;-)

  4. #29
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I taught myself PHP while getting my computer science degree. Everything I learned about programming while at school was OOP. But when I did PHP, I didn't see the need. The scripts are so short lived. So linear. Why use OOP?

    Then I got a real job coding PHP. My current project has over 7 megs of code and has generated 100,000+ rows of database content in 2 months of being live. There's no question to me now OOP is easier to code in and easier to maintain. I couldn't imagine the code soup I'd be dealing with if it weren't for OOP.

  5. #30
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fine, use oop. But oop has nothing to do with bringing up database records in an efficient manner. As an example, even if you were working with 20,000,000 records, you only pull up (query) the records needed, by doing a pre filter. If for example you were searching for a customer named john white, then set up a pre-filter text box where user types whi. Then the query will return only occurences of whi%. No internet database can be efficient if 20,000,000 records are pulled up all the time (oop or procedual). OOP has nothing to do with how efficient a query is. How about giving us an example site to look at. To date, no one has referred me to example oop site with complex lookups such as auto filling ship information on a customer order. It's been mostly talk. I have posted my test lookup site. I still believe that most oop programmers don't know how to auto fill fields while in the middle of a form (multiple fields all at once not a state dropdown). I will believe it when I see it. My small test site has a filtered lookup.

  6. #31
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To date, no one has referred me to example oop site with complex lookups such as auto filling ship information on a customer order. It's been mostly talk. I have posted my test lookup site. I still believe that most oop programmers don't know how to auto fill fields while in the middle of a form (multiple fields all at once not a state dropdown). I will believe it when I see it. My small test site has a filtered lookup.
    This came out of left field so I don't know what to do with exactly except pat you on the head and say "atta boy!"

  7. #32
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    219
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Procedural coders are very difficult to convince, as you have to live and breath OOP for quite a while before you actually "get it" - I know, I was a procedural advocate for many years, and to jump into the world of OOP is very difficult when you have that sort of background.

    I don't expect to convince Jim or anyone else to make the jump (and see the light) but this post (from 2002) is still the best argument I've seen for the beneficial use of OOP:

    http://www.sitepoint.com/forums/show...8&postcount=14

    From this thread:

    http://www.sitepoint.com/forums/showthread.php?t=59898

    That said, until you work in a professional environment where the business changes constantly and you have to re-engineer and introduce new features regularly (and I don't mean adding a field to a database), then you probably won't "get it" unless you spend a lot of time trying to recondition the way you think about development.

    Anyway, enjoy the post - it's well worth reading.


    Dan

  8. #33
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It came from the fact that you seem to praise oop so much. But I have asked to see a real life online database site that was done in oop and as of yet no one can refer me to one. A real site that handles complex business such as a large warehouse that loads over 100 trucks a day. Or an example transportation site. Get something straight here, an ecommerce site like ebay though large in size and volume of records is still not considered a complex database application. Even a master/detail display isn't complex. A complex example is an application where entries into a record are derived from more than one table. If you were entering a new customer order, when you tab down to the ship to field, and can "lookup" that data, then tab to a bill_to field, and can "lookup" that data, meaning bill to name, address, city, state, zip, etc, not one lookup per dropdown, but when you lookup the bill_to customer all associated fields are auto filled. Now that's getting a little more advanced. The most advanced is in transportation where multiple pick/drop loads are involved. And lookups involve shippers, receivers, billto, carrier, driver, etc. Basically within one record you have to implement multiple lookups.
    Last edited by jim9; Jan 16, 2007 at 23:03. Reason: spell

  9. #34
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jim9 View Post
    But I have asked to see a real life online database site that was done in oop and as of yet no one can refer me to one. A real site that handles complex business such as a large warehouse that loads over 100 trucks a day. Or an example transportation site. Get something straight here, an ecommerce site like ebay though large in size and volume of records is still not considered a complex database application.
    Generating material safety data sheets for products at DuPont. A product is a chemical formula; to figure out the composition of a formula you have to look up all the "components" in another table; to figure out the composition of a component you have to look up all the molecules in that component in another table; then you need to reference all the safety, health, reactivity effects of that type of molecule, and all the possible interactions between that molecule and other molecules in the formula -- even more lookups. Lots of very heavy database work using software to build up complex chemical makeup of a product. There are hundreds of thousands of products. The reports have to do different analysis and report different information for 52 different global regions since every country around the world has its own regulations on information that has to be disclosed on chemical compounds crossing their borders.

    The program that handles all this is completely object-oriented in design. Its interface is a website; it's online, but only within DuPont's global intranet which spans 70 countries. DuPont has 60,000 employees and annual revenues in excess of $27 billion.

    Even with the example you asked for, you won't change your mind. Nobody changes their mind based on facts. They change their mind because they feel like it; it's emotional. As long as you've got your mind set on OOP being bad and procedural being good, no amount of examples will change that.

  10. #35
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A while back I went through the sitepoint paging oop tutor. I got it to work, but there were a couple of problems. Tonight I will poost this in a new topic. Perhaps if there were one "complete" example site I could understand. You cannot learn oop without seeing how the user input works with the php. Even the freeware oscommerce has procedual code. Site point examples still have the oop looking code and html on same page. In other words there are no complete examples of how the more complex stuff works in oop. I will re-post a nice new deal toniight.

  11. #36
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jim9 View Post
    In other words there are no complete examples of how the more complex stuff works in oop.
    http://www.symfony-project.com/askeet
    http://askeet.com/

  12. #37
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    jim,

    You'd see a lot more large scale OOP applications posted online except the people who pay so much for their creation would be kind of pissed.

    I don't get why you're so hung up about the auto completion of fields as that has nothing to do with whether or not the application is OOP or procedural, but it's just some added AJAX and or Javascript.

    As it's been said, no one here is going to change your mind, but I've yet to meet a coder who has done large scale applications who believes procedural is the way to work.

    I spent four years at school having OOP forced down my throat. I didn't think it was a good way to do things. I got a job and did an ecommerce site for a company that does a fair bit of traffic -- but I didn't use OOP.

    Then I got another job at a large government agency where I've been working on my current project for over a year. I saw the light of OOP on this project and now when I have to maintain my existing ecommerce website I wish I had seen it beforehand.

  13. #38
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is from training in interfacing a major backend database and php:

    Code:
    function ui_print_employees($employeerecords)
    {
      if (!$employeerecords) {
        echo '<p>No Employee found</p>';
      }
      else {
        echo <<<END
      <table>
      <tr>
        <th>Employee<br>ID</th>
        <th>Employee<br>Name</th>
        <th>Hiredate</th>
        <th>Salary</th>
        <th>Commission<br>(&#37;)</th>
      </tr>
    END;
        // Write one row per employee
        foreach ($employeerecords as $emp) {
          echo '<tr>';
          echo '<td align="right">'.
                htmlentities($emp['EMPLOYEE_ID']).'</td>';
          echo '<td>'.htmlentities($emp['EMPLOYEE_NAME']).'</td>';
          echo '<td>'.htmlentities($emp['HIRE_DATE']).'</td>';
          echo '<td align="right">'.
                htmlentities($emp['SALARY']).'</td>';
          echo '<td align="right">'.
                htmlentities($emp['COMMISSION_PCT']).'</td>';
          echo '</tr>';
        }
        echo <<<END
      </table>
    END;
      }
    }
    Now if this isn't procedual, I'll eat my hat. And there's php and html on the same page. This is also what my code usually looks like. I called the IT dept of one of the largest transportation companies in the world today after finding this example. I happen to know they use oracle as a backend and php to interface it. I was told that yes some of their code is in a oop format. However, around 75 percent is regular conventional php code. They stated usually it's easier to have information displayed by the traditional methods. I asked why they use php instead of java. Answer was php has remained basically the same, whereas the lastest java technologies are kinda evolving. Also the fact that with oracle they could actually have some things done in php and other in java eventually. I asked about asp.net. Answer was they didn't feel confortable with all the security issues on a windows server. I myself wrote the programs for my company. I have posted complete code examples in the past, and even gave the password and username to my test site. To date, I am yet to see a real example of a complex database management system done in that oop looking format that's not mostly flat file based. If this stuff is so dang popular there would be example after example of it. Look at php3 and 4 stuff, there are a gi-billion-billion yahoo search results pages on regular php stuff. SO either someone is telling a fib or only a very few people are actually using oop in php. IN fact, with my company it's easy to call and talk with IT people at various companies. I am going to call dupont and talk to them also. I believe we have hauled some freight for dupont in the past. I will get to the bottom of this oop non-sense one way or the other.
    Last edited by jim9; Jan 17, 2007 at 23:31. Reason: sentence left out

  14. #39
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jim, that example you posted is not the greatest example of either.

    I mean, it could just as easily be an object member function:
    PHP Code:
    $interface = new Interface();

    $interface->employee_records $employeerecords;
    $interface->print_employees(); 
    I think you are imagining the difference between procedural and OOP techniques to be much greater than it is.

    Also, for everybody's sake, can you please stop with the name dropping? OK, we understand you love shipping systems, we understand you deal with "the biggest in the world" but it is getting old when it is being repeated over and over.

    Regards,
    Jordan

  15. #40
    SitePoint Evangelist
    Join Date
    Jun 2003
    Location
    Melbourne, Australia
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jim9 View Post
    Below is an image of a tableview, and some code
    Not going to reproduce that. I find it almost unreadable. Whereas something like
    PHP Code:
    $user $session->loadByPk('User'$id);
    $user->email $request->getPostParameter('email');
    $user->save(); 
    tells you exactly what's going on, even though you can't see how the User class and its methods are implemented. OOP can be a lot more descriptive if it's written well.

    Want a more secure app? Try writing your database calls with PDO which makes use of prepared statements. The old mysql extension can't do that.

    Still, why am I bothering? As Dan suggested, it's pretty obvious you won't change your mind or even consider the opposing viewpoint on its merits.
    Zealotry is contingent upon 100 posts and addiction 200?

  16. #41
    SitePoint Guru brent5392's Avatar
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia View Post
    Despite what the Rolling Stones may think, remaining popular doesn't mean that you're not an old fart.
    PHP | MySQL | (X)HTML | CSS

  17. #42
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jim9 View Post
    ...one of the largest transportation companies in the world...
    Doesn't mean anything, just because they are big doesn't mean they are right. Lots of companies esp big and old ones run on legacy code unwilling to upgrade by spending a few dollars.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  18. #43
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do everyone a favor. Load up the northwind database in microsoft access. Next add a new customer order. Next notice after selecting the customer from the dropdown, the ship information is auto filled in. Next pretend a customer asked you to convert their networked database to an internet database. Also, pretend that customer said I want my shipto information auto filled just like it is on my networked database. Now write this aspect of the northwind database in php, post results here. Then I will say wow now I have seen something done in oop, and a lot of other folks will learn something about database programming. Oh, don't forget, the dropdown on an internet database should be pre filtered so as not to have too many records in dropdown.
    Last edited by jim9; Jan 18, 2007 at 11:09. Reason: forgot sentence

  19. #44
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

  20. #45
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jim9 View Post
    Do everyone a favor. Load up the northwind database in microsoft access. Next add a new customer order. Next notice after selecting the customer from the dropdown, the ship information is auto filled in. Next pretend a customer asked you to convert their networked database to an internet database. Also, pretend that customer said I want my shipto information auto filled just like it is on my networked database. Now write this aspect of the northwind database in php, post results here. Then I will say wow now I have seen something done in oop, and a lot of other folks will learn something about database programming. Oh, don't forget, the dropdown on an internet database should be pre filtered so as not to have too many records in dropdown.
    *sigh*

    Jim, the example you are asking for can be done in both OO or procedural programming practice, with a fair bit of Ajax thrown in.

    You set the onchange() event of your drop down box to make an Ajax call to a php page which retrieves the data from the database matching the selection made. The other part of the Javascript function then loads the information in to the other form elements.

    Is this what you are talking about? If so, the PHP side of it is so minimal it is a joke, this is an interface issue and handled via Javascript.

    Seriously, you are so far off the track, you are comparing apples with oranges.

    Regards,
    Jordan

  21. #46
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jim,

    I have built something that I think matches your description. And it is pretty much all OOP.

    http://sandbox.windebank.com.au/FillFields/

    If this is what you mean, I'll post the code. But I will state now that the major driving force behind this page is Ajax, not PHP.

    Regards,
    Jordan

  22. #47
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by J Windebank View Post
    Jim,

    I have built something that I think matches your description. And it is pretty much all OOP.

    http://sandbox.windebank.com.au/FillFields/

    If this is what you mean, I'll post the code. But I will state now that the major driving force behind this page is Ajax, not PHP.

    Regards,
    Jordan
    I've noticed jim thinks you can only use Javascript with PHP4.

  23. #48
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re

    Now picture your lookup and fields in the middle of another record. In other words, if you are entering a customer order, you are working with the orders table, and the lookup is being plucked from the customers table to fill these fields in the orders table. But answer is yes this is the type thing I'm talking about. If it's ajax it should work. One key thing here, is there a way to filter your dropdown first? Please post the code.

  24. #49
    SitePoint Addict
    Join Date
    Jul 2006
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PS Also go to my test site http://jimdiane.byethost9.com/petweb/login.php
    Login is pets / pets99
    click pets
    click edit just do the one named another pet.
    Notice in middle of edit screen the search box.
    If left blank all owners will fill a dropdown.
    If j is entered j&#37; will fill dropdown.
    If ji is entered only ji% etc.
    Leave it blank and hit find. Choose a different owner. Just hit the buttons till back to edit screen. I accidently left a java test alert box. And this little database was just for testing, not real. Real database is a trucking company.

  25. #50
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    What does this example case have to do with OO or procedural programming practice? Both can do this there is no difference in what they can do. They do the same thing just one does it better in a more maintainable way (ie. OOP)
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.



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
  •