Friday 19 July 2013

TIPS FOR PHP DEVELOPER

June 6, 2013
developer

A) GO OOP

If you have not yet entered the realm of Object Oriented Programming, then you are at a disadvantage, and you are falling behind fast.
OOP is essentially a method of programming with the use of classes, or Objects, which tie like things together, remove the need for repetition of code and perform the basic tasks of production very simply. Objects are essentially classes that collect a bunch of functions together and wrap them in a wrapper that can be reused over and over again without the need to rewrite functionality or procedures every time you need to do something.
Procedural Programming works by following a routine from the top to the bottom of each page as the server reads every file on your server. With OOP, there could be one or two objects being instantiated, which, in turn could instantiate a few, a hundred or a thousand other objects which could all perform certain tasks depending on variables passed into the objects. OOP is faster, simpler, easier to debug, uses less server resources, less code, is faster loading and more logical to work with once you figure out the basic principles. Go OOP – It changed my development style forever.

B) STAY AWAY FROM ANYTHING ENDING WITH _ONCE()

We all know that include() simply gives us a warning if it fails, while require() kills the script with a fatal error when it fails.

No comments:

Post a Comment