<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Adopt Some Coding Conventions for Projects: Sloppy Code SUCKS!</title>
	<atom:link href="http://cheezeworld.com/coding-standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://cheezeworld.com/coding-standards/</link>
	<description>The Cheeze to Your Macaroni - Games, Open Source Programming, and Other Odd Ramblings.</description>
	<pubDate>Tue, 06 Jan 2009 02:05:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Douglas Thompson</title>
		<link>http://cheezeworld.com/coding-standards/comment-page-1/#comment-55</link>
		<dc:creator>Douglas Thompson</dc:creator>
		<pubDate>Fri, 06 Jun 2008 00:41:53 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=43#comment-55</guid>
		<description>It's always important to stick to a certain set of rules when coding, even when writing code on your own.  What the particular standards are isn't quite so important, though, and every individual or team will have their own, unique ones.  Urban Squall or whatever definitely seems to have their shit together and would be worth following, but it's important to consider alternatives as well, and follow your own nose.

For example, the Hungarian notation-like stuff is often discouraged in type-heavy languages like AS3 and whatever else due to its redundant nature.  The variable is typed, it's plainly visible and the compiler checks for it, so why bother?  This sort of thing wasn't so prevalent here, but the "m_" prefix is generally discarded for the same reason (you've got access to the this pointer, so just use that).

At any rate, the getters/setters thing is a little bit of a pandora's box.  

First, I understand that there's a small performance hit for function calls, as well as parameter stacking/unstacking, etc, but you might want to back up your "20-30fps loss" claim with an example or something, as it seems a little ridiculous to me.  

You maybe have a point with the vector class, but it's a REAL rare exception that should not by any means be the rule.  Vector classes tend to be very static, straightforward and frequently called, as mentioned.  Generally, you should put off something as drastic as making variables completely public *until* it actually becomes an issue, not just because "it might, possibly, someday have a subtle impact on something somewhere". Pulling variables out into your public permissions can have some major implications design-wise, which is why the whole concept of a 'getter' and 'setter' exists in the first place, and leads to a very fragile design.

Having said that, the concept of a getter/setter is an ugly one, imo.  This article is very rantish and flamebaitish: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html but the general idea isn't that uncommon.  It's a bit of a religious war (just look at the comments), but I'm mostly opposed to them, personally.  YMMV!

One thing I found really interesting was US' way of declaring variables readonly.  This was something that I REALLY struggled with when getting up and running with AS3.  Coming from C++, you have a lot of control over what specifically should be constant.  A reference, what it references, what an object's methods are allowed to do, etc.  In AS3, there's *nothing* and it's awful.  I had initially thought about assigning each "read only" object to a temporary inside a method call to preclude the change, then decided that'd be too much extra work and mess, and the performance issue was there... so I decided to stick a ro_ onto the front of my 'read only' variables for a while as well.  I finally gave up on that and just don't do anything now.  Probably not the best decision in the world, but it's good to know that there are actually other people who recognize this issue with the language.

But anyway, thanks for the article/links!

Blah blah blah I'm gonna go make some tacos now.</description>
		<content:encoded><![CDATA[<p>It&#8217;s always important to stick to a certain set of rules when coding, even when writing code on your own.  What the particular standards are isn&#8217;t quite so important, though, and every individual or team will have their own, unique ones.  Urban Squall or whatever definitely seems to have their shit together and would be worth following, but it&#8217;s important to consider alternatives as well, and follow your own nose.</p>
<p>For example, the Hungarian notation-like stuff is often discouraged in type-heavy languages like AS3 and whatever else due to its redundant nature.  The variable is typed, it&#8217;s plainly visible and the compiler checks for it, so why bother?  This sort of thing wasn&#8217;t so prevalent here, but the &#8220;m_&#8221; prefix is generally discarded for the same reason (you&#8217;ve got access to the this pointer, so just use that).</p>
<p>At any rate, the getters/setters thing is a little bit of a pandora&#8217;s box.  </p>
<p>First, I understand that there&#8217;s a small performance hit for function calls, as well as parameter stacking/unstacking, etc, but you might want to back up your &#8220;20-30fps loss&#8221; claim with an example or something, as it seems a little ridiculous to me.  </p>
<p>You maybe have a point with the vector class, but it&#8217;s a REAL rare exception that should not by any means be the rule.  Vector classes tend to be very static, straightforward and frequently called, as mentioned.  Generally, you should put off something as drastic as making variables completely public *until* it actually becomes an issue, not just because &#8220;it might, possibly, someday have a subtle impact on something somewhere&#8221;. Pulling variables out into your public permissions can have some major implications design-wise, which is why the whole concept of a &#8216;getter&#8217; and &#8217;setter&#8217; exists in the first place, and leads to a very fragile design.</p>
<p>Having said that, the concept of a getter/setter is an ugly one, imo.  This article is very rantish and flamebaitish: <a href="http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html" rel="nofollow">http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html</a> but the general idea isn&#8217;t that uncommon.  It&#8217;s a bit of a religious war (just look at the comments), but I&#8217;m mostly opposed to them, personally.  YMMV!</p>
<p>One thing I found really interesting was US&#8217; way of declaring variables readonly.  This was something that I REALLY struggled with when getting up and running with AS3.  Coming from C++, you have a lot of control over what specifically should be constant.  A reference, what it references, what an object&#8217;s methods are allowed to do, etc.  In AS3, there&#8217;s *nothing* and it&#8217;s awful.  I had initially thought about assigning each &#8220;read only&#8221; object to a temporary inside a method call to preclude the change, then decided that&#8217;d be too much extra work and mess, and the performance issue was there&#8230; so I decided to stick a ro_ onto the front of my &#8216;read only&#8217; variables for a while as well.  I finally gave up on that and just don&#8217;t do anything now.  Probably not the best decision in the world, but it&#8217;s good to know that there are actually other people who recognize this issue with the language.</p>
<p>But anyway, thanks for the article/links!</p>
<p>Blah blah blah I&#8217;m gonna go make some tacos now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://cheezeworld.com/coding-standards/comment-page-1/#comment-52</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Tue, 03 Jun 2008 18:11:53 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=43#comment-52</guid>
		<description>worst of all with sloppy codeing is to use global variable instead of local.

Andrew /
www.eminentgames.com</description>
		<content:encoded><![CDATA[<p>worst of all with sloppy codeing is to use global variable instead of local.</p>
<p>Andrew /<br />
<a href="http://www.eminentgames.com" rel="nofollow">http://www.eminentgames.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scarybug</title>
		<link>http://cheezeworld.com/coding-standards/comment-page-1/#comment-48</link>
		<dc:creator>Scarybug</dc:creator>
		<pubDate>Tue, 03 Jun 2008 14:34:54 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=43#comment-48</guid>
		<description>Hmm... I never thought of using a convention to distinguish private variables from public ones. I always use caps for constants, especially since in AS2 I don't have real constants and have to remind myself.

One thing I do is to distinguish function names better from variable names. My variable names are all separated by underscores instead of using camelCase. camelCase is reserved only for functions in my code. This is especially useful to me because I often pass or manipulate functions as variables for doing adaptive AI or Genetic Algorithms.

Thanks for the kick in the butt about refraining from overusing getters and senders. I'm going to definitely apply that rule to my current game.</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; I never thought of using a convention to distinguish private variables from public ones. I always use caps for constants, especially since in AS2 I don&#8217;t have real constants and have to remind myself.</p>
<p>One thing I do is to distinguish function names better from variable names. My variable names are all separated by underscores instead of using camelCase. camelCase is reserved only for functions in my code. This is especially useful to me because I often pass or manipulate functions as variables for doing adaptive AI or Genetic Algorithms.</p>
<p>Thanks for the kick in the butt about refraining from overusing getters and senders. I&#8217;m going to definitely apply that rule to my current game.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher (GoPlaySushi)</title>
		<link>http://cheezeworld.com/coding-standards/comment-page-1/#comment-44</link>
		<dc:creator>Christopher (GoPlaySushi)</dc:creator>
		<pubDate>Sun, 01 Jun 2008 23:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://cheezeworld.com/?p=43#comment-44</guid>
		<description>Great and interesting post there! I've been using some of these techniques myself - got so sick and tired of not understanding what all those functions and variables did. Espically I love the real-time-verbNoun-thing of which you speek - tend to use that one alot - it explains alot and doesn't demand long terms. Thanks for an interesting read.
Christopher of GOPLAYSUSHI.COM</description>
		<content:encoded><![CDATA[<p>Great and interesting post there! I&#8217;ve been using some of these techniques myself - got so sick and tired of not understanding what all those functions and variables did. Espically I love the real-time-verbNoun-thing of which you speek - tend to use that one alot - it explains alot and doesn&#8217;t demand long terms. Thanks for an interesting read.<br />
Christopher of GOPLAYSUSHI.COM</p>
]]></content:encoded>
	</item>
</channel>
</rss>
