[NTLUG:Discuss] Code - was: Is there a way to change permissions of a link
Greg Edwards
greg at nas-inet.com
Sat Nov 4 12:09:13 CST 2000
Richard Cobbe wrote:
>
>
> Warning, the following is a complaint I've made before about the state of
> the industry. If you've heard me gripe about this before, there's nothing
> new here....
>
> Why is the concept of moving common code into a library or the kernel so
> alien to these folks? For that matter, why is the concept of moving common
> code so far away as a separate *function* within the same module so alien
> to so many of my co-workers?
>
I was going to stay out of this thread at first but this is such a hot
button with me that I couldn't:)
First off AMEN to Richard!!!
It has amazed me over the years how folks in the software industry have
totally missed the true power and elegance of the C language. There are
many other languages that provide similar and, sometimes, just as
powerful features but I'll stand by my choice of C as the language of
choice. This is not intended as a language (religious) war, but the
concepts of modular design are so easy to build with C objects and
libraries.
It is beyond my understanding why virtually every company I walk into
has the same basic problem that has produced a maintenance nightmare.
You'll find the same function replicated maybe 10 times in 12 programs.
Some copies are copies and some are original code solving the same
problem.
The concept of building a common toolset is pretty simple, at least I
think so. If a function requires a set of support functions it belongs
in an object linked into the program. If a set of functions can be used
by more than 1 program then they belong in a library. If a set of
functions provide support for a low level concept (hardware interface,
database access, etc.) the an API that resides between the lower level
control and the application programs should be built into the
libraries. By providing these libraries as shared libraries an entire
companies' operations and applications can be altered in an instant.
Including
the eradication of bugs!!!
By using this simple concept application (top level) programs become
almost trivial. For example: to write a report program that uses data
from 3 different databases becomes an exercise in how to format the
report and not how to get the data from the database. Once the report
program has been developed and the upper management types decide to drop
Informix for Oracle the application programmer never needs to touch
his/her code. The lower half of the API and the lower level database
interface libraries are the only points of change. Instead of a massive
coordinated upgrade effort simply converting the database and installing
the updated libraries gets the job done. In the embedded industry a
card from a rack can be completely redesigned and as long as the
interface between the application and the hardware is through a library
a relink and reload is the only impact on the top-level code.
The point being that by building your toolsets outside of the program
and providing them to programs via libraries you achieve modular
design. Think about this, your favorite OS is a modular design. By
providing a ton of small programs (/bin) a user can access the power of
tools and resources without having to reinvent the wheel. Just like the
concept of providing libraries to programs.
Sorry for the rant and rambling but I did say this was a hot button with
me. I could go on but I won't:) (I heard that:)
--
Greg Edwards
New Age Software, Inc.
http://www.nas-inet.com
More information about the Discuss
mailing list