Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c Subject: Re: Should I convert FORTRAN code to C? Message-ID: <436@proxftl.UUCP> Date: 7 Jul 88 16:09:36 GMT References: <2742@utastro.UUCP> <4700015@m.cs.uiuc.edu> Organization: Proximity Technology, Ft. Lauderdale Lines: 21 In article <4700015@m.cs.uiuc.edu>, kenny@m.cs.uiuc.edu writes: > > On the discussion of whether or not `recursion is necessary,' I have > at least a nickel's worth of comment. The example shown is frightful! > [...very long description of recursion elimination] It is the fact that most (but not all) recursion can be eliminated by techniques similar to those he describes that I advocate always giving an "it has to be recursive" routine a thorough examination to see whether that is true or not. However, I rarely write recursive routines, not because I optimize the recursion out, but because my programming habits are such that I almost always think first of iteration. When iteration is possible, it is usually better than recursion. Should that fail, then I write it recursively. Then I try to optimize it out. The only routines that this routinely fails for is data structure traversal routines where backup is necessary.