Sponsored by Dragon Age: Origins
Join the Dragon Age: Origins development team on Facebook view!
facebook.com/DragonAgeOrigins - EA presents BioWare's new dark fantasy epic Dragon Age: Origins. '9/10' from Game Informer.
68 Comments
- btipling, on 10/12/2007, -7/+48'developers are just lazy.'
Yeah, if massive amounts of tedious maintenance on ten's of thousands of lines of code can be called 'lazyness'. A better phrase might be 'not masochistic.' - cptshamrock, on 10/12/2007, -2/+16Anyone else feel like theres no content in this article
- inactive, on 10/12/2007, -6/+19What's the point of the Nintendo Wii if anyone barely uses the Nintendo Gamecube? :P
- dchesterton, on 10/12/2007, -0/+10I would say it depends whether its easy to write for both PHP 4 & 5 on your style of coding. If you code for PHP5 and try to downgrade the code to PHP4 it could prove difficult. If you're using Object Orientated PHP (i.e. classes) then it's near impossible to downgrade to PHP4 without a major re-write. Whilst if you're upgrading from PHP 4 -> 5 it should be easy and a matter of changing a few functions that are now deprecated.
It all depends whether you're going from PHP 4 -> 5 or PHP 5 -> 4 and your style of coding. - merreborn, on 10/12/2007, -2/+12I ported a PHP4 app to PHP5. 20,000+ lines of code. I had to change 4. For a few functions, like array_merge(), you now have to explicitly cast your args to (array) if the variable might be null.
4 lines out of 20,000. It's not hard. - merreborn, on 10/12/2007, -0/+9You don't *have* to change your classes to use PHP5. PHP5 supports the PHP4 object model.
Like I said above, to get my company's PHP4 app to run in PHP5, I had to change 4 lines out of 20,000. We're still using PHP4 object syntax, and it works fine. - Subcranium, on 10/12/2007, -4/+12People only upgrade when there's a compelling reason to upgrade. It's silly to try to browbeat people into switching. You have to add something that makes the leap worthwhile. I know PHP5 is better than PHP4, but I keep forgetting how. The sale was not made well. Drink New Coke.
I worked at a game company that switched from C about 15 years ago. It was hell to get people to switch. It's an extra effort that slows down production. It was hell to get people to switch from DOS to Windows, too.
Stop changing the damn language on a whim. - pornel, on 10/12/2007, -1/+8It IS very very hard to cripple decent PHP5 code to work on PHP4. PHP5 has normal OO support, with objects passed as references, exceptions, private/protected variables, interfaces and very neat SPL library. It's such a waste to give all that up just for compatibility with old crappy version.
- martian, on 10/12/2007, -2/+9Why should I as a developer degrade performance and reliability of my application because some sysadmin does not want to upgrade system software.
- _jinx_, on 10/12/2007, -2/+9Upgrading your version of PHP is not as easy as it sounds when your dealing with a lot of code. Re-writting a class is not just a 10 min process. It takes time and resources on the developers, systems and managers of a company or team.
The reason people haven't switched to PHP5 yet is because of the portability issues with the code, and calling a programmer lazy is way off! My company is in the process of switching to PHP5 with over 300 classes to re-write, scripts I can't begin to count along with just other stuff you won't know about until it doesn't work. PHP5 is great and awsome for a testing pool with smaller companies. However, bigger companies can't just update and go on like nothing happend. The smallest errors can cause a lot of loss in revenue! - eleven, on 10/12/2007, -0/+6The real reason people have not converted to PHP5 is that most ISP's and hosting providers have not yet upgraded. They have to consider all their customers code and the potential that they would loose customers who do not have "developers" at hand.
I love PHP5 and I wish I could use it's features more often. My dev environment is PHP5 while our production box is PHP4, it's not hard to write code that essentially targets both. I write using PHP4 objects that work fine with PHP5 - I just don't get all the new object features. We have a specialzed systems that are PHP5 and single application boxes. Honestly though most of our code doesn't need or use any PHP5 code. - SamKellett, on 10/12/2007, -2/+7PHP4 is so big because when it was released it was a kick-ass language and hosting companies made a lot of money out of installing PHP4 on their servers for their clients to use. But now PHP5 has come along, it's no longer a stand out kick-ass language, it's the upgrade to one and in most hosting companies eyes, it's not economically logical to spend a lot of time and trouble upgrading all their servers with the latest version of PHP, this doesn't only take a lot of time it would have a huge impact on all their current customers.
Ruby on Rails is the new PHP4, this is popping up on loads of hosting plans because it's a selling point for the companies. - inactive, on 10/12/2007, -0/+5I agree, people are being their own worst enemy when they don't want to upgrade. I really need to switch hosts! Not only are they using old PHP, but they seem to have disabled mod_rewrite recently too. Back to yucky looking drupal and cake URL's :(
- pornel, on 10/12/2007, -0/+5PHP is losely typed language which works great for web apps and has very flexible easy to use and powerful implementation of arrays. In web apps Java's strong typing is often just an annoyance than any help, and standard library classes for HashMap, etc. require too much code to work (interators, casts instead of just foreach() loop).
- dchesterton, on 10/12/2007, -3/+8Have you ever actually tried PHP 5's object orientated capabilities? They make it much easier to build large scale applications and I for one am very impressed by it.
- noderunner, on 10/12/2007, -0/+5php4 and php5 are completely different animals, there really isn't any reason to convert an existing php4 application to php5 unless you plan on using the vastly improved object model in php5. Standard procedure oriented applications are not going to be any faster, any more secure or any easier to maintain using php5.
However, if you are starting a new application, you really owe it to yourself to use PH5. Exception Handling, magic methods and the hidden gem known as the SPL (http://us3.php.net/SPL) allow you to make some very robust code, just be warned that there are some bugs in the database related extensions, mostly in the non mysql stuff. - zetsurin, on 10/12/2007, -7/+11> Very true. Its not very hard to make scripts both PHP4 and PHP5 compatible, developers are just lazy.
Sorry son, but I'm terminating your contract. Pack your bags, you're fired. - merreborn, on 10/12/2007, -0/+4"Understood, but why switch if we are going to use the same code"
For one, we've got multiple projects on the same box. So our newer project is pure PHP5, and lord it it great! The object model is actually comperable to that of 'real' languages like C++, and there are a handful of other functions that make life a little easier -- like fputcsv, curl_multi, and a handful of others I can't think of off hand.
PHP5 has new features. If you can get access to 'em with less than an hours work, might as well, eh? - btipling, on 10/12/2007, -2/+6I think PHP v4's success was good for PHP, but it was so successful that it's creating problems for PHP now. All these big applications have been in written in PHP4, and people aren't going to want to rewrite everything because PHP came out with a new version. Python on the other hand takes a totally different approach, they are very conservative and don't want to make any big changes to the core language. Some Linux distro's have PHP4 as the default version and that has been slowing things down.
You can run both PHP4 and PHP5, and take advantage of both. My shared host account at GoDaddy uses both, and for PHP5 files I use the .php5 extension. This lets me install things like Drupal and vBulletin versions written in PHP4 while creating my own PHP5 applications. - potsofdirt, on 10/12/2007, -0/+3I would blame the slow uptake of budget PHP5 hosting on two factors:
1. CPanel doesn't support PHP5 yet. That explains about 95% of budget servers not upgrading.
2. The other 5% of hosts cater towards users who just want to throw some PHP script on their site. Most users playing around with PHP as a minimal scripting language don't care about the OOP features of 5.
On a side note, I am sure most serious web programmer who deal with web applications that require the features of PHP5 most likely are running their own box, or have a managed solution. Then the remaining few percent have gone to the budget PHP5 hosts.
As a web developer working on moderate to large scale web applications, I can assure you that PHP5 is tremendously better than PHP4 for the type of work I do. The OOP features make it almost a different language. If you have checked out any of the PHP frameworks, you will notice that almost all require PHP5 because PHP4 is lacking.
Really serious about programming in PHP? Use PHP5. Want to create scripts, and minimal OOP-style stuff? Stick with PHP4. - dchesterton, on 10/12/2007, -1/+4I'm not denying that Java's OOP is not better than PHP's but I would certainly say that PHP 5's OOP is not 'poop'.
PHP is also a much more practical technology for the web. Yes you can use Java on the server-side but only if you wanna pay the extortionate server prices. Why do you think PHP has been the success it is? - Dracos, on 10/12/2007, -0/+3OSCommerce can arguably be called, within the scope of PHP, "the world's most popular spaghetti code". I've built two sites with it, and even if it does e-commerce well, the code is a freaking nightmare. Case in point: register_globals must be enabled, which even the PHP devs now admit was one of the worst ideas ever, and it likely won't even be included in PHP6.
- alienz, on 10/12/2007, -5/+8Have you ever looked at Python or Ruby or even Java for doing OOP on a webapp?
If you're writing OOP in PHP5 you owe it to yourself to check out some other scripting languages that can be used on the web. - zetsurin, on 10/12/2007, -0/+3This isn't just a question of upgrading because something is newer. That's quite simply a retarded reason, yet a reason that someone with no business sense wouldn't be able to steer away from. If a technology works and works well for your project, you stay with that tech unless a compelling reason comes along. The person who decides what that compelling reason also happens to be the owner of the project and nobody else. Also, factor in that most hosting environments do not want to upgrade due to high risk of incompatibilities etc.
Result of my bable: If it aint broke, and ESPECIALLY if you make money from the project, stick with what works! - Otto, on 10/12/2007, -0/+2There's a few ways to get this to happen:
1. If you release stuff, stop releasing backward compatible code. I run PHP5 and any PHP code I write will be PHP5 and any PHP4 users who don't want to upgrade are just ***** out of luck. If they want to figure out patches for their outdated systems, I'm happy to accept them if they don't break it on PHP5, but I ain't messing up my code just for backward compatibility.
2. FIX CPanel! Get CPanel to work with PHP5 and contribute those changes and then get hosting providers to upgrade. Seriously, every cheap piddly little host that runs a LAMP setup is using CPanel for their users, and they're stuck with PHP4 because they want CPanel. The majority of PHP projects are used by people on hosts just like these.
If all PHP devs started doing step one, and step two got done by somebody, then half the current PHP4 base would upgrade within a year. - btipling, on 10/12/2007, -3/+5I don't think that making things for two languages or two different versions of the same language would be fun at all. Also, rewriting things like bulletin board systems, cms systems, etc wont be fun either, but I guess eventually that will have to happen.
- _jinx_, on 10/12/2007, -0/+2Also another reason would be the capabilites of the language upgrade. PHP5 has great functionality with XML, Classes etc. If your company can take advantage of the new capabilites of the language features and feels that it is worth the investment or risk then go for it. Take one of the production boxes offline or purchase a new one, load PHP5 and begin to explore the new capabilites and ways to IMPROVE your older code...
- podgey22, on 10/12/2007, -0/+2There's no reason you cant use a real programming language and maintain simplicity. Generics in Java1.5 and ASPnet2 go a hell of a long way to cutting down on code.
Plus they're much faster and more efficient than PHP - whackaxe, on 10/12/2007, -1/+3Is it me or is everyone taking a ***** on PHP at the moment?
- _jinx_, on 10/12/2007, -1/+3Understood, but why switch if we are going to use the same code. If it was me I would upgrade and take advantage of the new capabilites. I can see your argument however if your dealing with a lot of code your bound to run into some problems..
- JonGretar, on 10/12/2007, -0/+2I think many developers are just skipping PHP5. Because PHP6 will come and have all the features that so should have been in PHP5. Like namespaces. Namespaces are a long needed feature but that also means that PHP5 scripts will NOT work in PHP6.
What would bring be back to PHP for some projects is a complete rewrite. PHP6 will break most programs so why not go all the way and say to hell with backward compatability and fix things like the various function name spelling( somenicefunction() vs. someNiceFunction vs. some_nice_function() ). - tintub, on 10/12/2007, -0/+2It's not the difficulty of modifying your code to work with PHP 5, it's the fact that you have a well tested PHP 4 application that you will need to retest extensively if you move to PHP 5. Not only that, but who's gonna pay for that time - if a client has paid for some software does that mean you have to spend the rest of your life keeping it shiny and new?
Also, as long as PHP 4 is still supported (which I believe it is), and you aren't planning on doing much to the code, why upgrade anyway? The new features in PHP 5 are only worth anything if you use them. - icexe, on 10/12/2007, -0/+2i migrated to PHP5 a few months back. I was never an OOP person, but since moving to version 5 I decided to give that technique a try. It was the perfect language for transitioning, since it easily supports both procedural and OOP type programming. It was so easy to compare both approaches as I built my apps.
I've since found myself using OOP more and more. It took a while to grasp some of the concepts, but once I made the connection, I started to love the OOP approach. It really helps to keep things better organized in those larger applications. - scsikool, on 10/12/2007, -1/+3I'd love to upgrade to PHP5 however I can't afford to take my commercial apps down just to make the switch. I don't think that PHP4 and PHP5 can reside on the same server so I would have to copy my apps to another server where I could test and make the necessary changes. Not a lot of people have that luxury.
- lambda, on 10/12/2007, -3/+4Cool, it's almost JSP now
- ileadyouth, on 10/12/2007, -0/+1Where I work I have full control of the server and versions - so I dont have to deal with the limitations of 4 or 5. Nor do I have to port it to work with other versions. There is no way I would try and build our system with PHP4. OOP in PHP4 was literal POOP. It is much more improved in 5, and I would never write for both ways where I work.
However, If i built something open source or for production, I would make sure it works on both versions.
Its not hard - but if I dont have to do it, I am not going to do it. This isnt laziness, I just dont feel like adding unnecessary code to a custom system. - TimothyFrisby, on 10/12/2007, -0/+1To those of you complaining about "migrating" your code to run on PHP5, take a look at this:
http://phplens.com/phpeverywhere/?q=node/view/221
I've had my own experience in migrating a website written under PHP4 with some fairly crufty inherited code and was able to get it to run under PHP5 by modifying a few configuration directives in an .htaccess file--no code modification necessary. - ileadyouth, on 10/12/2007, -1/+2slow?
- dvws, on 10/12/2007, -0/+1I think don't think so, Ruby on Rails is all the rage at the moment, but it'll never catch on like PHP has. As soon as some of the PHP frameworks mature a bit, no one will have any use for ROR and its (imho)***** syntax anymore
- _jinx_, on 10/12/2007, -0/+1I guess my punch against this article is not who wrote it cause who ever did does have knowledge, but fails to recognize the important differences in the language upgrade. He actually states it himself by recognizing that regester_globals needs to be turned on, imagine an upgrade on a server and the countless errors that would be found on sites.
Get another server, load PHP5 and begin to port your applications and test as you go along. Don't just make the jump and expect everything to be ok. - panic, on 10/12/2007, -0/+1I totally agree with this article. I can't think of anything that PHP5 broke when I upgraded. It adds new security features along with some nice new features for classes (such as access control to members). PHP5 also has several new functions that are handy.
One thing that I found odd was that PHP was recommending not using Apache 2.0 until recently. Even now they say don't use it if you have MPM enabled. Personally, I've been using PHP with Apache 2.0 since PHP 4.3.0 (I believe that's the verison I'm thinking of), when they made major Apache 2.0 improvements. This was years ago, and I've never had an unstable website or any issues for that matter, due to Apache 2.0. If anything, I think it's faster and more stable than before. - _jinx_, on 10/12/2007, -0/+1Your right, I have honestly never heard any developer bitching about register_globals outside of the fact with software capabilites. It is an obvious mistake and PHP5 is the fix, taking it out may not be a bad idea however it be defaulted = OFF is vital. It immedietly makes your web apps in some way vulnerable if not coded correctly like defining your variables.. which some dev's still do ( by accident ofcourse :) ).
- abdulmueid, on 10/12/2007, -0/+1I am mostly working with XML data. In PHP4 there are two approaches that one needs to take namely DOM and SAX which require a whole lot of effort, i.e. create a parser, create handles, create a start handler fuction and the list goes on depending on the task being performed. PHP5 on the other hand has the SimpleXML extension which is sure to make any developers life a heaven. Just parse the XML in a pre-defined function and have all your tags as variable.
So my point is, PHP5 does have advantages over PHP4, just think different and make your choice ;) - figvam, on 10/12/2007, -1/+2What is my incentive to switch to PHP5 if my app is working wonders in PHP4, doesn't use any of PHP5 new features and what's most important, is faster in PHP4 (which is well known fact - PHP4 is faster for all non-OO operations)? Yeah, I don't need PHP5, so I won't bother at least until PHP4's EOL.
- ericpp, on 10/12/2007, -0/+1We would love to upgrade to PHP5 at work, but it is not going to be an easy transition. Our CMS relies heavily on XML and the DOMXML functions from PHP4, which PHP5 does not include. Changing to PHP5 would mean rewriting about 70% of our CMS and about half of our supporting apps to use the new DOM functions.
- sherifgmansour, on 10/12/2007, -0/+1Yeah because that is what you would do... create a new programminglanguage because of the syntax!
- panic, on 10/12/2007, -0/+1Yeah I've come across that problem a few times. I can see why the hosting providers would do that, but they can lose customers that way too. In fact, that's why I switched from AffordableHost (which doesnt... or didnt... have php5) to a2webhosting. Also a2webhosting recently added MySQL 5 support, which AFAIK most hosting companies don't offer.
- sproutworks, on 10/12/2007, -0/+1I have been programming in PHP for about 3 years, and in other languages for many years before that. I started with PHP 4, and when PHP 5 was in beta, I started using it on my development box. All of my PHP 4 code worked without changing anything, since I followed recommend programming practices. At some point my host (dreamhost) offered a choice of PHP 4 or 5 for each domain hosted. More hosts should do this. If your host doesn't, you should ask them to consider upgrading.
- Drakazz, on 10/12/2007, -0/+1You don't need to switch from PHP 4 to PHP 5, or even 6.
I am sure that you can do that like this:
http://www.gentoo.org/proj/en/php/php4-php5-configuration.xml
..and not only on Gentoo.
And the actual problem is that hosting providers don't provide php5 at all because they don't know how to use both versions, at once, on one server.
This is really ignorance. When they have it - they don't want to "upgrade" because their clients applications will break.
Well, 1&1 have PHP 3, 4 and 5 for all compability - it was fun to see the php3's phpinfo() that was so blank :)
Just use PHP5, eh?
It's not so hard to convert from PHP4 to PHP5 for me, at least. Your applications won't break AFAIK - most scripts that I have are PHP4 but work on PHP5.
It would be a huge problem to go back :O
Here I come, PHP6! - Bret, on 10/12/2007, -0/+1> PHP6 will break most programs so why not go all the way and say to hell with backward compatability and fix things like the various function name spelling( somenicefunction() vs. someNiceFunction vs. some_nice_function() ).
So why not create a whole new language all-together and do away with PHP's hideous syntax? -
Show 51 - 68 of 68 discussions



What is Digg?