Forum Moderators: coopster

Message Too Old, No Replies

Efficiency: PEAR libraries or custom written code?

Does it have significant impact on server costs?

         

chrisandsarah

3:24 pm on Apr 8, 2008 (gmt 0)

10+ Year Member



Hi

I'm not a programmer but run a fairly heavy traffic photo sharing website.

I've been made aware by the guy who wrote all the code, that everything is hand-written by him, custom coded, streamlined, and that for any future development I should get devs to make use of / add to the existing classes / sessioning system that he wrote, otherwise if they start adding PEAR libraries etc, instead of making use of a single server, we'll be looking at having to have multiple servers to run the site on and at considerable costs.

He's basically told me that 95% of devs out there won't be able to write their own efficient code and will insist on using off-the-shelf libraries, and we will pay the price of their poor programming.

I just wanted peoples opinions on this. Do big code libraries such as PEAR add significant server load that we'll need to upgrade the server considerably?

Many thanks in advance. This is a big headache for us, not knowing where to go next in finding someone with the right skills to further develop our site, if all the above is true.

PHP_Chimp

4:45 pm on Apr 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Although I cant comment on your exact circumstances I would suspect that what you have been told is true. In that custom code that is written for exactly what you want if likely to be better for your specific application.

However PEAR library's tend to be pretty well optimized. As you only use the functions that you require the rest of the code just sits there. In fact if you are using php then that as a language is not optimized for your specific usage.

So while the guy who wrote your code is correct as with everything it all comes down to your choice. While you choose to keep using them then you will get the skills that they posses (and they sound like they are well worth making use of). If you choose to use another mechanism for getting the code then you will have less optimized code, but code that is easier to maintain.

So using a PEAR library should open up your code maintenance to other people. The trade off in server load is unlikely to be significant. However if you want to check then just experiment with some of the library's. As the exact extent of the optimization that has taken place on your code is unknown.

At the end of the day it will probably come down to your choice.

<edit>
Seeing as you are asking for opinions what follows is my personal opinion not really on the code, but on the circumstance.

If you find a person that is capable of writing good code then keep them. As there are a lot of people that claim to be but aren't. There are a lot of people that are Ok-Good, only a very few that are Good-Excellent and almost none that are Excellent. So if your guy is Excellent then keep them.

However I know people that have lost there main coders through retirement, then found that very few other people could actually maintain the code. So if you are looking for a long term solution then get your present coder to make there code more maintainable. All they need to do is add comments to the code.

It may also depend on the exact extend of the code optimization. As a smaller code file will need less memory so $a is more optimized than $answer, however that would be extreme. More appropriate to something used in the stock market, as every split second counts in that environment.

So code with comments and easy to follow variable names should be able to be maintained by most people. Once they have got used to the style that the code has been written in.

Then you just need to look for another person that is actually Excellent, not just someone that thinks they are ;)

[edited by: PHP_Chimp at 4:58 pm (utc) on April 8, 2008]

henry0

4:52 pm on Apr 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP-chimp shoots faster…

He's basically told me that 95% of devs out there won't be able to write their own efficient code and will insist on using off-the-shelf libraries, and we will pay the price of their poor programming.

Let's start by reversing the equation
Most pro will easily write a very efficient code with or without using off-the shelf-library
Note I said with or without, many programmers do not insist on using libraries
BUT They take advantage and benefits from those highly pro libraries (I use as you did the word library) but to be PHP politically correct for example PEAR is a PHP extension and application repository.

chrisandsarah

11:56 am on Apr 9, 2008 (gmt 0)

10+ Year Member



You say "The trade off in server load is unlikely to be significant."

the guy who i refer to, the original coder, is saying basically if they don't continue in the same way he has, we could end up having to run the site of multiple servers, instead of the single one its on.
This is whats worrying us, as the original coder is no longer available to us because of other commitments.

Thanks for all your info. it's been appreciated

henry0

12:08 pm on Apr 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps we should have asked about the actual server loads
what do you serve anything heavy, video... etc.?
any high volume of calls to MySQL
lots of user input, user edit

visit frequency: 10K/hours more...