<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - Parts of Speech in Programming]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=868&amp;type=atom"/>
	<updated>2013-11-05T15:45:32Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=868</id>
		<entry>
			<title type="html"><![CDATA[Parts of Speech in Programming]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5907#p5907"/>
			<content type="html"><![CDATA[<p>The english language has many words. Each word has a designated part of speech. When these words are combined in special ways, you get a sentence. </p><p>I want to share a standard I have for translating these parts of speech into lua programming so that your code will be more readable. </p><h5>NOUNS</h5><p>A noun is a Person, Place, Thing, or Idea. <br />Variables should be named like nouns. Meet Joe:<br /></p><div class="codebox"><pre><code>joe =</code></pre></div><p>Joe is a person, so he is a noun. We could put joe in a Person Class to make him more of a person:<br /></p><div class="codebox"><pre><code>joe = Person()</code></pre></div><h5>VERBS</h5><p>Verbs are Action Words. Joe can walk and talk!<br />Functions should be named like verbs.<br /></p><div class="codebox"><pre><code>joe:Walk()
joe:Talk()</code></pre></div><h5>ADJECTIVES</h5><p>Adjectives Describe Nouns! Joe is pale!<br />Use Booleans to denote adjectives.<br /></p><div class="codebox"><pre><code>pale = true</code></pre></div><h5>ADVERBS</h5><p>Adverbs Describe Verbs. Joey can walk Quickly:<br />Once again, use Booleans to denote adverbs. If you use them as arguments for functions, it reads better. <br /></p><div class="codebox"><pre><code>joe:Walk(quickly)

walk = true
quickly = true</code></pre></div><h5>PARTICIPLES</h5><p>A participle is a tense of a verb. Is Joe biking? Or has joe biked? Usually past or present tense.<br />Once again, Booleans.<br /></p><div class="codebox"><pre><code>biking = true
biked = false</code></pre></div><h5>PREPOSITIONS</h5><p>A preposition is a Location Word. Is joe Under the shed or In the shed? Is he Around the corner or Along the corner?<br />Booleans again.<br /></p><div class="codebox"><pre><code>under = false
around = true</code></pre></div><h5>CONJUNCTIONS</h5><p>Conjunctions JOIN sentences (statements).<br />Usually Conditional Statements are the conjunctions in programming. Words like &quot;but,&quot; &quot;and,&quot; !because,&quot; are conjunctions. <br /></p><div class="codebox"><pre><code>if joe.isWalking and joe.isWalkingQuickly then
    joe.isAfraid
end</code></pre></div><p>Above, isWalking is a boolean, as well as isWalkingQuickly. Also isAfraid is a boolean. So all we are doing is setting boolean values. Starting to look like an English sentence. </p><h5>INTERJECTIONS</h5><p>Interjections are used to express emotion or sentiment. Uh, er, bye, hi, cheers! Horray! Wow! Sup! Oh! Well! Sorry! Oh dear!<br />One way to do interjections is to use Loops. Most of the time these statments stand for other things. &quot;Wow&quot; means that you are surprised and don&#039;t know what to say. <br /></p><div class="codebox"><pre><code>surprised = true
speecheless = true

while speechless and surprised do
    LookInAmazement()
end</code></pre></div><p>We could make a function called Wow() that would set these boolean variables:<br /></p><div class="codebox"><pre><code>function Wow()
    wowed = true
    surprised = true
    speecheless = true
    LookInAmazement()
end

joe:Wow()</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Tutorial Doctor]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2493</uri>
			</author>
			<updated>2013-11-05T15:45:32Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5907#p5907</id>
		</entry>
</feed>
