<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="/feed.php">
        <title>Documentation Center public:software:dazstudio:4:referenceguide:scripting:basics:coding_standards</title>
        <description></description>
        <link>/</link>
        <image rdf:resource="/lib/tpl/dazdoccenter/images/favicon.ico" />
       <dc:date>2026-04-14T10:50:05+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="/public/software/dazstudio/4/referenceguide/scripting/basics/coding_standards/start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="/lib/tpl/dazdoccenter/images/favicon.ico">
        <title>Documentation Center</title>
        <link>/</link>
        <url>/lib/tpl/dazdoccenter/images/favicon.ico</url>
    </image>
    <item rdf:about="/public/software/dazstudio/4/referenceguide/scripting/basics/coding_standards/start">
        <dc:format>text/html</dc:format>
        <dc:date>2014-06-22T06:35:26+00:00</dc:date>
        <title>DAZ Script Coding Standards</title>
        <link>/public/software/dazstudio/4/referenceguide/scripting/basics/coding_standards/start</link>
        <description>
&lt;h1 id=&quot;daz_script_coding_standards&quot;&gt;DAZ Script Coding Standards&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Below you&amp;#039;ll find coding standards that &lt;abbr title=&quot;Digital Art Zone&quot;&gt;DAZ&lt;/abbr&gt; 3D uses internally. We&amp;#039;ve provided them here in hopes that you will find them useful in your own endeavors. We find that by using these standards, our code is easier to read and maintain. We hope that they might offer you the same benefit.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;variable_naming&quot;&gt;Variable Naming&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Variable names names should be descriptive, rather than brief. Use the following rules when naming variables:
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;notation&quot;&gt;Notation&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Since &lt;abbr title=&quot;Digital Art Zone&quot;&gt;DAZ&lt;/abbr&gt; Script variables are type-less, use a Hungarian Notation style naming convention to help avoid confusion about what types variables and parameters are expected to be. The following is a list of prefixes for the different basic types:
&lt;/p&gt;
&lt;div class=&quot;table sectionedit1&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 rightalign&quot;&gt;  Prefix&lt;/th&gt;&lt;th class=&quot;col1 leftalign&quot;&gt;Type  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  o&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object&quot;&gt;Object&lt;/a&gt; any variable that is intended to hold an instance of a &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object_q&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object_q&quot;&gt;QObject&lt;/a&gt; or &lt;abbr title=&quot;Digital Art Zone&quot;&gt;DAZ&lt;/abbr&gt; Script custom class besides those listed below.&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  a&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/array&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:array&quot;&gt;Array&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  b&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/boolean&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:boolean&quot;&gt;Boolean&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  n&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/number&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:number&quot;&gt;Number&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  s&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/string&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:string&quot;&gt;String&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  clr&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/color&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:color&quot;&gt;Color&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  pal&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/palette&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:palette&quot;&gt;Palette&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  pix&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/pixmap&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:pixmap&quot;&gt;Pixmap&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  date&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/date&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:date&quot;&gt;Date&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  pnt&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/point&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:point&quot;&gt;Point&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  rect&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/rect&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:rect&quot;&gt;Rect&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  regx&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/regexp&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:regexp&quot;&gt;RegExp&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  size&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/size&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:size&quot;&gt;Size&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  bytes&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/bytearray&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:bytearray&quot;&gt;ByteArray&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  font&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/font&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:font&quot;&gt;Font&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  w&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/widget_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:widget_dz&quot;&gt;DzWidget&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  box&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/box3_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:box3_dz&quot;&gt;DzBox3&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  mtx&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/matrix3_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:matrix3_dz&quot;&gt;DzMatrix3&lt;/a&gt; and &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/matrix4_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:matrix4_dz&quot;&gt;DzMatrix4&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  vec&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/vec3_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:vec3_dz&quot;&gt;DzVec3&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  quat&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/quat_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:quat_dz&quot;&gt;DzQuat&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row21&quot;&gt;
		&lt;td class=&quot;col0 rightalign&quot;&gt;  rng&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;&lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/timerange_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:timerange_dz&quot;&gt;DzTimeRange&lt;/a&gt; type variables&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT1 TABLE [734-3438] --&gt;
&lt;/div&gt;

&lt;h3 id=&quot;variable_name_case&quot;&gt;Variable Name Case&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Variable names always start with a lowercase letter, with each subsequent word in the variable name starting with an uppercase letter (no underscores separating words).
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;be_descriptive&quot;&gt;Be Descriptive&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Always use descriptive variable names. Avoid making variable names from single letter abbreviations that can be difficult to read. One letter variable names should &lt;strong&gt;NOT&lt;/strong&gt; be used, except in the following cases:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; i, j, k, n - Should only be used to iterate over a for/while loop where the variables i, j, and k are iterators, and n is the total number of iterations.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; x, y, z, w - Should only be used to represent coordinates in 2D or 3D space.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h3 id=&quot;global_variables&quot;&gt;Global Variables&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Global variable names always start with &amp;#039;g_&amp;#039;. Global variables should be used sparingly, but when they are used they should reside at the top of the file.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;function_naming&quot;&gt;Function Naming&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Function and method names, like variable names, always begin with a lowercase letter, with an uppercase letter used for every subsequent word in the function name.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;formatting&quot;&gt;Formatting&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
It is important to format code in a manner that is easily readable.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;indentation&quot;&gt;Indentation&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Indentation is a very good visual cue for flow control in a program. Use tabs for indentation (not spaces). The indentation of the code should be increased by one level in each of the following circumstances.
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; All code blocks beginning and ending with braces &amp;#039;{ }&amp;#039;.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; All code executed for a conditional statement.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; All code executed in a loop.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; All code inside a try-catch blocks.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Statements that are continued on the next line.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; indentationExample&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; num &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; nCount &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nRemainder &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; num&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                count&lt;span class=&quot;sy0&quot;&gt;--;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; nCount &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; nCount &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                        nRemainder&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;
                        nCount&lt;span class=&quot;sy0&quot;&gt;--;&lt;/span&gt;
                &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;kw2&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                &lt;span class=&quot;kw2&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; nRemainder &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
                        print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; nRemainder&lt;span class=&quot;sy0&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;kw2&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Unhandled exception!&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
        print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;This is a very long string. Okay, it isn&lt;span class=&quot;es1&quot;&gt;\'&lt;/span&gt;t that long, &amp;quot;&lt;/span&gt;
                &lt;span class=&quot;st0&quot;&gt;&amp;quot;but its long enough that it must be continued on the next line.&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3 id=&quot;nested_conditional_and_loop_statements&quot;&gt;Nested Conditional and Loop Statements&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
In the case of nested conditional and loop statements, braces should always be used to avoid confusion, and avoid logic errors such as the &amp;#039;dangling else&amp;#039; problem.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;whitespace&quot;&gt;Whitespace&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
A single empty line should be used to visually denote groupings in the code, separating code blocks, algorithms, definition groupings, etc. Multiple consecutive empty lines should not be used.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;commenting&quot;&gt;Commenting&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Good commenting habits make the code much easier to maintain. General comments throughout the code make it much easier to debug and extend the code, however, unless written specifically to dissect what is happening in explaining samples, excessive commenting can make the code cluttered and more difficult to follow, and should be avoided - comment briefly, concisely, and whenever necessary - layout the code in blocks that can be commented as a whole, rather than individual lines. Comments that contradict the code are worse than no comments at all. Always make it a priority to keep comments up-to-date when the code changes.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;general_comments&quot;&gt;General Comments&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
General comments should be added to the code wherever appropriate. These may be C style (// Commented) or C++ style (/* Commented */). Brief comments should follow the code on the same line. Comments for blocks of code, or larger comments should precede the code and be at the same indentation level as the code. All algorithms in the code should have a comment briefly describing the function. Larger functions and methods should be blocked out with comments briefly describing the flow of the function.
&lt;/p&gt;

&lt;/div&gt;

&lt;h3 id=&quot;readability_comments&quot;&gt;Readability Comments&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Some comments in the code do nothing more than visually separate portions of the code. This can make the code much easier to &amp;#039;scan&amp;#039; through, and so we have adopted a few comments that serve only as visual cues in the source code.
&lt;/p&gt;

&lt;/div&gt;

&lt;h4 id=&quot;file_local_sections&quot;&gt;File Local Sections&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
These comment blocks are used to separate blocks of file-local global variables, member variables, static variables, etc. 
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*****************************
   SectionLabel
*****************************/&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4 id=&quot;function_definitions&quot;&gt;Function Definitions&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
These comment blocks precede every function definition, and serve to visually separate one function from the next. 
&lt;/p&gt;
&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;coMULTI&quot;&gt;/*********************************************************************/&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
</description>
    </item>
</rdf:RDF>
