5 ms·
It seems to me that the issue isn't between shared code and no shared code but between statically and dynamically linking that code. It's a question of bundling
by astine 8y ago
It seems to me that the issue isn't between shared code and no shared code but between statically and dynamically linking that code. It's a question of bundling dependencies. You can generally statically link a GUI toolkit; you just have to deal with the extra disk and network usage. You can dynamically link the same library but then you just have to deal with all the familiar dependency issues you've probably dealt with. (DLL hell and related issues) It's a trade off, but in either case you're still sharing code.
- erik_seaberg 8y agoDLL hell happened because Windows used to lack a package manager, leaving apps to bundle their dependencies and overwrite other versions (without semver names!) in common directories.
- astine 8y agoYeah, Windows has traditionally been worse than Linux in this capacity, but my point is that dependency management is a non-trivial problem. My experience is that package managers usually work but not always (I've had occasional issues on Arch) and the fact that you need a package manager, and how sophisticated they often have to be, shows how tricky the problem can be to solve.
- pjmlp 8y agoAs if Linux is any better, specially regarding glibc.
- jiveturkey 8y agoit is better. (Unix/ELF generically, not linux). versioned symbols are a YUGE improvement over DLLs.
- pjmlp 8y agoHence why I explicitly mentioned Linux. Also Aix uses the same model as Windows. Finally, .NET Assemblies are versioned, and Microsoft has introduced Application Manifests around Windows XP. https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests https://docs.microsoft.com/en-us/windows/desktop/sbscs/appli... So it a matter of actually taking the effort of specifying the versions that the application works with.
- int_19h 8y agoAll assemblies are versioned and can potentially have unique strong names, not just .NET assemblies. A native DLL can still be an assembly. https://en.wikipedia.org/wiki/Side-by-side_assembly https://en.wikipedia.org/wiki/Side-by-side_assembly
- btschaegg 8y ago> Finally, .NET Assemblies are versioned, But then, you still have to put up with defining potentially hundreds of <bindingRedirect>s in config files to even get an application to run correctly, even though they mostly don't share their DLLs. The only thing it takes is Nuget dowloading a newer version of some dependency another library depends on, even if it's backwards compatible with the old API. Which, of course, it should always be if you haven't switched to a new major version. Edit: Also, I find it very disturbing that the resulting errors always happen to be crashes during runtime instead of up-front. If that happens with a plugin or through reflection: fine. But for most of .NET code, dependencies should be able to be loaded during startup.
- int_19h 8y agoTo be even more specific, it happened because apps dumped DLLs into shared system directories instead of bundling them alongside the app binary. Since on Windows, each app has its own directory, it's easy to bundle in a way that doesn't mess up other apps.
- __d 8y agoIt became so once the DLL search path was changed to put the .exe file's containing folder first. Prior to that, the system dirs were searched first, which was the trigger for the DLL hell issue.
- int_19h 8y agoI mean, if all apps avoided writing to the global folders (i.e. reserve it for OS-managed components), there wouldn't be an issue even with the old arrangement. But not even Microsoft's own products respected that in practice.
- tomatocracy 8y agoStatic libraries are a potentially bigger problem when your library is tightly coupled to a particular version of some other process (eg an X windows server). The real distinction in my view is between tightly coupled components and loosely coupled ones. Loosely coupled as a design paradigm is harder to design and maintain for the programmer and in some cases has a performance impact, but a lot nicer for the admin and feels ‘cleaner’ to me, at least.