<?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=Student%40ncsu</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=Student%40ncsu"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Student@ncsu"/>
	<updated>2026-10-04T06:16:52Z</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_2009/wiki1a_11_AS&amp;diff=19563</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19563"/>
		<updated>2009-09-17T00:36:10Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic,interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.It combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an object-oriented scripting language with dynamic semantics.Its design mixes software engineering features of traditional languages with the usability of scripting languages.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects.&lt;br /&gt;
&lt;br /&gt;
Ruby:String and numbers as objects&lt;br /&gt;
 if x.between?(7,12) do ... &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
Ruby Blocks:&lt;br /&gt;
  def aliens&lt;br /&gt;
 if block_given?&lt;br /&gt;
   i = 1&lt;br /&gt;
   j = 2&lt;br /&gt;
   yield(i, j)&lt;br /&gt;
  else puts “magick”&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 aliens { |x, y| puts x }&lt;br /&gt;
 aliens&lt;br /&gt;
&lt;br /&gt;
In this case if the block is provided to the method, it executes the if statement, otherwise it executes the else statement&lt;br /&gt;
&lt;br /&gt;
Python Control statements:&lt;br /&gt;
 # Continue&lt;br /&gt;
 nlist = []&lt;br /&gt;
 for i in xrange(0,100):&lt;br /&gt;
     if i == 0:&lt;br /&gt;
         continue&lt;br /&gt;
     nlist.append( 7 / i )&lt;br /&gt;
&lt;br /&gt;
 # Break&lt;br /&gt;
 # How many heads can we flip in a row?&lt;br /&gt;
 heads = 0&lt;br /&gt;
 while 1:&lt;br /&gt;
     if x = 0:&lt;br /&gt;
         break&lt;br /&gt;
     else:&lt;br /&gt;
         x = random.rand(0,1)&lt;br /&gt;
         heads += 1&lt;br /&gt;
&lt;br /&gt;
 # Pass&lt;br /&gt;
 # If you don't want to do anything in a case&lt;br /&gt;
 x = 0&lt;br /&gt;
 while 1:&lt;br /&gt;
     if x &amp;lt;= 100:&lt;br /&gt;
         pass&lt;br /&gt;
     elif x = 101:&lt;br /&gt;
         print &amp;quot;Just enough Dalmations!&amp;quot;&lt;br /&gt;
     else:&lt;br /&gt;
         print &amp;quot;Argh!  Too many Dalmations!&amp;quot;&lt;br /&gt;
         break&lt;br /&gt;
     x += 1&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
Ruby code snippet without attributes:&lt;br /&gt;
 &lt;br /&gt;
  class Person&lt;br /&gt;
  def fname&lt;br /&gt;
    @fname&lt;br /&gt;
  end&lt;br /&gt;
  def fname=(fname)&lt;br /&gt;
    @fname = fname&lt;br /&gt;
  end&lt;br /&gt;
  def lname&lt;br /&gt;
    @lname&lt;br /&gt;
  end&lt;br /&gt;
  def lname=(lname)&lt;br /&gt;
    @lname = lname&lt;br /&gt;
  end&lt;br /&gt;
  end&lt;br /&gt;
Ruby code snippet with attributes:&lt;br /&gt;
&lt;br /&gt;
 class Person&lt;br /&gt;
  attr_accessor :fname, :lname&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
Ruby Method:&lt;br /&gt;
 class Boogy&lt;br /&gt;
 def initialize&lt;br /&gt;
 @dix = 15&lt;br /&gt;
 end&lt;br /&gt;
 def arbo&lt;br /&gt;
 puts &amp;quot;#{@dix} ha\n&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 b = Boogy.new # initializes an instance of Boogy&lt;br /&gt;
 b.arbo # prints &amp;quot;15 ha&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python Lambda:&lt;br /&gt;
 def make_incrementor (n): return lambda x: x + n&lt;br /&gt;
 f = make_incrementor(2)&lt;br /&gt;
 g = make_incrementor(6)&lt;br /&gt;
 print f(42), g(42)&lt;br /&gt;
