Wednesday, May 5, 2010

Speeding up Coding...


We are using php coding in most of our projects.

And, we are following some important guidelines to improve our performance.

But, I thought we need to improve further for achieving our vision.

So, I asked below question in LinkedIn.


Which is best? - Writing each line of code from scratch or using modifying similar code already available in Internet

We are are start-up software/Web development company.
We are doing php/mysql coding for our clients .
I would like to speed up our development process.

Currently I am having two options.
1. Writing each and every line of the required php coding from scratch
2. Searching similar code and get it from internet and make necessary changes for our needs.

Which option I should recommend for our Team to follow?

(Note that I am talking about small piece of code. Obviously using already available code will be advantageous for large modules such as forum, gallery)


I was surprised to see lot of Good Answers in very short time. So, I closed the question within a Day by selecting below answer as Best Answer.



This entirely depends upon the team individuals and their past experience on PHP projects.

As you mentioned small piece of code i guesss you are talking about the logics for small individual functionalities like creating Captacha security, Javascript validations, creating JS popups and modal boxes, logics for paginations, dropdown menus, image gallery and lot more small functionalities like these. I would strongly suggest instead, of writing code from scratch for these kind of functionalities and their logics, look on the net (www.phpclasses.org is a good resource) and make neccessary changes to suit your requirement. This is because there already lot has done on common functionalities. (Look for JQuery plugins for menus etc.)

Now let us talk about the a little bigger functionalities which are actually small specific web apps in nature. Like if you want to have a Poll functionality, bulletien board, forum, blog etc. You can use the logics from various already developed codes (available on thet net) and integrate these with modifications required as per your customized application. You can code from scratch taking the logics commonly used and if required enhance functionalities in it.

It is also imporant to see if a big application is going to be built on various small functionalities. and it may happen in future to enhance each functionality with more advanced feature than create scratch code so that you may modify and keep the uniformity in code for maintenance purpose.

I would also suggest if you are taking our code from internet tutorials and other resources etc. ask your guys to write 2-3 lines about the code understanding and modification done for the documentation purposes.
Links:

* http://jquery.com
* http://phpclasses.org



You can refer the other answers at LinkedIn Site.

From all these answers, I can understand below things will give best performance.

-For large modules we can use any standard open source code.
-For small piece of code, it is better to write from scratch, anyway we can refer any existing code to include exception handling or any other additional stuffs.
-If we are going to use the already available piece of code which should understand the flow and we should add proper comments by ourselves.

More Articles...
You can bookmark this blog for further reading, or you can subscribe to our blog feed.

No comments:

Search This Blog