Talk:Hackety Hacking Problem AreaofN SidedPolygon Methods: Difference between revisions

From OLPC
Jump to navigation Jump to search
(New page: A few points: * The sample output is wrong; the area of a square with side 2 is 4. * The problem statement does not make it clear why it is necessary to define a method. Defining a metho...)
 
No edit summary
 
Line 4: Line 4:
* The problem statement does not make it clear why it is necessary to define a method. Defining a method only to call it immediately (and never again) unnecessarily complicates the solution.
* The problem statement does not make it clear why it is necessary to define a method. Defining a method only to call it immediately (and never again) unnecessarily complicates the solution.
* You use the letter "l" as a parameter name; in most typefaces this letter is hard to distinguish from the number 1, which you also use in the function.
* You use the letter "l" as a parameter name; in most typefaces this letter is hard to distinguish from the number 1, which you also use in the function.
* The method calculates the area using the "l" parameter, but prints using the global "L" variable.
—[[User:Leejc|Joe]] 16:47, 16 October 2007 (EDT)
—[[User:Leejc|Joe]] 16:47, 16 October 2007 (EDT)

Latest revision as of 20:48, 16 October 2007

A few points:

  • The sample output is wrong; the area of a square with side 2 is 4.
  • The problem statement does not make it clear why it is necessary to define a method. Defining a method only to call it immediately (and never again) unnecessarily complicates the solution.
  • You use the letter "l" as a parameter name; in most typefaces this letter is hard to distinguish from the number 1, which you also use in the function.
  • The method calculates the area using the "l" parameter, but prints using the global "L" variable.

Joe 16:47, 16 October 2007 (EDT)