&lt;br /&gt;
gives output &lt;br /&gt;
44 48&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
Example of a python library : &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   def all(iterable):&lt;br /&gt;
    for element in iterable:&lt;br /&gt;
        if not element:&lt;br /&gt;
            return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
Indented piece of Python code:&lt;br /&gt;
 def perm(l):&lt;br /&gt;
         # Compute the list of all permutations of l&lt;br /&gt;
     if len(l) &amp;lt;= 1:&lt;br /&gt;
                   return [l]&lt;br /&gt;
     r = []&lt;br /&gt;
     for i in range(len(l)):&lt;br /&gt;
              s = l[:i] + l[i+1:]&lt;br /&gt;
              p = perm(s)&lt;br /&gt;
              for x in p:&lt;br /&gt;
               r.append(l[i:i+1] + x)&lt;br /&gt;
     return r&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[8] &amp;quot;Turbogears&amp;quot; http://en.wikipedia.org/wiki/TurboGears &amp;lt;br&amp;gt;&lt;br /&gt;
[9] &amp;quot;Django&amp;quot; http://en.wikipedia.org/wiki/Django_%28web_framework%29 &amp;lt;br&amp;gt;&lt;br /&gt;
[10] &amp;quot;Python&amp;quot; http://www.penzilla.net/tutorials/python/control/ &amp;lt;br&amp;gt;&lt;br /&gt;
[11] &amp;quot;Book on Ruby procs,Methods,Blocks&amp;quot; http://www.scribd.com/doc/2027524/Ruby-Blocks-Procs-And-Methods?autodown=pdf &amp;lt;br&amp;gt;&lt;br /&gt;
[12] &amp;quot;Ruby Tutorial&amp;quot; http://www.fincher.org/tips/Languages/Ruby/&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19401</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19401"/>
		<updated>2009-09-16T21:24:25Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic,interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.It combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an object-oriented scripting language with dynamic semantics.Its design mixes software engineering features of traditional languages with the usability of scripting languages.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
Example of a python library : &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   def all(iterable):&lt;br /&gt;
    for element in iterable:&lt;br /&gt;
        if not element:&lt;br /&gt;
            return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[8] &amp;quot;Turbogears&amp;quot; http://en.wikipedia.org/wiki/TurboGears &amp;lt;br&amp;gt;&lt;br /&gt;
[9] &amp;quot;Django&amp;quot; http://en.wikipedia.org/wiki/Django_%28web_framework%29 &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19398</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19398"/>
		<updated>2009-09-16T21:16:27Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic,interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.It combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
Example of a python library &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   def all(iterable):&lt;br /&gt;
    for element in iterable:&lt;br /&gt;
        if not element:&lt;br /&gt;
            return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[8] &amp;quot;Turbogears&amp;quot; http://en.wikipedia.org/wiki/TurboGears &amp;lt;br&amp;gt;&lt;br /&gt;
[9] &amp;quot;Django&amp;quot; http://en.wikipedia.org/wiki/Django_%28web_framework%29 &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19397</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19397"/>
		<updated>2009-09-16T21:15:25Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic,interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.It combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
Example of a python library &amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
   def all(iterable):&lt;br /&gt;
    for element in iterable:&lt;br /&gt;
        if not element:&lt;br /&gt;
            return False&lt;br /&gt;
    return True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[8] &amp;quot;Turbogears&amp;quot; http://en.wikipedia.org/wiki/TurboGears &amp;lt;br&amp;gt;&lt;br /&gt;
[9] &amp;quot;Django&amp;quot; http://en.wikipedia.org/wiki/Django_%28web_framework%29 &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19393</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19393"/>
		<updated>2009-09-16T20:28:30Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[8] &amp;quot;Turbogears&amp;quot; http://en.wikipedia.org/wiki/TurboGears &amp;lt;br&amp;gt;&lt;br /&gt;
