#Hello,
···
Leonardo Francalanci [mailto:lfrancalanci@simtel.it] wrote:
#
#I've found Ruby very interesting. I like it, but coming from a Java
#background I'm having some problems when it comes to parameters and
#function return values. When I program in Java, I just have a look at
#the method definition and I know what classes I have to pass to the
#method and what class the method will return. And, if I write
#something
#wrong, the compiler will warn me. Now: how do you do it in
#Ruby? Do you
ruby is dynamic, so no, no warning/checking. You can check it yourself but
it becomes part of the code. Again, there are pros/cons. Ultimately, at the
application level, one really has to check using code. Remember, do not
trust the compiler/interpreter, or should we say, verify, verify, verify.
You can use unittests/assertions and mimic eiffel's pre/post-condition. Your
code will look unclean, so use an editor that can fold/unshow assert
statements or any statement/block you don't want to view...
kind regards -botp