I just found myself copying and pasting the same code twice.
Right now I have one function that I want to share between two source files. It will pass the same variables from both source files. If I don't want to "repeat myself" would this be the best course of action? If both files have other functions that are separate should these reside in the library file, or as they are in the source file? How do you decide if a class is appropriate? How do you determine when to start splitting things apart?