Anyone who's used Windows, especially older versions, is probably familiar with the dreaded
DLL error when you're in the middle of trying to do something.
Although DLL files seem to be important given how much Windows complains when one is broken
or missing, it's not exactly obvious what they are, so let's explain why they're
a big deal. DLL stands for Dynamic Link Library, but don't mistake them for a collection of Zelda NFTs.
The reason they're called libraries is that DLLs contain shared code that multiple programs
can link to and use, kind of like how real libraries contain shared books that many people
can borrow. But DLLs have an important feature that books don't.
Several programs can use one DLL at the same time, and once a DLL is loaded into a certain
space in memory, any program that needs the code inside can request access to that memory
space without the DLL having to be loaded over and over again.
A good, simple example of this is this DLL file, which contains the code for bringing
up a Windows pop-up dialog box. Since so many programs use this functionality, it makes sense for this code to be included
in Windows as a DLL instead of writing it into every program from scratch.
Another good example is the Device Driver, which is the code that allows Windows and
other programs to communicate properly with hardware.
Drivers often take the form of DLLs, though they can appear as .sys files in Windows Explorer,
which allows multiple applications to access your GPU, keyboard, or printer, its drivers,
at a time. And because DLLs are only loaded up when a program specifically asks for them instead
of every time the program starts, they also prevent your RAM from filling up with tons
of unnecessary code. This modularity means that new functionality such as game updates or support for different
languages can be added to older programs simply by writing new DLLs rather than having to
modify the program itself. That's not only more convenient, but you don't run the risk of inadvertently breaking the
code of the main executable. But if DLLs are such a good idea, why are they so notorious for creating problems, often
referred to as DLL hell? So one big reason DLLs cause problems is that when an application depends on lots of DLLs,
it also means that application has many possible points of failure.
If a DLL gets modified, there's no way for a program that loads up the DLL to ensure
that the new code is compatible. And if it isn't, the program you want will often simply crash.
You see, some programs will go messing around with DLLs in a way that they shouldn't.
An installer, for example, may decide to modify a DLL in a way that helps that specific application,
but can cause errors in the possibly many other programs that need the same DLL, but
aren't compatible with the modified version. For a long time, Microsoft expected third-party software developers to verify that any DLLs
they installed, especially if they overrode existing ones, would comply with accepted
standards. But needless to say, with developers typically more concerned about making sure their own
software works, it often simply didn't happen, and programs kept installing troublesome
DLLs with impunity. Mercifully, this problem has been mitigated to a large extent in more recent versions
of Windows. Microsoft has locked down system DLLs so that third-party applications can't mess with
them unless they've actually been authorized by Microsoft itself.
DLLs can now also track DLL installations to try to prevent unknown DLLs from making
their way onto the system, as well as to allow two different versions of a DLL to exist simultaneously
to prevent programs that rely on an older revision from breaking when you add a new one.
And with modern PCs having a lot more memory than the computers of the 90s and early 2000s,
the memory limitations that necessitated DLLs in the past aren't as prevalent today, meaning
that modern programs often don't rely on DLLs nearly as much.
Maybe stuffing 64 gigs of RAM in your personal rig wasn't such a big mistake after all.
But you know what is a mistake? Not liking this video and subscribing, so do it.