Programming Method
-
At best, the way I program typically involves a primary nested loop, and procedural calls. I also use a ton of "flags" to transmit conditions through out the code. All of this is OK until I begin to patch the program to correct bugs, or add enhancements. After a while the code becomes difficult to follow because I have forgotten the function of the flag, the patch, and the documentation begins to be obtuse.
Any advice on organization from those with experience?
-
Comment Comment Comment - the alpha and omega for maintaining code.
@honoluludesktop said:
I also use a ton of "flags" to transmit conditions through out the code.
Instance variables?
I used to have a bunch of those as well - but now I try to make more custom classes that takes care of it's own section of the code. -
Custom Classes? Guess I am not there yet. Just beginning to understand that methods are procedures>_< While I conceptually understand parent child, I don't have a clue as to implementing it. Will I live long enough?-)
-
A concrete example here, but I noticed in your dxf plugin you would benefit from using
elsifinstead ofelse if- it would greatly reduce the indenting in a few cases and make the code more read-able.Each if requires an end, so using
elsifyou could eliminate quite a fewendstatements.if condition # do this elsif condition # do that elsif condition # do the other else # default action end -
Jim, Thanks again:-)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement