Xref: utzoo comp.software-eng:2675 comp.misc:7666 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!dptg!pegasus!psrc From: psrc@pegasus.ATT.COM (Paul S. R. Chisholm) Newsgroups: comp.software-eng,comp.misc Subject: Re: Coding standards (was Re: Programmer productivity) Summary: Turbo Pascal does this; but then again, it *can* Keywords: One function per file? Message-ID: <4313@pegasus.ATT.COM> Date: 13 Dec 89 06:32:15 GMT References: <34796@regenmeister.uucp> <4304@pegasus.ATT.COM> Organization: AT&T Bell Laboratories Lines: 31 In articles <4290@pegasus.ATT.COM> dmt@pegasus.ATT.COM (Dave Tutelman), <9185@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney), <600@fred.UUCP> bill@fred.UUCP (Bill Poitras), and <4304@pegasus.ATT.COM> dmt@pegasus.ATT.COM (Dave Tutelman again) argue about whether their linkers are smart enough to ignore unused names. I'd like to point out that Borland's Turbo Pascal for MS-DOS lets you do something very much like this: "Turbo Pascal 5.0's built-in linker automatically removes unused code and data when building an [executable] file. Procedures, functions, variables, and typed constants that are part of the compilation, but never get referenced, are removed in the [executable] file. The removal of unused code takes place on a per procedure basis, and the removal of unused data takes place on a per declaration section basis." (Source: Turbo Pascal 5.0 Reference Guide, p. 220.) But Borland cheated, sort of. Turbo Pascal doesn't use the .OBJ file format that Intel defined. Instead, each separate compilation is a "unit", more like a library than what a C programmer would think of as an object file. Since Borland defined what a unit looks like, they could set it up to allow for smart linking. (TP 5.0 and 5.5 can also link in ordinary MS-DOS .OBJ files, but I think the implication is that these are just dragged in whole hog.) Since TP 5.5 offers object oriented extensions, this smart linking can come in extremely handy. I'm not sure if Pascal's block structure makes smart linking easier or harder. Paul S. R. Chisholm, AT&T Bell Laboratories att!pegasus!psrc, psrc@pegasus.att.com, AT&T Mail !psrchisholm I'm not speaking for the company, I'm just speaking my mind.