Path: utzoo!attcan!uunet!portal!cup.portal.com!doug-merritt From: doug-merritt@cup.portal.com Newsgroups: comp.sys.amiga Subject: Re: Speed of linking Message-ID: <5543@cup.portal.com> Date: 17 May 88 18:18:32 GMT References: <8805132300.AA26431@cory.Berkeley.EDU> <28161@cca.CCA.COM> Organization: The Portal System (TM) Lines: 49 XPortal-User-Id: 1.1001.4407 Matt Dillon wrote: >> [...] Another fix would be to change your programming >>habits... 40 modules for only a 130K load module???? Jack Orenstein replied: >I like my habits. Did Picasso listen when they said "too much blue"? Although to some extent this is a matter of personal preference, I can't see suggesting to people that they change to a "monolithic" programming habit. We all know that Modularity Is A Good Thing, right? Consider that in C, the scoping of variables is limited to one of: 1) global, 2) functions, or 3) to files. We also know that global variables are The Root Of All Evil (ok, so I use 'em sometimes...). Let's assume that everyone uses information hiding principles in functions when possible to avoid those Evil Global Variables, so we're in good shape with variables that are local to functions. That leaves function and variable names that must be shared between several functions, but aren't shared universally. The Good True And Right way to treat these in C is to bundle them up into a file, and make all functions and "global" variables in that file static to hide their names from Evil Wrongdoers In Other Modules, and leave just a minimal amount of interface namespace global. In other words, other things being equal, someone with lots of little C files is probably doing a better job of implementing structured programming information hiding principles than someone who has a small number of huge C files (present company excepted, of course :-). We don't know for *sure* that Jack is one of the Good Guys In White, but he's innocent until proven guilty. And you certainly don't want to ask him to put on a black hat! Jack, by all means, *please* stick with your current habits! We could do worse than to create a new (or several new) libraries for each of our large projects. Matt, I'm only criticizing your suggestion to Jack, not your actual programming style...From some of your designs I remember seeing, it's clear that you're a good programmer. And your software's functionality is marvelous anyway; I just figure someone's gotta throw in the obligatory comments about modern programming methodologies. Creating large modules is a sin that some of us (like me) commit sometimes, but we shouldn't advocate it. Doug --- Doug Merritt ucbvax!sun.com!cup.portal.com!doug-merritt or ucbvax!eris!doug (doug@eris.berkeley.edu) or ucbvax!unisoft!certes!doug