Talk:Functional programming: Difference between revisions

Content deleted Content added
D language?: found the referenced discussion
Fixing the lede: New section: "Functional versus pure functional in lede"
Line 66:
:::# "Eliminating side effects..." Where do these "side effects" suddenly come from? As an expert I know that having functions depend on mutable state is a from of side effect, but we haven't even introduced mutable side effects yet. Any poor PHP programming is going to be hopelessly lost by now.
:::It would be more effective to improve the previous lede—there certain is much room for improvement there as well—than to continue with this trainwreck: it is even less accessible to layman than the previous lede. —''[[User:Ruud Koot|Ruud]]'' 17:35, 12 August 2013 (UTC)
 
=== Functional versus pure functional in lede ===
 
The first sentence is
<blockquote>In computer science, functional programming is a programming paradigm—a style of building the structure and elements of computer programs—that treats computation as '''the evaluation of mathematical functions and avoids changing-state and mutable data'''.</blockquote>
 
This sounds like "pure functional programming" to me, rather than just "functional". I would say functional programming is a style where you compose functions to get results, as opposed to getting results via a step-by-step process. I would consider the following functional, though not pure functional (or a good idea).
 
def get_five_ints():
return list(map(lambda _: int(input("Enter an integer: ")), range(5)))
 
== Functional programming in non-functional languages ==