title: When is it the right time to use C# class library (.dll)?
body: <p>I'm a programmer who has never really used .dll files.
  Of cause, when I need 3rd party software, such as a graphics library, a library to help me create graphs etc. I do add the references/ddl files to my program and use them in my code.</p>
  
  <p>Also, it seems like you can use .dll for a lot of different things, so I'd like the topic to concentrate on C#.</p>
  
  <p>Right now I am working on a sanitizing library(?) (I think that is the correct term), which will be full of relevant methods that can sanitize variables in all sorts of different ways.</p>
  
  <p><strong>What I want to know is:</strong> </p>
  
  <p>would there be any advantage to: </p>
  
  <p><strong>1)</strong> Write the methods to class library -> compile/build it -> add the library as a reference to the program - which would need to sanitize some variables ?</p>
  
  <p>Or would it be exactly the same if I where to: </p>
  
  <p><strong>2)</strong> Create a new SanitizeClass in the program -> add all the sanitize methods -> call the methods from the SanitizeClass in the different classes in the program that needs to sanitize variables</p>
  
  <p>In general, I also want to know when it is an advantage to use compiled class libraries.
  I'm thinking of speed, security, all of it.</p>
  
  <p>Could anyone enlightenment me? :)</p>