Reusable Code
April 22, 2011 No CommentsAs a web developer you are probably familiar with this concept: Reusable Code. For some of us (like me) it was pounded in your head throughout school and I have to say it has definitely made my life easier. Reusable Code is just as it suggests: useful code that you can use in many different projects so you don’t waste needless time rewriting the same code. What you want to do it make your code broad so that it will fit into many different situations. For example if I want to make a contact form in ASP.NET I know that not everybody has the same parameters (options) in their form but 90% of the time there’s going to be a name, number, email, and message. So I program a method (code tidbit) that has these parameters. If I need to add more then everything is already set up for me all I have to add is add the parameter and what to do with it. Another example is javascript/JQuery plugins. I personally save a lot of my javascript plugins for future use – maybe I can use an old plugin, manipulate it, and throw it as a new gallery but either way I don’t have to search or code a brand new plugin every time I have to make a gallery of some kind. Do you practice Reusable Code?
What kind of example can you give of using Reusable Code?

By – Alex Miller
Web Pointers
Sorry, the comment form is closed at this time.