[9] &amp;quot;Django&amp;quot; http://en.wikipedia.org/wiki/Django_%28web_framework%29 &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19392</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19392"/>
		<updated>2009-09-16T20:28:02Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;br /&gt;
[8] &amp;quot;Turbogears&amp;quot; http://en.wikipedia.org/wiki/TurboGears&lt;br /&gt;
[9] &amp;quot;Django&amp;quot; http://en.wikipedia.org/wiki/Django_%28web_framework%29&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19391</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19391"/>
		<updated>2009-09-16T20:26:53Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Comparison of Ruby and Python based on their Application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19390</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19390"/>
		<updated>2009-09-16T20:26:27Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;20&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19389</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19389"/>
		<updated>2009-09-16T20:26:08Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Comparison of Ruby and Python based on their Application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;20&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19388</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19388"/>
		<updated>2009-09-16T20:25:49Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;50&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|Python has many frameworks and the notable two among them are: Django and TurboGears.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|Django was created by Lawrence Journal-World and was first released during July 2005. Turbogears was developed by Kevin Dangoor and Mark Ramm and its stable version was released during August of 2009 .&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
| Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19382</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19382"/>
		<updated>2009-09-16T20:19:22Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Comparison of Ruby and Python based on their Application  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;50&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ruby on Rails is an open source web framework and Rails was created by David Heinemeier Hansson in 2003.&lt;br /&gt;
|text for row 2, column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19381</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19381"/>
		<updated>2009-09-16T20:07:37Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;50&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Applications better suited for Ruby&lt;br /&gt;
!Applications better suited for Python&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 1, column 1&lt;br /&gt;
|text for row 1, column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 2, column 1&lt;br /&gt;
|text for row 2, column 2&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19380</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19380"/>
		<updated>2009-09-16T20:06:15Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;50&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Heading for column 1&lt;br /&gt;
!Heading for column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 1, column 1&lt;br /&gt;
|text for row 1, column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 2, column 1&lt;br /&gt;
|text for row 2, column 2&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19379</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19379"/>
		<updated>2009-09-16T20:05:37Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;5&amp;quot; cellpadding=&amp;quot;200&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Heading for column 1&lt;br /&gt;
!Heading for column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 1, column 1&lt;br /&gt;
|text for row 1, column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 2, column 1&lt;br /&gt;
|text for row 2, column 2&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19378</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19378"/>
		<updated>2009-09-16T20:05:10Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;20&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Heading for column 1&lt;br /&gt;
!Heading for column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 1, column 1&lt;br /&gt;
|text for row 1, column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 2, column 1&lt;br /&gt;
|text for row 2, column 2&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19377</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19377"/>
		<updated>2009-09-16T20:04:00Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
=  &amp;lt;center&amp;gt; '''Ruby vs Python'''  &amp;lt;/center&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/].&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Heading for column 1&lt;br /&gt;
!Heading for column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 1, column 1&lt;br /&gt;
|text for row 1, column 2&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|text for row 2, column 1&lt;br /&gt;
|text for row 2, column 2&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;br /&gt;
[6] &amp;quot;Python vs Ruby &amp;quot; http://regebro.wordpress.com/2009/07/12/python-vs-ruby/ &amp;lt;br&amp;gt;&lt;br /&gt;
[7] &amp;quot;Python vs Ruby&amp;quot; http://wiki.python.org/moin/PythonVsRuby&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19048</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19048"/>
		<updated>2009-09-11T17:01:24Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
[1] &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby &amp;lt;br&amp;gt;&lt;br /&gt;
[2] &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480 &amp;lt;br&amp;gt;&lt;br /&gt;
[3] &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[4] &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language) &amp;lt;br&amp;gt;&lt;br /&gt;
[5] &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html &amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19047</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=19047"/>
		<updated>2009-09-11T16:58:35Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1. &amp;quot;Ruby v/s Python&amp;quot; http://www.c2.com/cgi/wiki?PythonVsRuby&lt;br /&gt;
2. &amp;quot;Lambda the ultimate&amp;quot; http://lambda-the-ultimate.org/node/1480&lt;br /&gt;
3. &amp;quot;Ruby&amp;quot; http://en.wikipedia.org/wiki/Ruby_(programming_language)&lt;br /&gt;
4. &amp;quot;Python&amp;quot; http://en.wikipedia.org/wiki/Python_(programming_language)&lt;br /&gt;
5. &amp;quot;Ruby, Python, Power&amp;quot; http://blog.ianbicking.org/ruby-python-power.html&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18772</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18772"/>
		<updated>2009-09-08T19:52:53Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
4.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
5.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable advantage is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other advantage is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
7.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18332</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18332"/>
		<updated>2009-09-07T23:11:04Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in Programming Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python run on almost all the user friendly platforms like Windows9x/2000/NT, Unix, Mac-OS, MS-DOS. The difference in their programming environments is very subtle.&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- the YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18319</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18319"/>
		<updated>2009-09-07T23:03:45Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose name is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18295</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18295"/>
		<updated>2009-09-07T22:31:27Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to do so.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18219</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18219"/>
		<updated>2009-09-07T20:18:28Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet for computing the largest of two numbers using python lambdas&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet for computing the square of each number in the array  using ruby blocks&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18217</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18217"/>
		<updated>2009-09-07T20:17:52Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
code snippet using python lambda for computing the largest of two numbers&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
code snippet using ruby blocks for computing the square of each number in the array&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18216</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18216"/>
		<updated>2009-09-07T20:17:32Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
   code snippet using python lambda for computing the largest of two numbers&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   code snippet using ruby blocks for computing the square of each number in the array&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18215</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18215"/>
		<updated>2009-09-07T20:17:20Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
   code snippet using python lambda for computing the largest of two numbers&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
   code snippet using ruby blocks for computing the square of each number in the array&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18214</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18214"/>
		<updated>2009-09-07T20:17:06Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
   code snippet using python lambda for computing the largest of two numbers&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
   code snippet using ruby blocks for computing the square of each number in the array&lt;br /&gt;
   array = [1, 2, 3, 4]&lt;br /&gt;
   array.iterate! do |n|&lt;br /&gt;
   n ** 2&lt;br /&gt;
   end&lt;br /&gt;
   puts array.inspect&lt;br /&gt;
   # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18212</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18212"/>
		<updated>2009-09-07T20:16:43Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
   code snippet using python lambda for computing the largest of two numbers&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
 &lt;br /&gt;
  code snippet using ruby blocks for computing the square of each number in the array&lt;br /&gt;
  array = [1, 2, 3, 4]&lt;br /&gt;
  array.iterate! do |n|&lt;br /&gt;
  n ** 2&lt;br /&gt;
  end&lt;br /&gt;
  puts array.inspect&lt;br /&gt;
  # =&amp;gt; [1, 4, 9, 16]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18211</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18211"/>
		<updated>2009-09-07T20:09:58Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
   code snippet of python lambda for computing the largest of two numbers&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;bigger = lambda a, b : a &amp;gt; b&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(1,2)&lt;br /&gt;
   False&lt;br /&gt;
   &amp;gt;&amp;gt;&amp;gt;print bigger(2,1)&lt;br /&gt;
   True&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18178</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=18178"/>
		<updated>2009-09-07T19:37:16Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in their language features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
