home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!purdue!yuma!csn!news.den.mmc.com!iplmail!steveg
- From: steveg@iplmail.orl.mmc.com (Steve Gabrilowitz)
- Newsgroups: comp.lang.pascal
- Subject: Re: TP units question
- Message-ID: <1992Sep9.152408.842@iplmail.orl.mmc.com>
- Date: 9 Sep 92 15:24:08 GMT
- References: <1992Sep4.141203.28370@news.columbia.edu> <dmurdoch.123.715622406@mast.queensu.ca>
- Sender: steveg@iplmail (Steve Gabrilowitz)
- Organization: Martin Marietta
- Lines: 42
-
- In article <dmurdoch.123.715622406@mast.queensu.ca>, dmurdoch@mast.queensu.ca (Duncan Murdoch) writes:
- |> In article <1992Sep4.141203.28370@news.columbia.edu> stone@cunixb.cc.columbia.edu (Glenn Stone) writes:
- |> >If a procedure/function is only used within the implementation section
- |> >of a unit, it doesn't have to be declared in the interface section,
- |> >but is there any disadvantage to doing so? I'm using TP 5.5.
- |>
- |> There are a few kinds of disadvantages:
- |>
- |> From an efficiency point of view, putting a procedure in the interface
- |> section automatically makes it a "far" procedure; calls to those are
- |> slightly slower and take a few more bytes in your program.
- |>
- |> From a maintenance point of view, putting a procedure in the interface
- |> section means that other code can use it; this ties you down to the
- |> particular way it works. If you decide you want to change it, you'll have
- |> to track down every use of it outside that unit in order to make sure
- |> they're compatible with the new way. Generally programs are easier to
- |> maintain if they're "loosely coupled", i.e. the different units function
- |> almost independently of each other.
-
- Another disadvantage of doing this is that if you make any changes to the
- parameter list in the routine, you have to change it in two places (interface and
- implementation) instead of just one. Also, when you do this then TPC /M will
- have to recompile all the units that use the one with the routine you just
- modified, where if all the changes had been made in the implementation section it
- would not be necessary.
-
- --
-
-
-
- I think
- I think I am
- Therefore I am!
- I think...
-
-
-
- Steve Gabrilowitz
- Martin Marietta, Orlando Fl.
- steve-gabrilowitz@orl.mmc.com
- Fidonet 1:363/1701 (407-380-1701)
-