Features That Ruby Lacks and Java Has
Bertrand Meyer describes in his book " Object Oriented Software Construction (2nd Ed)" qualities that a good object oriented language should have. Java has almost all the features. Ruby is much farther off, which does not mean it is not a good language, I think it's very good to write some types of programs quickly (should I call them scripts?), syntax is quite nice, but it does lack the following useful features:- Assertions:
The language should make it possible to equip a class and its features with assertions (preconditions, postconditions and invariants), relying on tools to produce documentation out of these assertions and, optionally, monitor them at run time.
- Information Hiding (Java is not good either on that one, the protected keyword is of dubious value):
It should be possible for the author of a class to specify that a feature is available to all clients, to no client, or to specified clients
- Static Typing:
A well-defined type system should, by enforcing a number of type declaration and compatibility rules, guarantee the run-time type safety of the systems it accepts.
- Genericity:
It should be possible to write classes with formal generic parameters representing arbitrary types.
Tags: book review