Re: c code reusability
- From: jacob navia <jacob@xxxxxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 17:29:33 +0200
Richard Heathfield wrote:
Michael Wojcik said:Another is that it
becomes too easy to introduce fresh bugs into a previously working
program.
Since static linking makes it equivalently hard to correct bugs in
an already-buggy program, this is a wash.
Not so. Just fix the bug and ship the executable, which is no harder than fixing the bug and shipping the DLL.
If your dll is used by several client executables, you can't ship the executable, they would have to relink with a new version of the
static library you ship to them. This is not always possible since
it supposes a toolset (linker, libraries, etc) that may not be at available at the client's site. Just shipping a dll makes only a file
copy necessary.
Another points for dlls that has not been mentioned is that (at least
under windows) dlls are called when loaded to initialize themselves.
This is very practical for libraries that need heavy initialization
stuff. Using a static library you are forced to write:
if (!initialized)
DoInit();
at the start of each entry point...
Dynamic linking can be abused (as anything). It is also the source
of hard to find errors. But just to dismiss it is nonsense.
.
- Follow-Ups:
- Re: c code reusability
- From: Richard Heathfield
- Re: c code reusability
- References:
- c code reusability
- From: mister catering
- Re: c code reusability
- From: Richard Heathfield
- Re: c code reusability
- From: mister catering
- Re: c code reusability
- From: Richard Heathfield
- Re: c code reusability
- From: Michael Wojcik
- Re: c code reusability
- From: Richard Heathfield
- c code reusability
- Prev by Date: Re: Dynamic buffer library
- Next by Date: Re: strncpy not that easy to use
- Previous by thread: Re: c code reusability
- Next by thread: Re: c code reusability
- Index(es):
Relevant Pages
|
Loading