Forums Register Login

Which is better?

+Pie Number of slices to send: Send
Should I pass two numbers into a method or just pass one number and use it to calculate the second?
I know I can do it both ways so which should I choose?
+Pie Number of slices to send: Send
If you can do something just once, why do it twice?
Use "number A" to calulate "number B" and then decide where the code that does this calculation should go. If the calcualtion is simple, you could just forget even having a second variable. If for example B = (4 * A), you could just have A and (4*A).
+Pie Number of slices to send: Send
hi Amy
I think that the coding should be keep clear and sample, the method is used to hiding the coding,procedure calculation. So, I perfer to use method to do something,it is also the concept of the encapsulation. (Hope that I without explain wrong of the encapsulation )
HTH
+Pie Number of slices to send: Send
hi,
if you can do what you want with sending one
number then use only one number the variables
and arguments you use the better
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1145 times.
Similar Threads
Single rmi invocation for String[] or multiple invocations for each String.
how to make an object synchronized
Help me
Passing my object to one to other activity
on lost focus of textbox. + JSP + Server side Validation.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:17:13.