It is an interpreted language that includes a powerful set of libraries. While it is often referred to as a scripting language, it is a pure objected-oriented language that has sufficient expressiveness for general-purpose applications.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
1.The first thing to be noted in Ruby is that,everything is an object, whereas in Python we have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
2.In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python we are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
3.Ruby treats variable names that has the first letter in capitals like a constant, so we can’t modify it.&lt;br /&gt;
&lt;br /&gt;
4.Ruby protects class attributes.We can’t access attributes of objects from outside the class.&lt;br /&gt;
Python doesn’t protect our code from other programmers. If they want to shoot themselves in the foot they are allowed to.&lt;br /&gt;
&lt;br /&gt;
5.In Ruby, there are no functions, but there are methods, blocks and lambdas. All of them seem to have subtle differences, and sometimes we need to not just call them, but use .call().&lt;br /&gt;
In Python, there are only functions. Lambdas are functions whose __name__ is &amp;lt;lambda&amp;gt;. Methods are functions that are wrapped, we don’t have to pass self.&lt;br /&gt;
&lt;br /&gt;
6.The one line nameless mini-functions that can be created in Python are called Lambdas where as its Ruby counterpart is called as Blocks. Not only the name is different but also Blocks have some terrific advantage over lambdas. One of the most notable differences is that Ruby blocks are more powerful, in that the interaction between the blocks and its contents is quite easy where as its almost impossible for the interaction between lambdas and its contents in Python. The other difference is that Ruby blocks have access to the variables in the scope in which they were defined. This allows blocks to be used in a more expressive manner.&lt;br /&gt;
&lt;br /&gt;
//ruby blocks and python lambdas examples&lt;br /&gt;
&lt;br /&gt;
7.Python has a much greater range of libraries available to it, and most of those libraries are more mature and better documented than their Ruby counterparts.&lt;br /&gt;
&lt;br /&gt;
8.As far as readability is concerned, Python is considered to be easily readable whereas Ruby’s code is considered to be on the downside for readability.&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. &lt;br /&gt;
Continuation is an abstract representation of the control state, of the things to come. Practically continuation support in a language means we can “save” our state at a point and return to it later. This is called a first-class continuation.&lt;br /&gt;
&lt;br /&gt;
In ruby, the callcc method is used (it’s Kernel#callcc) to create a Continuation class. Look at this small sample:&lt;br /&gt;
&lt;br /&gt;
 def loop&lt;br /&gt;
   cont=nil&lt;br /&gt;
   for i in 1..4&lt;br /&gt;
     puts i&lt;br /&gt;
     callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
   end&lt;br /&gt;
   return cont&lt;br /&gt;
 end&lt;br /&gt;
 c = loop&lt;br /&gt;
 c.call&lt;br /&gt;
&lt;br /&gt;
In irb this will print 1,2,3,4 then 3,4 again, then exit. As a script file run by the main ruby interpreter, this will loop forerver as it captures the control state of the program when and where it was called and this includes returning the continuation and then calling it again.&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1.It’s worth mentioning that Python has some big features like list comprehensions that Ruby doesn’t.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
&lt;br /&gt;
2.Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. We declare the type of each variable, and then, during compilation, we get an error message if we use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: We don't declare types for variables or functions, and no type-check occurs until runtime, when we get an error if we call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
3.Ruby's dynamic typing means you don't repeat yourself: In Java have we had to suffer through verbose code along the lines of &lt;br /&gt;
 &lt;br /&gt;
  XMLPersistence xmlPersistence = (XMLPersistence)persistenceManager.getPersistence(); &lt;br /&gt;
Ruby eliminates the need for the type declaration and casting (as well as parentheses and semicolon): a typical Ruby equivalent would be&lt;br /&gt;
  xmlPersistence = persistence_manager.persistence.&lt;br /&gt;
&lt;br /&gt;
4.In Java, we often iterate over a collection's Iterator, running the logic on each element. But the iteration is just an implementation detail: in general, we are just trying to apply the same logic to each element of a collection.&lt;br /&gt;
In Ruby, we pass a code block to a method that does just that, iterating behind the scenes. &lt;br /&gt;
For example,&lt;br /&gt;
  [1, 2, 3, 4, 5].each{|n| print n*n, &amp;quot; &amp;quot;} &lt;br /&gt;
prints the string 1 4 9 16 25; an iterator takes each element of the list and passes it into the code block as the variable n.&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17896</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17896"/>
		<updated>2009-09-07T00:36:20Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in Programming Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17895</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17895"/>
		<updated>2009-09-07T00:35:50Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Differences in Programming Environment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
&lt;br /&gt;
Python has a Virtual Machine which optimizes certain functions like hash functions and sorting algorithms. &lt;br /&gt;
&lt;br /&gt;
Ruby as such it does not have any virtual machine but it acts as an interpreter. There is a project going on for building a virtual machine for Ruby- YARV [http://www.atdot.net/yarv/]&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
1.Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
'''Duck Typing'''&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.In Ruby, variables do not need to be declared and are free to change type from statement to statement. So the following code, where the variable x changes from a FixNum (an integer that fits within a native machine word) to a String to an Array, is a perfectly legal sequence of Ruby code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x = 10&lt;br /&gt;
 x += 4&lt;br /&gt;
 x = &amp;quot;My String&amp;quot;&lt;br /&gt;
 x = [1, &amp;quot;My String&amp;quot;, Hash.new ]&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17879</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17879"/>
		<updated>2009-09-06T23:53:54Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Listing 1.Duck Typing&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
The most prominent application of Ruby is in web development using Ruby on Rails.&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17873</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17873"/>
		<updated>2009-09-06T23:46:42Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Listing 1.Duck Typing&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Python has two web development frameworks: Django and TurboGears. Apart from web development, Python also provides platform for applications like Database Access, Desktop Graphical User Interface(GUI) development, Software development, Game and 3D graphics development.&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17868</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17868"/>
		<updated>2009-09-06T23:37:56Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Listing 1.Duck Typing&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like twitter [http://www.twitter.com] e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17864</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17864"/>
		<updated>2009-09-06T23:29:42Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Listing 1.Duck Typing&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like e-commerce[http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17863</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17863"/>
		<updated>2009-09-06T23:29:16Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Ruby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
Java has static typing. You declare the type of each variable, and then, during compilation, you get an error message if you use a variable of the wrong type. Ruby, on the other hand, has dynamic typing: You don't declare types for variables or functions, and no type-check occurs until runtime, when you get an error if you call a method that doesn't exist. Even then, Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing: &amp;quot;If it walks like a duck and quacks like a duck, it's a duck.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
Listing 1.Duck Typing&lt;br /&gt;
&lt;br /&gt;
 class ADuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack A&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 class BDuck&lt;br /&gt;
     def quack()&lt;br /&gt;
         puts &amp;quot;quack B&amp;quot;;&lt;br /&gt;
     end&lt;br /&gt;
 end&lt;br /&gt;
 # quack_it doesn't care about the type of the argument duck, as long&lt;br /&gt;
 # as it has a method called quack. Classes A and B have no&lt;br /&gt;
 # inheritance relationship.&lt;br /&gt;
 def quack_it(duck)&lt;br /&gt;
     duck.quack&lt;br /&gt;
 end&lt;br /&gt;
 a = ADuck.new&lt;br /&gt;
 b = BDuck.new&lt;br /&gt;
 quack_it(a)&lt;br /&gt;
 quack_it(b)&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
Ruby on Rails is an open source web framework. Rails was created by David Heinemeier Hansson in 2003. Since then many applications have been created using Ruby on Rails and presently this has been used in various applications like e-commerce[ http://www.shopify.com/], live video streaming [http://www.hulu.com/], group chat application [http://campfirenow.com/?source=rails].&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17859</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17859"/>
		<updated>2009-09-06T23:18:52Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the &amp;quot;Zone Application server&amp;quot; [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17856</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17856"/>
		<updated>2009-09-06T23:16:51Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the Zone Application server [http://c2.com/cgi/wiki?ZopeApplicationServer].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17854</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17854"/>
		<updated>2009-09-06T23:16:13Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the [http://c2.com/cgi/wiki?ZopeApplicationServer] Zone Application server.&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17853</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17853"/>
		<updated>2009-09-06T23:15:14Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* Projects better suited for Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One of the best examples of open source Python language is the [&amp;quot;Zone Application Server&amp;quot;].&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17426</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17426"/>
		<updated>2009-09-05T01:10:09Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* What Python has and Ruby does not have? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
1. It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
   foo.append(x)&lt;br /&gt;
2.&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17423</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17423"/>
		<updated>2009-09-05T01:02:41Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* What Python has and Ruby does not have? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
  [foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
      foo.append(x)&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17422</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17422"/>
		<updated>2009-09-05T01:02:01Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* What Python has and Ruby does not have? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
[foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   foo = [] &lt;br /&gt;
   for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
      foo.append(x)&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17421</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17421"/>
		<updated>2009-09-05T01:01:15Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* What Python has and Ruby does not have? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
[foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  foo = [] for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
      foo.append(x)&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17420</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17420"/>
		<updated>2009-09-05T01:01:01Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* What Python has and Ruby does not have? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
[foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
if&lt;br /&gt;
foo = [] for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
      foo.append(x)&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17419</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17419"/>
		<updated>2009-09-05T01:00:42Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: /* What Python has and Ruby does not have? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;                                          &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==  &amp;lt;center&amp;gt; '''Ruby vs Python''' &amp;lt;/center&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
== Definition of Ruby and Python ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Ruby''' is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features.&lt;br /&gt;
&lt;br /&gt;
'''Python''' is an interpreted, object-oriented, high-level programming language with dynamic semantics.&lt;br /&gt;
&lt;br /&gt;
== Differences in their language features ==&lt;br /&gt;
The first thing to be noted in Ruby is that in Ruby everything is an object, whereas in Python you have the liberty to code without using objects. &lt;br /&gt;
&lt;br /&gt;
// include example here&lt;br /&gt;
&lt;br /&gt;
In ruby, the programmer can use blocks to extend the language for application specific control statements where as in Python you are supposed to use only the control statements provided by the language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences in Programming Environment ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What Ruby has and Python does not have? ==&lt;br /&gt;
Ruby has continuations, where as Python does not have it. One notable use of continuations in Ruby is for breakpoints in debuggers. However you can fake continuations in Python, and it seems that many of the use cases can instead be done with passing variables into .next() which you can do in Python 3.1. Hence, the use of continuations seems rather limited, and hard to understand, but it’s there in Ruby, and not in Python. So this is another plus for Ruby.   &lt;br /&gt;
&lt;br /&gt;
//examples must be included&lt;br /&gt;
&lt;br /&gt;
== What Python has and Ruby does not have? ==&lt;br /&gt;
&lt;br /&gt;
It’s worth mentioning here that Python has some big features that Ruby doesn’t, like for example list comprehensions.&lt;br /&gt;
&lt;br /&gt;
[foo(x) for x in alist if bar(x) != 'frotz']&lt;br /&gt;
&lt;br /&gt;
This is definitely shorter than:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
foo = []for x in alist:&lt;br /&gt;
   if bar(x) != 'frotz':&lt;br /&gt;
      foo.append(x)&lt;br /&gt;
&lt;br /&gt;
== Advantages over statically typed languages ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Ruby  ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projects better suited for Python ==&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17365</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17365"/>
		<updated>2009-09-04T23:34:46Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Contents&lt;br /&gt;
&lt;br /&gt;
1.Ruby v/s Python&lt;br /&gt;
1.1 Differences]]&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17363</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17363"/>
		<updated>2009-09-04T23:33:11Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;     [['''Contents''']]&lt;br /&gt;
[[1.Ruby v/s Python&lt;br /&gt;
  1.1 Differences between Ruby and Python&lt;br /&gt;
]]&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17362</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 AS</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_AS&amp;diff=17362"/>
		<updated>2009-09-04T23:32:49Z</updated>

		<summary type="html">&lt;p&gt;Student@ncsu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;     [['''Contents''']]&lt;br /&gt;
== Headline text ==&lt;br /&gt;
&lt;br /&gt;
1.Ruby v/s Python&lt;br /&gt;
  1.1 Differences between Ruby and Python&lt;/div&gt;</summary>
		<author><name>Student@ncsu</name></author>
	</entry>
</feed>