- なあ、再帰関数好きな人いる? パート2 [転載禁止]©2ch.net
702 :デフォルトの名無しさん[sage]:2015/11/04(水) 11:29:10.25 ID:Am0x1eSa - 再帰否定してる奴は本当にバカなんだな。
> 再帰を使うと頻繁にPCレジスタをPUSHする訳だから普通に安定性落ちるんじゃないの?
| - なあ、再帰関数好きな人いる? パート2 [転載禁止]©2ch.net
708 :デフォルトの名無しさん[sage]:2015/11/04(水) 15:20:54.73 ID:Am0x1eSa - >>707のような80年代の定説を信じ切ってる老害は早く死ねばいいのに。
http://thinkdynamik.blogspot.jp/2014/05/recursion-is-win-iteration-low-level.html Jon Bentley in his 1982 book "Writing Efficient Programs" informs us that | Recursive procedures(that is, procedures that can call themselves) are | powerful expressive tools that can greatly ease the design and implementation | of a correct program. That lesson was made clear to me when I translated a | nineteen-step iterative algorithm that I had written (which resulted in over | 100 lines of code and took two twelve-hour days to debug) into a four-step | recursive algorithm (which took less than 30 lines of code and took less | than an hour to implement). Unfortunately, this expressive power is not | without cost, because many implementations of recursion are slow.
| - なあ、再帰関数好きな人いる? パート2 [転載禁止]©2ch.net
709 :デフォルトの名無しさん[sage]:2015/11/04(水) 15:23:27.54 ID:Am0x1eSa - 同じページにある、こっちが21世紀の常識なんだよ。おじいちゃん。
| In 2008 book "Beautiful Code", a collection of articles, It is Brian | Kernighan saying " recursion is a win. This fundamental programming | technique almost always leads to smaller, cleaner, and more elegant code | than the equivalent written with explicit loops, and that is the case here. | The idea of peeling off one matching character from the front of the regular | expression and from the text, then recursing for the rest, echoes the | recursive structure of the traditional factorial or string length examples, | but in a much more interesting and useful setting."
|
|