<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Csimmon2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Csimmon2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Csimmon2"/>
	<updated>2026-05-23T07:57:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89591</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89591"/>
		<updated>2014-10-14T04:02:22Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. On the other hand, in a prototype-based approach we would just create an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;, without the need for a class file or declaration.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility in object creation and modification, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, your code might not be as structured without centralized classes, and you may be giving up benefits of static typing.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;&amp;lt;ref name=&amp;quot;wald&amp;quot; /&amp;gt;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;wald&amp;quot;&amp;gt;[http://raganwald.com/2013/02/10/prototypes.html Ragan Wald, &amp;quot;Classes vs. Prototypes in JavaScript&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89590</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89590"/>
		<updated>2014-10-14T03:58:53Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. On the other hand, in a prototype-based approach we would just create an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;, without the need for a class file or declaration.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility in object creation and modification, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, your code might not be as structured without centralized classes, and you may be giving up benefits of static typing.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89589</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89589"/>
		<updated>2014-10-14T03:57:22Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just create an object from another ''prototype'' object containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility in object creation and modification, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, your code might not be as structured without centralized classes, and you may be giving up benefits of static typing.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89588</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89588"/>
		<updated>2014-10-14T03:55:30Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility in object creation and modification, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, your code might not be as structured without centralized classes, and you may be giving up benefits of static typing.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89587</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89587"/>
		<updated>2014-10-14T03:54:19Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, your code might not be as structured without centralized classes, and you may be giving up benefits of static typing.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89586</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89586"/>
		<updated>2014-10-14T03:49:56Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89585</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89585"/>
		<updated>2014-10-14T03:48:45Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(Name, Id) {&lt;br /&gt;
    this.id = Id;&lt;br /&gt;
    this.name = name;&lt;br /&gt;
    this.addToCourse = function(course) {&lt;br /&gt;
        console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&lt;br /&gt;
&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Also note that there is nothing special about the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function that makes it a &amp;quot;constructor&amp;quot;. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Perhaps more true to a prototype-based style would be to start with our first object:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var james = {&lt;br /&gt;
    id: 200031416,&lt;br /&gt;
    name: &amp;quot;James Jones&amp;quot;,&lt;br /&gt;
    addToCourse : function(course) {&lt;br /&gt;
       console.log(&amp;quot;Added &amp;quot; + this.name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can then create a copy of this object:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var susan = Object.create(james);&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse(&amp;quot;CSC 505&amp;quot;);              // Added Susan Smith to CSC505!&lt;br /&gt;
james.addToCourse(&amp;quot;CSC 517&amp;quot;);              // Added James Jones to CSC517!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And freely change it without affecting the original:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
susan.semesterCreditLimit = 13;&lt;br /&gt;
console.log(susan.semesterCreditLimit);    // 13&lt;br /&gt;
console.log(james.semesterCreditLimit);    // undefined&lt;br /&gt;
&lt;br /&gt;
susan.addToCourse = &amp;quot;This was supposed to be a function&amp;quot;;&lt;br /&gt;
console.log(susan.addToCourse);            // This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
Although Ruby is a class-based language, its dynamic nature allows some similarity between prototype-based languages&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;. We can take advantage of singleton classes&amp;lt;ref name=&amp;quot;singleton&amp;quot; /&amp;gt; to recreate our previous JavaScript program:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Student&lt;br /&gt;
  attr_accessor :name, :id&lt;br /&gt;
  &lt;br /&gt;
  def initialize(name, id)&lt;br /&gt;
    @name = name&lt;br /&gt;
    @id = id&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  def add_to_course(course)&lt;br /&gt;
    puts &amp;quot;Added &amp;quot; + name + &amp;quot; to &amp;quot; + course + &amp;quot;!&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
james = Student.new &amp;quot;James Jones&amp;quot;, 200031416&lt;br /&gt;
&lt;br /&gt;
susan = james.clone&lt;br /&gt;
susan.name = &amp;quot;Susan Smith&amp;quot;&lt;br /&gt;
&lt;br /&gt;
susan.add_to_course &amp;quot;CSC 505&amp;quot;                 # Added Susan Smith to CSC 505!&lt;br /&gt;
james.add_to_course &amp;quot;CSC 517&amp;quot;                 # Added James Jones to CSC 517!&lt;br /&gt;
&lt;br /&gt;
class &amp;lt;&amp;lt; susan &lt;br /&gt;
  attr_accessor :semester_credit_limit, :add_to_course&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
susan.semester_credit_limit = 13&lt;br /&gt;
james.semester_credit_limit = 13              # NoMethodError&lt;br /&gt;
susan.add_to_course = &amp;quot;This was supposed to be a function&amp;quot;&lt;br /&gt;
puts susan.semester_credit_limit              # 13&lt;br /&gt;
puts susan.add_to_course                      # This was supposed to be a function&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;singleton&amp;quot;&amp;gt;[http://www.devalot.com/articles/2008/09/ruby-singleton Peter Jones, &amp;quot;Understanding Ruby Singleton Classes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89569</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89569"/>
		<updated>2014-10-14T00:28:53Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of objects can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
Examples of class-based languages are Java and C++. The most popular prototype-based language is JavaScript, but some other examples are Io&amp;lt;ref name=&amp;quot;io&amp;quot; /&amp;gt;, REBOL&amp;lt;ref name=&amp;quot;rebol&amp;quot; /&amp;gt; and Self&amp;lt;ref name=&amp;quot;self&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
Although JavaScript is a prototype-based language, its syntax can give the appearance of being class-based, e.g. &amp;lt;pre&amp;gt;var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of a &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Consider our constructor function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(name, id) {&lt;br /&gt;
    this.ID = id;&lt;br /&gt;
    this.Name = name;&lt;br /&gt;
    this.AddToCourse = function(course) {&lt;br /&gt;
        // a function for the object&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that there is nothing special about this function that makes it a &amp;quot;constructor&amp;quot; function. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Functions in JavaScript also have a &amp;lt;tt&amp;gt;prototype&amp;lt;/tt&amp;gt; property, which is just a regular, initially empty object. If we try to access a property that the object does not have, then JavaScript will look to the object's constructor's prototype. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Student.prototype.SemesterCreditLimit = 13;&lt;br /&gt;
console.log(james.SemesterCreditLimit);        // ==&amp;gt; 13&lt;br /&gt;
&lt;br /&gt;
delete Student.prototype.SemesterCreditLimit;&lt;br /&gt;
console.log(james.SemesterCreditLimit);        // ==&amp;gt; undefined&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;io&amp;quot;&amp;gt;[http://iolanguage.org/ Io]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rebol&amp;quot;&amp;gt;[http://www.rebol.com/docs/core23/rebolcore-10.html REBOL - Objects]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;self&amp;quot;&amp;gt;[http://selflanguage.org/ Self]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rubyproto&amp;quot;&amp;gt;[https://practicingruby.com/articles/adventure-in-prototypes Avdi Grimm, &amp;quot;An Adventure in Prototypes&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89370</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89370"/>
		<updated>2014-10-07T02:22:41Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of object can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
JavaScript is perhaps the most popular prototype-based language. Confusingly, its syntax can give the appearance of being class-based, e.g. &amp;lt;pre&amp;gt;var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Consider our constructor function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(name, id) {&lt;br /&gt;
    this.ID = id;&lt;br /&gt;
    this.Name = name;&lt;br /&gt;
    this.AddToCourse = function(course) {&lt;br /&gt;
        // a function for the object&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that there is nothing special about this function that makes it a &amp;quot;constructor&amp;quot; function. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Functions in JavaScript also have a &amp;lt;tt&amp;gt;prototype&amp;lt;/tt&amp;gt; property, which is just a regular, initially empty object. If we try to access a property that the object does not have, then JavaScript will look to the object's constructor's prototype. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Student.prototype.SemesterCreditLimit = 13;&lt;br /&gt;
console.log(james.SemesterCreditLimit);        // ==&amp;gt; 13&lt;br /&gt;
&lt;br /&gt;
delete Student.prototype.SemesterCreditLimit;&lt;br /&gt;
console.log(james.SemesterCreditLimit);        // ==&amp;gt; undefined&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89369</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89369"/>
		<updated>2014-10-07T02:21:15Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of object can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
JavaScript is perhaps the most popular prototype-based language. Confusingly, its syntax can give the appearance of being class-based, e.g. &amp;lt;pre&amp;gt;var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&amp;lt;/pre&amp;gt; However, this does ''not'' create an object of the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Consider our constructor function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(name, id) {&lt;br /&gt;
    this.ID = id;&lt;br /&gt;
    this.Name = name;&lt;br /&gt;
    this.AddToCourse = function(course) {&lt;br /&gt;
        // a function for the object&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that there is nothing special about this function that makes it a &amp;quot;constructor&amp;quot; function. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
Functions in JavaScript also have a &amp;lt;tt&amp;gt;prototype&amp;lt;/tt&amp;gt; property, which is just a regular, initially empty object. If we try to access a property that the object does not have, then JavaScript will look to the object's constructor's prototype. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Student.prototype.SemesterCreditLimit = 13;&lt;br /&gt;
console.log(james.SemesterCreditLimit); // ==&amp;gt; 13&lt;br /&gt;
&lt;br /&gt;
delete Student.prototype.SemesterCreditLimit;&lt;br /&gt;
console.log(james.SemesterCreditLimit); // ==&amp;gt; undefined&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89351</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89351"/>
		<updated>2014-10-07T01:40:35Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of object can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
JavaScript is perhaps the most popular prototype-based language. Confusingly, its syntax can give the appearance of being class-based, e.g. &amp;lt;pre&amp;gt;var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&amp;lt;/pre&amp;gt;. However, this does ''not'' create an object of the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Consider our constructor function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(name, id) {&lt;br /&gt;
    this.ID = id;&lt;br /&gt;
    this.Name = name;&lt;br /&gt;
    this.AddToCourse = function(course) {&lt;br /&gt;
        // ...&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that there is nothing special about this function that makes it a &amp;quot;constructor&amp;quot; function. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object is set to the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function, and then the function runs while treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89349</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89349"/>
		<updated>2014-10-07T01:38:44Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of object can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
JavaScript is perhaps the most popular prototype-based language. Confusingly, its syntax can give the appearance of being class-based, e.g. &amp;lt;pre&amp;gt;var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&amp;lt;/pre&amp;gt;. However, this does ''not'' create an object of the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Consider our constructor function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(name, id) {&lt;br /&gt;
    this.ID = id;&lt;br /&gt;
    this.Name = name;&lt;br /&gt;
    this.AddToCourse = function(course) {&lt;br /&gt;
        // ...&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that there is nothing special about this function that makes it a &amp;quot;constructor&amp;quot; function. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object will be the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function. The function then runs, treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89348</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89348"/>
		<updated>2014-10-07T01:34:14Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of object can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
JavaScript is perhaps the most popular prototype-based language. Confusingly, its syntax can give the appearance of being class-based, e.g. &amp;lt;pre&amp;gt;var james = new Student(&amp;quot;James Jones&amp;quot;, 200031416);&amp;lt;/pre&amp;gt;. However, this does ''not'' create an object of the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; class&amp;lt;ref name=&amp;quot;pivotal&amp;quot; /&amp;gt;. Instead, consider this function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function Student(name, id) {&lt;br /&gt;
    this.ID = id;&lt;br /&gt;
    this.Name = name;&lt;br /&gt;
    this.AddToCourse = function(course) {&lt;br /&gt;
        // ...&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that there is nothing special about this function that makes it a &amp;quot;constructor&amp;quot; function. Instead, we use the &amp;lt;tt&amp;gt;new&amp;lt;/tt&amp;gt; keyword before the function call to signify that a new object is being created. The &amp;lt;tt&amp;gt;james.constructor&amp;lt;/tt&amp;gt; property of our new object will be the &amp;lt;tt&amp;gt;Student&amp;lt;/tt&amp;gt; function. The function then runs, treating &amp;lt;tt&amp;gt;this&amp;lt;/tt&amp;gt; as the new object.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;pivotal&amp;quot;&amp;gt;[http://pivotallabs.com/javascript-constructors-prototypes-and-the-new-keyword/ Pivotal Labs, &amp;quot;JavaScript constructors, prototypes, and the `new` keyword&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89064</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89064"/>
		<updated>2014-10-06T01:04:37Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;. Prototypes offer more flexibility through the ability to add, modify or remove properties from objects at run time, without needing separate classes for each variation. Thus, creating clones or descendants of object can be accomplished with less code. However, you give up the benefits of static typing which might make your code more error prone.&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89060</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89060"/>
		<updated>2014-10-05T20:33:39Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations.&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prototypes in JavaScript ==&lt;br /&gt;
&lt;br /&gt;
== Prototypes in Ruby ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89059</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=89059"/>
		<updated>2014-10-05T20:32:59Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach we would just define a function that creates an object from a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
== Benefits and Drawbacks ==&lt;br /&gt;
Classes and prototypes are commonly seen as not strictly better than the other, but rather just appropriate for different situations.&amp;lt;ref name=&amp;quot;shah&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;se1&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;shah&amp;quot;&amp;gt;[http://aaditmshah.github.io/why-prototypal-inheritance-matters/ Aadit Shah, &amp;quot;Why Prototypal Inheritance Matters&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;se1&amp;quot;&amp;gt;[http://programmers.stackexchange.com/questions/110936/what-are-the-advantages-of-prototype-based-oop-over-class-based-oop Programmers Stack Exchange, &amp;quot;What are the advantages of prototype-based OOP over class-based OOP?&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=88889</id>
		<title>CSC/ECE 517 Fall 2014/ch1b 30 cs</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1b_30_cs&amp;diff=88889"/>
		<updated>2014-10-03T02:36:18Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: Created page with &amp;quot;== Prototype-based Programming == Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prototype-based Programming ==&lt;br /&gt;
Most people are familiar with class-based languages, in which to create an object, one defines a ''class'' containing functions and variables, and then objects are instantiated from the class.&lt;br /&gt;
Prototype-based programming is an alternative approach to creating objects, where instead of a class, they get their properties from other objects&amp;lt;ref name=&amp;quot;moz&amp;quot; /&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As an example, consider creating an object in a class-based approach. We would define a &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt; that contains the variable &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and function &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. Then within the class we would define a constructor, which will create &amp;lt;tt&amp;gt;Object&amp;lt;/tt&amp;gt; which can access &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt; and may have a value assigned to &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt;. Our object is limited to these two properties which we defined in &amp;lt;tt&amp;gt;Class&amp;lt;/tt&amp;gt;, so if we wanted to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; as well, we would need to define a new subclass and create objects from the subclass. On the other hand, in a prototype-based approach, we would just define a constructor for the object, which has a ''prototype'' containing &amp;lt;tt&amp;gt;var1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;func1()&amp;lt;/tt&amp;gt;. The constructor gives us a new object that has the same properties as the prototype. But in this case, if we want to have &amp;lt;tt&amp;gt;Object.var2&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Object.func2()&amp;lt;/tt&amp;gt;, we can simply declare them after object creation because we are not bound by a class definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;moz&amp;quot;&amp;gt;[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model Mozilla Developer Network, &amp;quot;Details of the Object Model&amp;quot;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014&amp;diff=88887</id>
		<title>CSC/ECE 517 Fall 2014</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014&amp;diff=88887"/>
		<updated>2014-09-28T23:49:35Z</updated>

		<summary type="html">&lt;p&gt;Csimmon2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE_517_Fall_2014/sample_page]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 22 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 19 mx]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 3 zq]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 4 lf]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 4 wl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a a7 ch]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 jf]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 8 os]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 8 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 15 gs]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 10 hu]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 20 kv]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 21 as]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 24 sa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 26 sn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 6 rl]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 2 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 16 av]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 1 rm]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 1 sj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 23 ss]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 20 rn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 22 sp]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 26 gn]]&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 13 va]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 9 aa]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 9 kn]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 11 ap]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 25 ks]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/ch1a 7 kz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a_6_bn]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 10 zz]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a 16 va]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a F1415 rv]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1a_3_cp]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b_28_cg]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2014/ch1b 30 cs]]&lt;/div&gt;</summary>
		<author><name>Csimmon2</name></author>
	</entry>
</feed>