Customer Login  .   Webmail Login  .   About Us  .   Contact Us
Go to: Articles List

Code Smarter Part 1 : Encapsulate Code

If you have been coding for long you have done it. You have written a group of lines of code that perform a specific task. Then a week or two later, you write the same code again. Frustrating isn't it?

The answer to this problem is to encapsulate your code! What this means is to put reuseable bits of code into functions or sub routines so that they can be reused at a later date.

However, that is not all. When you encapsulate code you need to write it in a way the makes it versatile and easily reused. A simple example of this is the database connection routine. Instead of writing this code over and over, or even cut and pasting it in, put it in to a sub routine.

When you encapsulate your code try to make it as easy to reuse as possible. We have all gone back through our old code and had to sit there for a second and figure out what we were trying to do. Make your code readable and comment it out for your own sake!

Shared Hosting
Rookie
Pro
Advanced
Dedicated Servers
BASE
BUSINESS
ENTERPRISE
Why Choose Brinkster?
Radical Support
Brinkster Datacenter
Brinkster Network
Corporate Social Responsibility
90 Day Money Back Guarantee
Unsurpassed Value
Client Testimonials
Additional Features
Antivirus
Merchant Account
E-Commerce
Live Chat Communicator
Free Firewall
Website Builder
Free Web Hosting
Support
General Support
Codebank Search
Forums
Articles
Click here for Brinkster Live Chat
Home   Domains   Shared Hosting   Dedicated Hosting   Partner   Support   About Us    Contact Us   Webmail
Copyright © Brinkster Communications Corporation All Rights Reserved. Privacy Policy & Legal