🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sw.components
2 messages
2 total messages Started by Yossi Cohen-Shahar Wed, 09 Sep 1992 15:16
Guidelines for writing reusable C and Assembly code.
#332
Author: Yossi Cohen-Shahar
Date: Wed, 09 Sep 1992 15:16
33 lines
1812 bytes
I'm a member in a Software Reuse Committee of 
Motorola Communications Israel.

Our committee has started its work a year ago.
We have established an organization reuse database, 
rewarding program to engineers for encouraging 
software reuse and we have invested in increasing the
awareness to it as well.

As part of establishing the software reuse we are also 
writing a "Software Reuse Handbook" for the software
managers and the software engineers. This handbook
contains information regarding the reuse process
and the use of the tools.

In order to complete this handbook, we are seeking 
for information / handbook / guidelines that describes
how to write C code and Assembly code in "reusable manner",
meaning how to write code in a way it would be easier
to reuse it in the future.

Thanks.



-- 
 _______________________________  ____________________________________ 
[                               ][                                    ]
[       Yossi Cohen-Shahar      ][ Internet: yossi@mcil.comm.mot.com  ]
[      Radio Products Group     ][ Post:     cyc001                   ]
[ Motorola Communications Israel][ Phone:    +972 (3) 565-8365 (UTC-2)]
[                               ][ Fax:      +972 (3) 565-8736        ]
[_______________________________][____________________________________]    
Re: Guidelines for writing reusable C and Assembly code.
#333
Author: peter da silva
Date: Thu, 10 Sep 1992 18:04
42 lines
2379 bytes
In article <1992Sep9.151622.11062@lmpsbbs.comm.mot.com> yossi@mcil.comm.mot.com (Yossi Cohen-Shahar) writes:
> In order to complete this handbook, we are seeking 
> for information / handbook / guidelines that describes
> how to write C code and Assembly code in "reusable manner",
> meaning how to write code in a way it would be easier
> to reuse it in the future.

Ah! This is one of my hot buttons. I'm really upset about some of
the supposedly reusable code I've seen. It's usually way too application
specific or depends too much on other parts of an application to really
reuse it.

The main rules I use in designing code (or a tool) for reuse are:

	1.	How much can I generalize this without losing
		efficiency. For example, in a symbol table for
		a text based application I allowed the use of
		any arbitrary chunk of data in the target, rather
		than simply a text string.

	2.	How can I simplify the interface without losing
		efficiency. In the case of this symbol table, I
		only use four basic routines: create a symbol
		table, look up an entry, execute a subroutine for
		each element, and destroy a symbol table. Lookup
		automatically creates an entry if none exists,
		simplifying external code design: it's not hard to
		check explicitly, but it's something more to forget.

	3.	How can I AVOID using other reusable tools in this
		tool. If I build a tool that's dependent on MY
		private code library other people are unlikely to
		be able to use it. It means I may take more time,
		but it's time well spent. If I can't avoid it, I
		document what the tool I'm referencing does so it
		can be reimplemented by a third party if it's
		missing.
-- 
Peter da Silva                                               `-_-'
Ferranti Intl. Ctls. Corp.                                    'U` 
Sugar Land, TX  77487-5012
+1 713 274 5180                                   Har du kramat din varg idag?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads