I've tried to stay out of this, but I just can't :-)
I know that perhaps your example was just thrown out to be a sample of
commenting
every line of code, etc. But I just need to say that reading that sample
was so painful
that it made my eyeballs bleed.
I think they will be okay, but you want to be careful writing code which is
_that_ ugly :-)
Brandon's comment was best - explaining what the function does at the right
place...
> If this is true, the method above might look like this:
>
>
>
> public double calculateDistance(double changeInX, double changeInY)
>
> {
>
> /* Calculate and store the value of the change in X squared in a
> local variable. */
>
> double xSquared = changeInX * changeInX;
>
>
>
> /* Calculate and store the value of the change in Y squared in a
> local variable. */
>
> double ySquared = changeInY * changeInY;
>
>
>
> /* Calculate and store the sum of the change in Y squared and the
> change in X squared
>
> * In a local variable.
>
> */
>
> double sumOfChangesSquared = xSquared + ySquared;
>
>
>
> /*
>
> * Calculate the distance using the values calculated previously in
> this method using the
>
> * the square root method of the Math class.
>
> */
>
> double distance = Math.sqrt(sumOfChangesSquared);
>
>
>
> /* Return the results of our calculation.
>
> return distance;
>
> }
>
>
>
> Thanks for your comments.
>
>
>
> Landon
>
>
>
>
> *Warning:
> *Information provided via electronic media is not guaranteed against
> defects including translation and transmission errors. If the reader is not
> the intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited. If
> you have received this information in error, please notify the sender
> immediately.
>
> _______________________________________________
> Geowanking mailing list
> [email protected]
> http://lists.burri.to/mailman/listinfo/geowanking
>
--
Rich Gibson
Chief Scientist (and bottle washer), Locative Technologies
http://mappinghacks.com
http://geocoder.us
http://testingrange.com
AIM period3equals
_______________________________________________
Geowanking mailing list
[email protected]
http://lists.burri.to/mailman/listinfo/geowanking