tag:blogger.com,1999:blog-7211948334062664963.post3553933024121196252..comments2014-12-12T09:39:58.891-05:00Comments on Computational Fairy Tales: Learning IF-ELSE the Hard WayJeremy Kubicahttp://www.blogger.com/profile/02057783753310151192noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-7211948334062664963.post-223494443872940382011-09-26T22:41:10.888-04:002011-09-26T22:41:10.888-04:00Good points. I added a new story with an alternat...Good points. I added a new story with an alternate example of IF-ELSE: <br /><br />The Marvelous IF-ELSE Life of the King's Turtle<br />http://computationaltales.blogspot.com/2011/09/marvelous-if-else-life-of-kings-turtle.htmlJeremy Kubicahttps://www.blogger.com/profile/02057783753310151192noreply@blogger.comtag:blogger.com,1999:blog-7211948334062664963.post-64707041139722679712011-09-23T10:03:31.814-04:002011-09-23T10:03:31.814-04:00"Using an ELSE clause that is the logical com..."Using an ELSE clause that is the logical compliment of the IF clause is a little misleading, since you could have omitted the ELSE clause to achieve the same effect."<br /><br />More precisely, if you use an ELSE clause which amounts to "do nothing", then you could have omitted the ELSE clause to achieve the same effect.<br /><br />Even that is true only in an imperative programming style; in a functional programming style, omitting the ELSE clause means "don't produce any result at all," which is almost never what you want.<br /><br />Anyway, it might be good to augment this story with another one in which the THEN and ELSE clauses both require you to do or specify something. For example, "What shall we have for breakfast? IF it's a weekday, THEN milk and cereal; ELSE pancakes and maple syrup."sblochhttps://www.blogger.com/profile/10894855300223607991noreply@blogger.comtag:blogger.com,1999:blog-7211948334062664963.post-11042268200022856682011-07-17T10:52:53.913-04:002011-07-17T10:52:53.913-04:00Indeed, the chef's training (based on 'alw...Indeed, the chef's training (based on 'always give answers&results' rather than 'just give imperative commands') always uses ELSE, and that training prevents incidents like The Day the Zune Stood Still [ http://www.zuneboards.com/forums/showthread.php?t=38143 ]not-just-yetihttps://www.blogger.com/profile/02344943183054424116noreply@blogger.comtag:blogger.com,1999:blog-7211948334062664963.post-4766727438345023042011-06-02T21:19:44.568-04:002011-06-02T21:19:44.568-04:00That is a very good point. In these cases the ELS...That is a very good point. In these cases the ELSE clause is not actually necessary. However, the chef really did enjoy explaining things that way. I think it was part of his culinary training.Jeremy Kubicahttps://www.blogger.com/profile/02057783753310151192noreply@blogger.comtag:blogger.com,1999:blog-7211948334062664963.post-31244495719858557812011-06-01T19:46:00.461-04:002011-06-01T19:46:00.461-04:00Using an ELSE clause that is the logical complimen...Using an ELSE clause that is the logical compliment of the IF clause is a little misleading, since you could have omitted the ELSE clause to achieve the same effect. The basis for the story is great, though!Paul Komarekhttps://www.blogger.com/profile/02166264759637541669noreply@blogger.com