Dec-08-2016, 10:16 PM
(Dec-07-2016, 07:31 PM)roadrage Wrote: I totally agree... my code is the "ugly duckling" at this point...
hope "someday" it becomes the "beautiful duck"
This won't happen because you'll have taken bad habits... Ugly code is hard to read (in the sense that it needs more brainpower), and hard to read code is more likely to have unnoticed bugs, because you have diverted your brainpower to futile task instead of concentrating on the code logic. You are just making your life difficult. When you write something like this, it is totally inefficient for you:
def rewrite_title(*args): """ Replace the HTML title contents with the given TITLE """ htmlbody = args[0] newtitle = args[1]because you have to remember the arguments order, and to call the whole function you have to look at 4 lines of code to make sure you have the arguments at the right places, while when you write the function like this:
def rewrite_title(htmlbody,newtitle): """ Replace the HTML title contents with the given TITLE """everything needed is in the
def
line... and the more arguments you have, the more difficult you code style makes it.Now, if you want to remain a code poseur, you can save some typing and vertical space like this:
def rewrite_title(*args): """ Replace the HTML title contents with the given TITLE """ htmlbody,newtitle = argsbut then it becomes quite silly....
PS: of course, until you start coding to universally accepted standards, you'll be coding alone
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Your one-stop place for all your GIMP needs: gimp-forum.net