WEBVTT

00:00:00.000 --> 00:00:04.640
Anyone who's used Windows, especially older versions, is probably familiar with the dreaded

00:00:04.640 --> 00:00:08.080
DLL error when you're in the middle of trying to do something.

00:00:08.080 --> 00:00:12.200
Although DLL files seem to be important given how much Windows complains when one is broken

00:00:12.200 --> 00:00:16.960
or missing, it's not exactly obvious what they are, so let's explain why they're

00:00:16.960 --> 00:00:24.280
a big deal. DLL stands for Dynamic Link Library, but don't mistake them for a collection of Zelda NFTs.

00:00:24.280 --> 00:00:29.480
The reason they're called libraries is that DLLs contain shared code that multiple programs

00:00:29.480 --> 00:00:34.760
can link to and use, kind of like how real libraries contain shared books that many people

00:00:34.760 --> 00:00:39.360
can borrow. But DLLs have an important feature that books don't.

00:00:39.360 --> 00:00:44.800
Several programs can use one DLL at the same time, and once a DLL is loaded into a certain

00:00:44.800 --> 00:00:50.000
space in memory, any program that needs the code inside can request access to that memory

00:00:50.000 --> 00:00:54.520
space without the DLL having to be loaded over and over again.

00:00:54.520 --> 00:00:59.200
A good, simple example of this is this DLL file, which contains the code for bringing

00:00:59.200 --> 00:01:06.160
up a Windows pop-up dialog box. Since so many programs use this functionality, it makes sense for this code to be included

00:01:06.160 --> 00:01:10.920
in Windows as a DLL instead of writing it into every program from scratch.

00:01:10.920 --> 00:01:14.840
Another good example is the Device Driver, which is the code that allows Windows and

00:01:14.840 --> 00:01:18.120
other programs to communicate properly with hardware.

00:01:18.120 --> 00:01:23.360
Drivers often take the form of DLLs, though they can appear as .sys files in Windows Explorer,

00:01:23.360 --> 00:01:29.600
which allows multiple applications to access your GPU, keyboard, or printer, its drivers,

00:01:29.600 --> 00:01:34.800
at a time. And because DLLs are only loaded up when a program specifically asks for them instead

00:01:34.800 --> 00:01:39.480
of every time the program starts, they also prevent your RAM from filling up with tons

00:01:39.480 --> 00:01:45.720
of unnecessary code. This modularity means that new functionality such as game updates or support for different

00:01:45.720 --> 00:01:51.320
languages can be added to older programs simply by writing new DLLs rather than having to

00:01:51.320 --> 00:01:57.200
modify the program itself. That's not only more convenient, but you don't run the risk of inadvertently breaking the

00:01:57.200 --> 00:02:03.840
code of the main executable. But if DLLs are such a good idea, why are they so notorious for creating problems, often

00:02:03.840 --> 00:02:11.640
referred to as DLL hell? So one big reason DLLs cause problems is that when an application depends on lots of DLLs,

00:02:11.640 --> 00:02:15.420
it also means that application has many possible points of failure.

00:02:15.420 --> 00:02:20.600
If a DLL gets modified, there's no way for a program that loads up the DLL to ensure

00:02:20.600 --> 00:02:26.520
that the new code is compatible. And if it isn't, the program you want will often simply crash.

00:02:26.520 --> 00:02:31.260
You see, some programs will go messing around with DLLs in a way that they shouldn't.

00:02:31.260 --> 00:02:37.360
An installer, for example, may decide to modify a DLL in a way that helps that specific application,

00:02:37.360 --> 00:02:42.660
but can cause errors in the possibly many other programs that need the same DLL, but

00:02:42.660 --> 00:02:50.120
aren't compatible with the modified version. For a long time, Microsoft expected third-party software developers to verify that any DLLs

00:02:50.200 --> 00:02:54.360
they installed, especially if they overrode existing ones, would comply with accepted

00:02:54.360 --> 00:02:59.440
standards. But needless to say, with developers typically more concerned about making sure their own

00:02:59.440 --> 00:03:04.320
software works, it often simply didn't happen, and programs kept installing troublesome

00:03:04.320 --> 00:03:09.800
DLLs with impunity. Mercifully, this problem has been mitigated to a large extent in more recent versions

00:03:09.800 --> 00:03:15.760
of Windows. Microsoft has locked down system DLLs so that third-party applications can't mess with

00:03:15.760 --> 00:03:19.840
them unless they've actually been authorized by Microsoft itself.

00:03:19.840 --> 00:03:24.240
DLLs can now also track DLL installations to try to prevent unknown DLLs from making

00:03:24.240 --> 00:03:30.560
their way onto the system, as well as to allow two different versions of a DLL to exist simultaneously

00:03:30.560 --> 00:03:36.000
to prevent programs that rely on an older revision from breaking when you add a new one.

00:03:36.000 --> 00:03:41.120
And with modern PCs having a lot more memory than the computers of the 90s and early 2000s,

00:03:41.120 --> 00:03:45.880
the memory limitations that necessitated DLLs in the past aren't as prevalent today, meaning

00:03:45.880 --> 00:03:50.480
that modern programs often don't rely on DLLs nearly as much.

00:03:50.480 --> 00:03:54.960
Maybe stuffing 64 gigs of RAM in your personal rig wasn't such a big mistake after all.

00:03:54.960 --> 00:03:59.720
But you know what is a mistake? Not liking this video and subscribing, so do it.
