Piping in with contrary notions all the way across the board! See my remarks at -->[SJ] in four places, if you like.
On 07/02/12 23:46, Kevin King wrote: > An include is fine for declarations, but not for executable code due to the > fact that individual lines in the include cannot be debugged (on Unidata). > Declarations like EQUates and common blocks are best uses for includes. The need to break apart big routines due to some arbitrary limit (i.e.> 32K) is no longer a valid argument and without the ability to debug included code, any gains quickly become lost. -->[SJ] I disagree with Kevin (not unusual, our technical approaches to developing have always been different!)... for one thing I totally hate file equate declarations. I'm probably in the unpopular crowd on that one, but that's how I feel. Then I believe that debugging, while requiring an extra step, is not that hard and the gains are worth the extra effort. I'll elaborate below... Plus, what happens if you ever want to update that code? If it's INCLUDEd in twenty different files, you need to recompile the lot - that is if you even know what files include it! (And don't say you can search, you're quite likely to miss something). --->[SJ] Disagreeing with Wol, too. This is exactly why I *do* use an include. If you are running the same chunk of code all over the place, I think it is much easier to recompile the 25 programs when you change it, than it is to change it in 25 places! And I can use a search ... or I keep a matrix of what calls and includes what. Since an include would have a unique name, and certainly the string INCLUDE FILENAME INCLUDENAME is very unique, an ESEARCH should be quite reliable. If it's a subroutine, you know one recompile and you've caught all instances. ---> [SJ] Subroutines do have advantages but an include can make a lot of assumptions about where it is... a subroutine either has an immense number of arguments, a fragmented COMMON, or you start over with building up some basic info. Includes are a convenient way to isolate a repeated chunk of code and very easily reuse it without duplicated effort. When it needs to be fixed or updated, it is in one place. -->[SJ] I acknowledge that debugging is harder. So what I do is I have a standard way that I remark out the include and indicate the end of the included section, then I just merge the whole business in until I'm finished debugging. The 'Basic Developer Toolkit' editor (BDT, from rocket software) actually does this automatically. Even doing it manually and acknowledging the inconvenience it is still less maintenance and far less ambiguity to reuse chunks of code this way. _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users