Editing Talk:1270: Functional

Jump to: navigation, search
Ambox notice.png Please sign your posts with ~~~~

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 18: Line 18:
 
::Addendum: I did not dare to edit that yet, as I am unsure if this actually helps anyone not familiar with functional programming (and I don't think this page should include a Haskell crash course just to explain this comic). --[[User:Chtz|Chtz]] ([[User talk:Chtz|talk]]) 10:43, 27 September 2013 (UTC)
 
::Addendum: I did not dare to edit that yet, as I am unsure if this actually helps anyone not familiar with functional programming (and I don't think this page should include a Haskell crash course just to explain this comic). --[[User:Chtz|Chtz]] ([[User talk:Chtz|talk]]) 10:43, 27 September 2013 (UTC)
 
:::I think the pseudo-code examples currently in the explanation are easy enough to understand regardless of which programming languages one works in, but the [I'm assuming] Haskell example here in the comments makes no sense to me. <span style="color:green;">Saibot84</span> 12:51, 27 September 2013 (UTC)
 
:::I think the pseudo-code examples currently in the explanation are easy enough to understand regardless of which programming languages one works in, but the [I'm assuming] Haskell example here in the comments makes no sense to me. <span style="color:green;">Saibot84</span> 12:51, 27 September 2013 (UTC)
::::Even though they are as clear and intuitive as abstract mathematics ... We could write it in a pseudo-functional language like this:
 
  fac2(acc,0):=acc;
 
  fac2(acc,n):=fac2(acc*n,n-1)
 
  fac(n):= fac2(1,n)
 
::::The main point of the functional programming paradigm is not that all functions return values (as currently stated in the explanation) but that functions don't have side-effects and don't have an internal state (i.e. they can have parameters, but they don't have variables). This makes recursion the only way to implement things which are usually implemented using loops in procedural languages. Tail-recursion has the benefit that it can be optimized very easily. --[[User:Chtz|Chtz]] ([[User talk:Chtz|talk]]) 21:18, 28 September 2013 (UTC)
 
  
 
I thought about the text a little and don't the the interpretation "tail recursion is an end unto itself" is correct.  I think what's going on is a pun of the word "reward".  "Tail recursion is it's own reword" makes more sense since you are calling the same function but are "rewording" the arguements.  To reword means to re-express something with different words.  --[[Special:Contributions/24.187.72.209|24.187.72.209]] 11:31, 27 September 2013 (UTC)
 
I thought about the text a little and don't the the interpretation "tail recursion is an end unto itself" is correct.  I think what's going on is a pun of the word "reward".  "Tail recursion is it's own reword" makes more sense since you are calling the same function but are "rewording" the arguements.  To reword means to re-express something with different words.  --[[Special:Contributions/24.187.72.209|24.187.72.209]] 11:31, 27 September 2013 (UTC)

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)

Templates used on this page: