Skip to main content

Posts

Showing posts with the label C# and Ruby Classes

C# and Ruby Classes

Ruby is an interpreted object oriented language, as well as having characteristics similar to functional languages.  It's also known as a duck-typing language.  From wikipedia:

In computer programming with object-oriented programming languages, duck typing is a style of dynamic typing in which an object's methods and properties determine the valid semantics, rather than its inheritance from a particular class or implementation of a specific interface. The name of the concept refers to the duck test, attributed to James Whitcomb Riley (see history below), which may be phrased as follows:

When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.

In this article, I'm going to compare and contrast Ruby class definitions with C#.  There are already numerous articles on the subject, for example Brad Cunningham's blog post Ruby for the C# developer - The Basics.  What I'm endeavoring to accomplish here is a much more c…