Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: David Lamb Newsgroups: comp.lang.java.programmer Subject: Re: Do C++ and Java professionals use UML?? Date: Fri, 27 Jul 2012 17:11:20 -0400 Organization: A noiseless patient Spider Lines: 17 Message-ID: References: <500cbc5d$0$295$14726298@news.sunsite.dk> <3qcr08lkpvcmhe0drpffhegusd6k2a1670@4ax.com> <6sq218p9vfg1m2fgg5pm8sthhdot288mia@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 27 Jul 2012 21:11:21 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="c397b0271b118225329a50c7668d0388"; logging-data="27995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188iw2/AV1KyqDwNQoA6rhb" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: Cancel-Lock: sha1:hGp2Vh0ETP6hk2xdj/KR0k84M2A= Xref: csiph.com comp.lang.java.programmer:16445 On 27/07/2012 7:21 AM, Robert Klemme wrote: > On 07/26/2012 06:16 PM, Gene Wirchenko wrote: >> I have seen this botched in intro classes where recursion is >> introduced. All too often the example used is factorial which is much >> more quickly and clearly solved using iteration. The student gets the >> impression that it is overly complicated and never bothers with it. > > Yeah, but the cases where recursion makes the code simpler are typically > more complex algorithms (backtracking for example). I suspect all > methods which can be converted into a loop via tail recursion > optimization are as simple as factorial. I taught introductory programming for several years in several languages. You don't need to get as complex as backtracking. The natural places to teach recursion to introductory students are with binary tree search and quicksort, both of which can be taught in the first or second 1-semester course.