Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #55033

Re: C-Programming

From JohnF <john@please.see.sig.for.email.com>
Newsgroups comp.lang.c
Subject Re: C-Programming
Date 2014-12-19 04:22 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <m70970$709$1@reader1.panix.com> (permalink)
References (2 earlier) <kfnbnn3bw76.fsf@x-alumni2.alumni.caltech.edu> <m6pe1r$v14$1@dont-email.me> <kfnegrz9kyf.fsf@x-alumni2.alumni.caltech.edu> <m6rl24$jsq$1@reader1.panix.com> <kfntx0u6w92.fsf@x-alumni2.alumni.caltech.edu>

Show all headers | View raw


Tim Rentsch <txr@alumni.caltech.edu> wrote:
> JohnF <john@please.see.sig.for.email.com> writes:
>> Tim Rentsch <txr@alumni.caltech.edu> wrote:
>>> <<snip>>
>>> As for recursive implementations in C having no practical
>>> utility, that may be true for factorial, but it certainly is not
>>> true for other uses.  In particular, for Fibonacci numbers, the
>>> fastest implementation in C I have seen used a recursive
>>> definition (ie, the C code was itself recursive). <<snip>>
>>
>> Various algorithms, like generating bezier curves and some
>> fractals, are naturally recursive -- pretty easy to express and
>> code recursively, and will pretty much drive you crazy if you try
>> to think it through and code it iteratively, regardless of
>> language.
> 
> Usually I am wary when someone says some approach is "naturally"
> one thing or another.  Often something seems natural only because
> it's how it was first learned or what someone is used to.  One of
> the greatest scientists of the 20th century, Richard Feynman,
> thought there is value in being familiar with different ways of
> looking at the same picture (or theory, or problem, whatever),
> and to some degree as many different ways as you can.  I am
> inclined to side with this viewpoint.

Sure, beauty/elegance/etc is in the eye/mind of the beholder.
   Physics looks at this kind of thing from a slightly different
perspective (I note you're from cal tech, and so would naturally
cite Feynman; and my ms is in physics, so you know I'm not going
to pass up an opportunity to comment:).
   When programming, you typically have a well-defined objective
