Difference between revisions of "HowTo:Manage your variables"
(Created page with 'The [http://lib.povray.org/usersguide/04contributing.html#prep requirements page] for the POV-Ray Object Collection has some good tips: <blockquote>Variable names exposed to the…') |
(add heading, reason for recommendation) |
||
Line 1: | Line 1: | ||
− | The [http://lib.povray.org/usersguide/04contributing.html#prep requirements page] for the POV-Ray Object Collection has some good | + | ==Naming variables to facilitate reuse by other people== |
+ | The [http://lib.povray.org/usersguide/04contributing.html#prep requirements page] for the POV-Ray Object Collection has some good recommendations: | ||
<blockquote>Variable names exposed to the user should also be prefixed with the contribution name or the unique prefix and should be directly followed by an underscore ('_'). This includes named objects, textures, pigments, normals etc. For example the 'Netball' object exposes the NB_BallRadius variable to enable the radius of the ball to be controlled. You may use the #local directive to define variables with a local context within macros etc., in which case you are not obliged to adhere to this naming standard within those macros, because the local context should avoid naming conflicts.</blockquote> | <blockquote>Variable names exposed to the user should also be prefixed with the contribution name or the unique prefix and should be directly followed by an underscore ('_'). This includes named objects, textures, pigments, normals etc. For example the 'Netball' object exposes the NB_BallRadius variable to enable the radius of the ball to be controlled. You may use the #local directive to define variables with a local context within macros etc., in which case you are not obliged to adhere to this naming standard within those macros, because the local context should avoid naming conflicts.</blockquote> | ||
+ | |||
+ | By following these recommendations you ensure that your objects can be used in others' scenes with minimal modification. |
Latest revision as of 17:07, 26 July 2010
Naming variables to facilitate reuse by other people
The requirements page for the POV-Ray Object Collection has some good recommendations:
Variable names exposed to the user should also be prefixed with the contribution name or the unique prefix and should be directly followed by an underscore ('_'). This includes named objects, textures, pigments, normals etc. For example the 'Netball' object exposes the NB_BallRadius variable to enable the radius of the ball to be controlled. You may use the #local directive to define variables with a local context within macros etc., in which case you are not obliged to adhere to this naming standard within those macros, because the local context should avoid naming conflicts.
By following these recommendations you ensure that your objects can be used in others' scenes with minimal modification.