I wanted to provide you with some helpful coding standards when starting off in MEL, Python or C++ in Maya, the beauty of these standards is you can take them where ever you go in your coding journey...to any programming language or to any API within any application available, this is not an Autodesk thing!
- Document your code, so that you and others can clearly read it. You can’t imagine how many times people come back to code after a few months and it take them twice as long to figure out what is going on in the code because they did not document it and now they can’t remember.
- Document at the top your scripts what the script is about and your name in comments.
- Name your variables appropriately; our sample code follows a variable naming convention where “l” is used as a prefix for local variables, “m” for class member variables, and “p” for parameter variables.
- Use spaces, it makes your code easier to read, everything doesn’t need to be bunched up, it doesn’t go through the interpreter any faster, and you can use it freely, why? Because it’s free!
Cheers,
Kristine





Subscribe
Sage advice dude. Helpful coding standards in general, not just Maya
Posted by: sheena | 26/08/2010 at 01:55 PM