<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - A few Programming Standards]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=860&amp;type=atom"/>
	<updated>2013-10-30T01:03:45Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=860</id>
		<entry>
			<title type="html"><![CDATA[Re: A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5839#p5839"/>
			<content type="html"><![CDATA[<p>The table of contents is generated only when more than three section headings are used.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-30T01:03:45Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5839#p5839</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5838#p5838"/>
			<content type="html"><![CDATA[<p>I tried to add the OOP tutorial to the wiki. A table of contents didn&#039;t show up however. Could you check it out to see if I did it correctly? Here is the link:</p><p><a href="http://wiki.maratis3d.org/index.php?title=Object_Oriented_Programming_in_Maratis">http://wiki.maratis3d.org/index.php?tit &#133; in_Maratis</a></p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-10-29T22:01:11Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5838#p5838</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5836#p5836"/>
			<content type="html"><![CDATA[<p>Thanks. I got it. Going to try to redo this one on the wiki.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-10-29T21:09:26Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5836#p5836</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5835#p5835"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>Tutorial Doctor wrote:</cite><blockquote><p>I have an account now?</p></blockquote></div><p>Yep, you should check your email, it contains your password for the log in.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-29T17:41:53Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5835#p5835</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5834#p5834"/>
			<content type="html"><![CDATA[<p>I have an account now? Cool! I will move these posts there. I was waiting on a response. Thanks 255</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-10-29T14:44:09Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5834#p5834</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5833#p5833"/>
			<content type="html"><![CDATA[<p>Didn&#039;t you learn how to do a wiki page yet? These thread of yours better fit the wiki. I see that you have an account there now, so here&#039;s how you could put post of this kind in the wiki, just a suggestion. It&#039;s very simple.<br />All you have to do is putting the code between &quot;pre&quot; tags:<br /></p><div class="codebox"><pre><code>&lt;pre&gt;
your code
&lt;/pre&gt;</code></pre></div><p>instead of &quot;code&quot; tag.<br />Also, new lines are done only if you do &quot;two new lines&quot;.<br />So this:<br /></p><div class="codebox"><pre><code>Hello.
I&#039;m Tutorial Doctor.</code></pre></div><p>will output this:<br /></p><div class="codebox"><pre><code>Hello.I&#039;m Tutorial Doctor.</code></pre></div><p>While this:<br /></p><div class="codebox"><pre><code>Hello.

I&#039;m Tutorial Doctor.</code></pre></div><p>will output this:<br /></p><div class="codebox"><pre><code>Hello.
I&#039;m Tutorial Doctor.</code></pre></div><p>That&#039;s all, there are no other things to keep in mind. Putting images is a bit more of work but it&#039;s not difficult either.</p><p>Also, everyone can edit your work and fix formatting, errors, doing a list of your pages with links and everything so even doing incomplete work will be useful anyway.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-29T10:53:07Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5833#p5833</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[A few Programming Standards]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5830#p5830"/>
			<content type="html"><![CDATA[<p>Programming is not a school subject you have to pass in order to graduate, but if we treat it as one and learn it the way a high school education system would teach it, we could get better standards for programming. It is good to have standards. </p><p>People have different conventions for naming variables or plain structuring code. I am a layman so I try to keep it simple. </p><p>An APPLE is a FRUIT. Therefore an apple belongs to the class of FRUIT:<br /></p><div class="codebox"><pre><code>class Fruit()

apple = Fruit()</code></pre></div><p>One way to name a class is as a TYPE of something. An apple is a TYPE of fruit. Apple is the instance. Fruit is the class. </p><p>Another way to name a class is as a SUBJECT. </p><p>In Math class you learn math.<br /></p><div class="codebox"><pre><code>class Math()

calculus = Math()</code></pre></div><p>But this is incomplete if you don&#039;t have a good convention for naming variables and functions so as to distinguish them from class names or one another without checking the camel&#039;s back. </p><p>Variables are nouns<br />Functions are verbs.</p><p>Functions should be names as ACTIONS. If you want to quit a game:<br /></p><div class="codebox"><pre><code>function QuitGame()</code></pre></div><p>If you want to start a game:<br /></p><div class="codebox"><pre><code>function StartGame() </code></pre></div><p>I also have a standard for booleans. I name booleans as PARTICIPLES and as ADVERBS:<br /></p><div class="codebox"><pre><code>walking = false

if walking then
end

quickly = false

if walking and quickly then

end</code></pre></div><p>For people who name variables with underscores it is best to put NOUNS BEFORE ADJECTIVES as it makes similar variables easier to spot in the code:<br /></p><div class="codebox"><pre><code>apple_red =
apple_green =

boy_mexican =
boy_african_american =
boy_caucasian =
boy_indian =
boy_chinese =</code></pre></div><p>If I want to find a &quot;boy&quot; I can find it easier this way.</p><p>Underscores also make things easier to read for me (I used to not understand why people did it). </p><p>Anyhow, having standards like these will make code flow better, and keep variable names or class names or function names from getting mixed up.</p><p>One more thing, It is good to be SPECIFIC yet BRIEF in your naming. For example if you have a person class:<br /></p><div class="codebox"><pre><code>class Person()</code></pre></div><p>And you create an instance:<br /></p><div class="codebox"><pre><code>joey = Person()</code></pre></div><p>Then you make joey do &quot;Person&quot; stuff:<br /></p><div class="codebox"><pre><code>joey:Speak()
joey:Walk(quickly)</code></pre></div><p>This is already specific to JOEY since it uses classes, so your wording shouldn&#039;t get mixed up.</p><p>However, if it were just a function outside of a class:<br /></p><div class="codebox"><pre><code>Walk()</code></pre></div><p>Then it leaves the questions:</p><p>Who or what is walking?<br />Walk where?<br />Walking how?</p><p>You could do this instead:<br /></p><div class="codebox"><pre><code>WalkFast()
WalkSlow()
WalkLikeYouBrokeYourLeg()</code></pre></div><p>Functions should start with a captical letter and camel-case for each new word<br />variables start with a lower case letter and camel-case for each new word. </p><p>Whether you use underscores or not is up to you. But the two standards above are general for every programming language (at least how schools would teach you). </p><p>Writers can write however they want in their journals, but when it comes to writing a research paper, there are standards. Hopefully this helps.</p>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-10-29T05:18:25Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5830#p5830</id>
		</entry>
</feed>
