Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
how do you know which class pars belong to?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Leonardo Francalanci, post: 4466997"] Hello, 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 use a special notation to understand what classes are to be passed to methods? And: when the parameters of a method change (in number and/or type), how do you change the calling code accordingly? Example: def mymethod(customer, vendor) <some code here> end What class do customer and vendor belong? To Customer and Vendor? Or to Person? Or are they just strings? What are the ruturn types? And when you change the code to: def mymethod(customer, vendor, times) <some code here> end do you use "grep" (or any other IDE command) to find all the calling code to change it? Hope this post doesn't end in a flame "java vs ruby". I just want to understand how people deal with this things, so that I can get the best out of Ruby. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
how do you know which class pars belong to?
Top