[
next
] [
prev
] [
contents
] [
up to The Top Ten Reasons I Like Ruby
]
Invitation To Ruby
Reason 2 -- Dynamic
Ruby is a very Dynamic Language
Dyanamic Typing
No redundant type specifications
You don't commit to a particular type early in the design
Refactoring is easier
Types are not declared throughout the program
Therefore changing types is easier
Code is more reusable (see
example
)
Testing is easier
It is easier to substitute mock classes.
But isn't Static Typing safer?
The growing use of Test First Design and full unit test coverage mitagate the problems
Classes are Open
Possible to extend existing language elements
For example, adding
reduce
to Enumerable (see
example
)
Runtime interpretation of constructs
Special language features are really methods in the Module class
E.g.
attr_reader
automatically creates attribute
readers
(see
example
)
attr_reader is just a method in Module
Flexible Syntax
Proxy Classes are trivial (see )
Try
this
in a statically typed language!
[
next
] [
prev
] [
contents
] [
up to The Top Ten Reasons I Like Ruby
]
Copyright 2002 by Jim Weirich.
All rights reserved.