8 Replies - 427 Views - Last Post: 03 April 2011 - 01:41 PM

Poll: Do you recycle? (8 member(s) have cast votes)

Do you recycle?

  1. Yes (8 votes [100.00%])

    Percentage of vote: 100.00%

  2. No (0 votes [0.00%])

    Percentage of vote: 0.00%

Vote Guests cannot vote

#1 Creecher  Icon User is offline

  • I don't care
  • member icon

Reputation: 561
  • View blog
  • Posts: 2,049
  • Joined: 06-March 10

Do you recycle?

Posted 03 April 2011 - 08:02 AM

When I create websites, I tend to go back to my older works and see if there are things I like about them that I can recreate in my newer one. Also, I use the same PHP email form I created a long time ago for all of my "contact" pages.


Do you do this? Or do you start from scratch and make everything new?
Is This A Good Question/Topic? 1
  • +

Replies To: Do you recycle?

#2 EnvXOwner  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 357
  • View blog
  • Posts: 2,319
  • Joined: 10-August 09

Re: Do you recycle?

Posted 03 April 2011 - 08:06 AM

I reuse functions from older projects that I've worked on.
Was This Post Helpful? 0
  • +
  • -

#3 nick1200  Icon User is offline

  • Php Coder
  • member icon

Reputation: -19
  • View blog
  • Posts: 922
  • Joined: 21-March 09

Re: Do you recycle?

Posted 03 April 2011 - 08:39 AM

I always 100% use my old coding . But then again i code rpg's so if you have 1 rpg it is easy to change things but keep the same code ...
Was This Post Helpful? 0
  • +
  • -

#4 Jstall  Icon User is offline

  • Lurker
  • member icon

Reputation: 434
  • View blog
  • Posts: 1,042
  • Joined: 08-March 09

Re: Do you recycle?

Posted 03 April 2011 - 08:56 AM

Sure do,

90% of my PHP is object oriented, one of the primary benefits of OOP is the ability to take a class and use it multiple places and in multiple applications. Add to that the ability to extend classes and create interfaces and you have a whole lot of portable generic code pre-built. You would be crazy not to reuse :).

Javascript functions and jQuery plug-ins are the same, if they are made generic enough they can be portable and given specific implementation in different apps.

Page layouts are the same I'm sure, as well as color schemes but I can't make a page look good to save my life :-P.
Was This Post Helpful? 1
  • +
  • -

#5 TMKCodes  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 48
  • View blog
  • Posts: 440
  • Joined: 21-March 09

Re: Do you recycle?

Posted 03 April 2011 - 09:29 AM

Myself I have started to build up PHP framework of my own from the PHP classes I have created or i'm going to create. Then I can easily add html template to the site and just create the index.php file and include the stuff i need.
Was This Post Helpful? 0
  • +
  • -

#6 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3730
  • View blog
  • Posts: 6,017
  • Joined: 08-June 10

Re: Do you recycle?

Posted 03 April 2011 - 11:44 AM

I try to reuse my code, but I somehow always end up writing an "improved" version of it :)

But I have a basic MVC layout I use for most of my projects, and some basic modules I've got that don't need much "improvement". (Blog systems, news, forums, etc...)
Was This Post Helpful? 0
  • +
  • -

#7 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1183
  • View blog
  • Posts: 7,253
  • Joined: 07-September 06

Re: Do you recycle?

Posted 03 April 2011 - 11:55 AM

I reuse code. It just makes sense, if you wrote the wheel once why write it again?

I keep my PHP OO and have modules which I can just plugin and they will work with whatever I need them to do (because of the rest of the system I have developed over the years). In C++ I create a ton of header files so I can just copy whatever is useful between projects and have a leg up on my work. In JS I create objects as well, and build upon them making a library of simple functions which can be combined easily to create far more useful and powerful functions as needed with little work (this is a jQuery esque library I once called jBeta - and had a thread about in the share your projects section - it has changed a TON over the last few years and now doens't even look like the same code, though I have rewritten it like 5 times from scratch improving things).
Was This Post Helpful? 2
  • +
  • -

#8 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1381
  • View blog
  • Posts: 3,510
  • Joined: 28-November 09

Re: Do you recycle?

Posted 03 April 2011 - 12:45 PM

To start from scratch repeatedly would be a gross waste of time. I took the time to develop my own frameworks to expediate my work and they have saved me multiple multiple hours in the long run of things.
Was This Post Helpful? 0
  • +
  • -

#9 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: Do you recycle?

Posted 03 April 2011 - 01:41 PM

The point of OOP is to reuse code. So that is what you should do. Of course, I often find better ways to do something every time I use it... so over time the code often becomes more concise, accurate and efficient.

I would recommend keeping all of your code organised. If it is PHP, keep it in classes with methods which make sense. If it is html, keep it in folders clearly labeled.

A good way to keep track of them (if it has not already been submitted) is to submit as a snippet on here!
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1