Daves Computer Tips

What is a dll file?


Depending on the settings you have set in Windows you may see files with the file extension of “dll” in program directories and the Windows Folder. Others, who have not enabled the “Show hidden files and folders” setting won’t see them, but rest assured they are there! What are they? Why are there so many of these dll files?

DLL stands for Dynamic Link Library and is generally used to share parts, or functions, of a program. Dynamic link libraries are a real time-saver for programmers. A programmer can write a bit of code once and use it multiple times. Even better, several programs can use the same DLL file resulting in even more time saved! In the most basic sense a dll is a small program another program can use so the “wheel” doesn’t need to be re-invinted with every program. If we think of a simple program to add 2 numbers and give the results as an oversimplified example it might look like this:

  1. Ask for first number (10 lines of programming code setting variables and limits)
  2. Ask for second number (10 lines of programming code setting variables and limits)
  3. Calculate result (10 lines of programming code to calculate the addition)
  4. Display result (10 lines of programming code to format the result and display the result on the screen)

If you image that each function above requires 10 lines of program code the entire program would be 40 lines. If we use the same example using DLL’s we would see the following:

  1. Call firstnumber.dll (1 line of programming code to call the dll file)
  2. Call secondnumber.dll (1 line of programming code to call the dll file)
  3. Call calculate.dll (1 line of programming code to call the dll file)
  4. Call displayresult.dll (1 line of programming code to call the dll file)

I know the above example is very simple (maybe hard to visualize), but hopefully you can see that by using dll’s this simple program could save the programmer 36 lines of code – and a lot of time. Now carry that forward to an operating system like Windows 7, or a major program like Photoshop, with millions (Yes! Millions!) of lines of code it becomes readily apparent that using dll’s saves a lot of time, complexity, and size.