suxinde2009 / isgl3d

Automatically exported from code.google.com/p/isgl3d
Other
0 stars 0 forks source link

Method naming scheme degrades code readability #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The naming scheme of the methods makes reading the code more difficult. For 
example, the methods

[Isgl3dEllipsoid meshWithGeometry:4 radiusY:0.5 radiusZ:4 longs:32 lats:8];
[[Isgl3dCone alloc] initWithGeometry:3 topRadius:4 bottomRadius:2 ns:4 nt:12 
openEnded:YES];

makes me wonder what the first parameter is. What is geometry 4 or 3? Is that 
an index into something? I must go to the API in order to determine what the 
first parameter must be. Oh it's radiusX on the first one, and height on the 
second, well the method signatures SHOULD read

[Isgl3dEllipsoid meshWithRadiusX:4 radiusY:0.5 radiusZ:4 longs:32 lats:8];
[[Isgl3dCone alloc] initWithHeight:3 topRadius:4 bottomRadius:2 ns:4 nt:12 
openEnded:YES];

This is more readable and complies with every Objectve-C method you see in any 
built-in framework. (And, isn't meshWithGeometry a bit redundant, as meshes are 
by definition geometry?)

Original issue reported on code.google.com by Tustin2...@gmail.com on 19 May 2011 at 10:04

GoogleCodeExporter commented 8 years ago
Not a bug/defect although agreed that the api naming can be improved. Will be 
implemented with backward-compatible API later if a request is made.

Original comment by stuart.caunt on 8 Aug 2011 at 6:00