CSC/ECE 517 Fall 2011/ch1 1c cm: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
<h1>Closures vs Methods</h1>
== Introduction ==


<p>Possible bullet points:</p>
high-level overview, who we are trying to target
<ul>
 
<li>First-class functions</li>
== Closures vs. Methods ==
<li>Functional vs. Object-oriented programming</li>
 
<li>Captured variables (this is a must)</li>
introduction of the battle of functional versus object oriented
<li>Lambda lifting</li>
history of the closures with scheme and future languages
<li>Function objects</li>
history of OO methods with C++ and other languages
<li>free variables</li>
 
</ul>
=== Summary Table ===
 
graphical breakdown of the two and the features we think are important for each
 
== Closures ==
 
closures are associated with functional programming
 
=== First-class functions ===
 
closures are typically first-class functions (define first-class functions)
 
=== Execution-time environment contains free variables ===
 
closures capture variables referenced at the time they are created and the lifetime of those captured variables is extended to at least as long as the lifetime of the closure
 
== Methods ==
 
methods and classes are associated with object-oriented programming
 
=== Instance or static class functions ===
 
methods are functions associated with an object
 
=== Execution-time environment contains instance or static variables ===
 
methods operate on state associated with an object (environment is closed, but defined by the programmer at compile time)
 
== Object-oriented vs. Functional Programming ==
 
=== Benefits of Closures ===
 
=== Benefits of Methods ===
 
== External Links ==

Revision as of 22:30, 2 September 2011

Introduction

high-level overview, who we are trying to target

Closures vs. Methods

introduction of the battle of functional versus object oriented history of the closures with scheme and future languages history of OO methods with C++ and other languages

Summary Table

graphical breakdown of the two and the features we think are important for each

Closures

closures are associated with functional programming

First-class functions

closures are typically first-class functions (define first-class functions)

Execution-time environment contains free variables

closures capture variables referenced at the time they are created and the lifetime of those captured variables is extended to at least as long as the lifetime of the closure

Methods

methods and classes are associated with object-oriented programming

Instance or static class functions

methods are functions associated with an object

Execution-time environment contains instance or static variables

methods operate on state associated with an object (environment is closed, but defined by the programmer at compile time)

Object-oriented vs. Functional Programming

Benefits of Closures

Benefits of Methods

External Links