Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Scripting Language Examples

Python vs. Ruby1

To Ruby From Python
Python vs. Ruby: Comparing Two Top Scripting Languages

Python has list/dict generators

Ruby’s is less pretty, but more functional-style:

Ruby is more functional

Reversing words in a sentence:

Python:

Reversing words in a sentence:

Python has generators

Ruby has a class reference in the class body

In Python you don’t have a reference to the class until after the class construction is finished.

Ruby has blocks2

The output is:

Python has multiple inheritance, Ruby doesn’t

Ruby has Perl-like first-class regular expressions

(But they aren’t exactly the same!)

Python vs. Perl

Log File Parsing

See the Perl Docs for Regular Expressions and the Quote-Like Operators.

JavaScript vs. Dart

From Seth Ladd’s blog: I ported a JavaScript app to Dart. Here’s what I learned.

 

Notes:
1. Unless noted otherwise, the content of this section adapted from this page, and is under cc-by-sa 3.0
2. Example from rubylearning.com