XPlane2Blender icon indicating copy to clipboard operation
XPlane2Blender copied to clipboard

Clean "TODO"s out of the code base!

Open tngreene opened this issue 7 years ago • 4 comments

There are a bunch of TODOs in the code base saying things like "TODO: Is this needed"? "TODO: Remove me?" "TODO: [Something that got fixed]" and commented out code.

Not only is it sloppy, it is also confusing, to understand the state of the code. If there is a "TODO: Fix me" it should have a bug filed with it!

tngreene avatar Nov 29 '17 21:11 tngreene

xplane_bone.py:

  • Sometimes uses a hard-coded 5

xplane_light.py

  • Rounds axis_angle_theta in autodetection_algorithm to a hardcoded 5 digits

xplane_helpers.py

  • in floatToStr, FLOAT_PRECISION = 8 is used to round numbers

Delete floatToStr because it is slow and terrible. See #347 for where it was fixed.

tngreene avatar May 08 '18 14:05 tngreene

  • 4252dadf8 - xplane_config.debug/log removed
  • 28fb74cde (and later b68193) - Remove XPLANE_OBJECT_TYPE_* constants
  • Other dumb TODO comments removed in this time region

tngreene avatar Aug 13 '18 21:08 tngreene

c97a96411ee448cf1 - Renamed the terribly named "getWeight" method.

tngreene avatar Nov 26 '18 21:11 tngreene

Annoying uses of hasattr are not uncommon. For instance

                if hasattr(mesh, 'calc_normals_split'): # split normals
                    mesh.calc_normals_split()
                    supports_split_normals = True

                if hasattr(mesh, 'polygons'): # BMesh
                    mesh.update(calc_tessface = True)
                    mesh.calc_tessface()
                    mesh_faces = mesh.tessfaces
                else:
                    mesh_faces = mesh.faces

We're far in future already! Yes we have this stuff!

tngreene avatar Aug 13 '19 23:08 tngreene