you're trying to achieve, so the basic question is the shortest/best
path to it (though "best" can be ill-defined). With physics,
the end-game, so to speak, is itself quite murky (answers just
lead to more questions, etc, and I think most physicists would
cast a somewhat jaundiced eye at the likelihood for any "theory of
everything"), so it can be crucial to consider all possible different
approaches to the same regime of phenomena.
   Physicists can also look at different approaches when trying
to come up with efficient numerical solutions (simulated annealing
pops to mind, for no particular reason, as an elegant approach to
that class of problems), and those cases are pretty much identical
to the point of view of programming cases. But I'd guess the "value"
(your word above) Feynman was referring to arose from an entirely
different perspective.

> That said, certain problems do have a very pretty solution when
> seen from a certain perspective (such as a recursive one), and it
> would be rather foolish to imagine the prettiness has no value.

That's kind of what I meant. If you google these things, the
majority of discussions will cite recursive algorithms as
the more natural/elegant/etc. And I'd bet a survey of programmers
would conclude the same. Most "beholders" of this kind of stuff
are looking at it with similarly-trained "eyes".
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

C-Programming arvindgupta01031988@gmail.com - 2014-12-06 11:09 -0800
  Re: C-Programming "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2014-12-06 11:16 -0800
  Re: C-Programming James Kuyper <jameskuyper@verizon.net> - 2014-12-06 14:46 -0500
    Re: C-Programming Kleuske <kleuske@nowhere.net> - 2014-12-07 10:48 +0000
      Re: C-Programming Keith Thompson <kst-u@mib.org> - 2014-12-07 07:43 -0800
  Re: C-Programming Siri Crews <chine.bleu@yahoo.com> - 2014-12-06 12:22 -0800
    Re: C-Programming gordonb.ukogy@burditt.org (Gordon Burditt) - 2014-12-19 03:29 -0600
      Re: C-Programming Siri Crews <chine.bleu@yahoo.com> - 2014-12-19 01:34 -0800
        Re: C-Programming Richard Heathfield <invalid@see.sig.invalid> - 2014-12-19 10:18 +0000
          Re: C-Programming jacob navia <jacob@spamsink.net> - 2014-12-19 17:42 +0100
            Re: C-Programming rouben@shadow.(none) (Rouben Rostamian) - 2014-12-19 19:00 +0000
              Re: C-Programming jacob navia <jacob@spamsink.net> - 2014-12-19 20:31 +0100
                Re: C-Programming jacob navia <jacob@spamsink.net> - 2014-12-19 20:42 +0100
              Re: C-Programming Keith Thompson <kst-u@mib.org> - 2014-12-19 11:54 -0800
        Re: C-Programming raltbos@xs4all.nl (Richard Bos) - 2014-12-19 11:29 +0000
          Re: C-Programming Noob <root@127.0.0.1> - 2014-12-20 10:22 +0100
            Re: C-Programming Keith Thompson <kst-u@mib.org> - 2014-12-20 11:48 -0800
        Re: C-Programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-19 03:33 -0800
          Re: C-Programming Siri Crews <chine.bleu@yahoo.com> - 2014-12-19 04:02 -0800
      Re: C-Programming glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-19 17:28 +0000
  Re: C-Programming jacob navia <jacob@spamsink.net> - 2014-12-06 21:27 +0100
  Re: C-Programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-07 13:07 +0000
  Re: C-Programming David Brown <david.brown@hesbynett.no> - 2014-12-08 01:24 +0100
    Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-16 04:44 -0800
      Re: C-Programming David Brown <david.brown@hesbynett.no> - 2014-12-16 15:02 +0100
        Re: C-Programming BartC <bc@freeuk.com> - 2014-12-16 18:27 +0000
          Re: C-Programming David Brown <david.brown@hesbynett.no> - 2014-12-17 01:01 +0100
            Re: C-Programming BartC <bc@freeuk.com> - 2014-12-17 00:23 +0000
        Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-16 16:30 -0800
          Re: C-Programming David Brown <david.brown@hesbynett.no> - 2014-12-17 02:18 +0100
            Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-16 18:23 -0800
              Re: C-Programming David Brown <david.brown@hesbynett.no> - 2014-12-17 09:59 +0100
                Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-17 08:52 -0800
                Re: C-Programming David Brown <david.brown@hesbynett.no> - 2014-12-18 11:11 +0100
                Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-18 09:49 -0800
          Re: C-Programming JohnF <john@please.see.sig.for.email.com> - 2014-12-17 10:14 +0000
            Re: C-Programming Richard Heathfield <invalid@see.sig.invalid> - 2014-12-17 14:26 +0000
              Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-17 09:13 -0800
                Re: C-Programming Richard Heathfield <invalid@see.sig.invalid> - 2014-12-17 17:34 +0000
                Re: C-Programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-17 23:26 -0800
                Re: C-Programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-18 00:21 -0800
                Re: C-Programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-18 17:06 +0000
                Re: C-Programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-18 09:29 -0800
                Re: C-Programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-19 02:36 +0000
                Re: C-Programming Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-19 03:41 -0800
                Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-18 08:52 -0800
              Re: C-Programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-17 23:23 +0000
                Re: C-Programming BartC <bc@freeuk.com> - 2014-12-18 00:02 +0000
                Re: C-Programming Richard Heathfield <invalid@see.sig.invalid> - 2014-12-18 00:15 +0000
                Re: C-Programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-18 16:37 +0000
                Re: C-Programming Richard Heathfield <invalid@see.sig.invalid> - 2014-12-18 18:08 +0000
                Re: C-Programming Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-19 02:40 +0000
                Re: C-Programming Richard Heathfield <invalid@see.sig.invalid> - 2014-12-19 07:51 +0000
            Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-17 09:07 -0800
              Re: C-Programming JohnF <john@please.see.sig.for.email.com> - 2014-12-19 04:22 +0000
                Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-19 09:22 -0800
                Re: C-Programming Greg Martin <greg.at.softsprocket@dot.com> - 2014-12-20 02:39 +0000
                Re: C-Programming JohnF <john@please.see.sig.for.email.com> - 2014-12-20 06:57 +0000
  Re: C-Programming Tim Rentsch <txr@alumni.caltech.edu> - 2014-12-15 23:53 -0800

csiph-web