From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d694b5818a5102b1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-23 01:26:18 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!uunet!ois!beckwb From: beckwb@ois.com (R. William Beckwith) Subject: Re: Naive question about system dependencies Message-ID: Organization: Objective Interface Systems, Inc. X-Newsreader: TIN version 1.2 PL2 References: <35f559$mad@info.epfl.ch> <85B716C4188@annwfn.com> <35s3hi$67p@gnat.cs.nyu.edu> Date: Fri, 23 Sep 1994 04:34:54 GMT Date: 1994-09-23T04:34:54+00:00 List-Id: Robert Dewar (dewar@cs.nyu.edu) wrote: : The whole idea in using separate bodies should be to completely avoid : code duplication. Only the code that is system dependent, and hence : NOT duplicated, i.e. the code that would go inside the range of an : ifdef, should be in separate bodies, code outside the ifdef can be : shared. snip I couldn't agree more. When we first starting designing Screen Machine (portable GUI/CUI product) many years ago, I missed the occassional #ifdef. Instead of using cpp we decided to architect the code in such a way that we could plug in the appropriate platform/compiler specific code. It has worked out very nicely. Instead of the incredibly long, complex preprocessed source files you end up creating over the years, we ended up with an architecture that allows us to make structural changes to our code without the typically worries of breaking an ifdef (rats) nest. We now maintain 153 binary products with _one_ (real busy) porting engineer. The current source directory heirarchy for the library component of Screen Machine speaks for itself: sm sm/char sm/char/dos sm/char/dos/a16 sm/char/dos/a32 sm/char/dos/m16 sm/char/dos/m32 sm/char/unix sm/char/vax sm/gui sm/gui/Xm/unix sm/gui/Xm/vms sm/gui/Xm/r1000 sm/gui/Xm/net sm/gui/win16 sm/gui/win32 compiler compiler/Alsys16 compiler/Alsys32 compiler/Apex compiler/DECAda compiler/IBMAda compiler/Merid16 compiler/Merid32 compiler/OCSLegacyAda compiler/Rational compiler/SunAda compiler/Teles16 compiler/Teles32 compiler/Verdix compiler/VMSAda platform platform/dgux_88k platform/aux_68k platform/hpux_pa platform/isc_intel platform/lynx_intel platform/dos_intel platform/osf1_alpha platform/delta_r1000 platform/aix_power platform/sco_intel platform/irix_mips platform/solaris2_intel_ platform/solaris2_sparc platform/solaris1_sparc platform/ultrix_mips platform/ultrix_vax platform/win31_intel platform/winnt_alpha_ platform/winnt_intel platform/winnt_mips_ platform/vms_alpha platform/vms_vax ... Bill -- e-mail: Bill.Beckwith@ois.com | Team Ada Objective Interface Systems, Inc. | dist, full O-O 1895 Preston White Drive, Suite 250 | multithreading Reston, VA 22091-5448 U.S.A. | built in