Subject: How to define "modular" code?

From: Shlomi Fish <[email-masked]>
Date: Fri, 19 Apr 2002 16:39:21 +0300 (IDT)

Most experienced hackers can enumerate the principles of OOP or FP or
Patterns P. However, I found modularity to be much harder to define.
According to OmerZ, it is the most important paradigm, but some
beginning hackers cannot understand what it is. (and Googlizing for it
turns out zilch)

What are the concepts behind modular design? Things of top of my head:

1. Make sure that there is no duplicate code (or only such in appropriate
places)

2. Make sure everything appropriate is instantizable.

3. Make sure each object (not necessarily inherited) or function has a
well-defined interface with few if any side effects on the
external environment.

4. Avoiding Kludges that add extra features or solve a particular problem.
Sub-cases should be generalized to keep the code modular.

5. Trying to keep functions non-monolithic and to split them into several
logical routines.

What else can you think of?

Regards,

	Shlomi Fish

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

"Let's suppose you have a table with 2^n cups..."
"Wait a second - is n a natural number?"