SitePoint Sponsor |
|
User Tag List
Results 26 to 50 of 58
Thread: should I upgrade to PHP5 ?
-
Jan 16, 2007, 18:13 #26
- 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.
-
Jan 16, 2007, 18:46 #27
- 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.
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jan 16, 2007, 19:16 #28
- 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 ;-)
-
Jan 16, 2007, 19:35 #29
- 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.
-
Jan 16, 2007, 20:47 #30
- 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.
-
Jan 16, 2007, 21:49 #31
- 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.
-
Jan 16, 2007, 22:28 #32
- 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
-
Jan 16, 2007, 22:49 #33
- 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
-
Jan 16, 2007, 23:52 #34
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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.Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jan 17, 2007, 08:52 #35
- 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.
-
Jan 17, 2007, 09:05 #36
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jan 17, 2007, 18:33 #37
- 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.
-
Jan 17, 2007, 23:28 #38
- 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>(%)</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; } }
Last edited by jim9; Jan 17, 2007 at 23:31. Reason: sentence left out
-
Jan 17, 2007, 23:45 #39
- 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();
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
-
Jan 18, 2007, 07:24 #40
- Join Date
- Jun 2003
- Location
- Melbourne, Australia
- Posts
- 440
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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();
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?
-
Jan 18, 2007, 08:52 #41
-
Jan 18, 2007, 10:45 #42
-
Jan 18, 2007, 11:04 #43
- 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
-
Jan 18, 2007, 12:36 #44
- Join Date
- Aug 2000
- Location
- Philadephia, PA
- Posts
- 20,578
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Try Improvely, your online marketing dashboard.
→ Conversion tracking, click fraud detection, A/B testing and more
-
Jan 18, 2007, 16:20 #45
- Join Date
- Jul 2003
- Location
- Melbourne, Australia
- Posts
- 579
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
*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
-
Jan 18, 2007, 17:33 #46
- 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
-
Jan 18, 2007, 21:38 #47
- Join Date
- Jul 2005
- Location
- Orlando
- Posts
- 634
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jan 19, 2007, 07:23 #48
- 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.
-
Jan 19, 2007, 07:41 #49
- 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% 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.
-
Jan 19, 2007, 11:56 #50
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)
Bookmarks