<?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: Indentation of code</title>
	<atom:link href="http://robertnyman.com/2007/03/26/indentation-of-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertnyman.com/2007/03/26/indentation-of-code/</link>
	<description>Web development and Internet trends</description>
	<lastBuildDate>Sat, 20 Mar 2010 20:09:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Roalnd</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-532675</link>
		<dc:creator>Roalnd</dc:creator>
		<pubDate>Sat, 28 Feb 2009 05:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-532675</guid>
		<description>When you become a veteran of many platforms, or you start writing software development books you will stop using the TAB character for all time.  You will configure every editor you use to insert spaces instead of TABs and you will refuse to use any editor which doesn&#039;t allow you to select every line of a source file you just opened converting its tabs to spaces.

A lot of the weaker platforms don&#039;t even support fixed width fonts.  They support things like &quot;Courier New&quot; which only &quot;appears&quot; to be fixed width at certain point sizes.</description>
		<content:encoded><![CDATA[<p>When you become a veteran of many platforms, or you start writing software development books you will stop using the TAB character for all time.  You will configure every editor you use to insert spaces instead of TABs and you will refuse to use any editor which doesn&#8217;t allow you to select every line of a source file you just opened converting its tabs to spaces.</p>
<p>A lot of the weaker platforms don&#8217;t even support fixed width fonts.  They support things like &#8220;Courier New&#8221; which only &#8220;appears&#8221; to be fixed width at certain point sizes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Whoami</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-525486</link>
		<dc:creator>Whoami</dc:creator>
		<pubDate>Mon, 16 Feb 2009 20:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-525486</guid>
		<description>I like to indent with 2 spaces and half, plus half-tab, when the indentation is smooth, but with 1 tab plus 1 space, when the indentation must be strong.
Furthermore, configuring the editor to convert and display the square of tab numbers as spaces, one can surely indent perfectly, always!</description>
		<content:encoded><![CDATA[<p>I like to indent with 2 spaces and half, plus half-tab, when the indentation is smooth, but with 1 tab plus 1 space, when the indentation must be strong.<br />
Furthermore, configuring the editor to convert and display the square of tab numbers as spaces, one can surely indent perfectly, always!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SneakyWho_am_i</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-483311</link>
		<dc:creator>SneakyWho_am_i</dc:creator>
		<pubDate>Tue, 09 Dec 2008 03:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-483311</guid>
		<description>I used to put tabs into it, but then I ran into a probleml I write code in a number of editors on a number of platforms. All have different font settings and all have different capabilities. Sometimes I write code in a Java application on my mobile phone, and that HATES tabs.

Use the tab &lt;em&gt;key&lt;/em&gt; all you want (I do) but please don&#039;t use the tab &lt;em&gt;character&lt;/em&gt;! Actually no, I don&#039;t mind whatever you do, I can handle when something is displayed strangely in my editor so I&#039;m not out to start a religious war or anything.

What disadvantages are there of treating three or four spaces as tabs? Most editors can be configured to (or even by default) automatically replace tabs with spaces. And if I press backspace @ a set of four spaces? The editor realises that it is indentation, and it wipes all of the spaces in one keypress.

Two lightweight editors I&#039;m fond of, which exhibit this very useful capability, are Notepad++ and KATE.

Yes, when I&#039;m in charge, I always say at the start &quot;We&#039;re using spaces for tabs, the tab width is four spaces, here is a set of instructions for the most popular free Windows and Linux editors and IDEs&quot;.
I think that it makes sense. I like to code for the web. The web is about getting information from A to B. What if I&#039;m at B and I want to edit the information?! By keeping an editor on my cellular phone, I can make little edits any time, any where.

(This is not advised for mental health reasons)

Now I&#039;m considering upgrading to a phone that can run C++ apps (say a Symbian or Linux handset) which will surely alleviate some of my woes.</description>
		<content:encoded><![CDATA[<p>I used to put tabs into it, but then I ran into a probleml I write code in a number of editors on a number of platforms. All have different font settings and all have different capabilities. Sometimes I write code in a Java application on my mobile phone, and that HATES tabs.</p>
<p>Use the tab <em>key</em> all you want (I do) but please don&#8217;t use the tab <em>character</em>! Actually no, I don&#8217;t mind whatever you do, I can handle when something is displayed strangely in my editor so I&#8217;m not out to start a religious war or anything.</p>
<p>What disadvantages are there of treating three or four spaces as tabs? Most editors can be configured to (or even by default) automatically replace tabs with spaces. And if I press backspace @ a set of four spaces? The editor realises that it is indentation, and it wipes all of the spaces in one keypress.</p>
<p>Two lightweight editors I&#8217;m fond of, which exhibit this very useful capability, are Notepad++ and KATE.</p>
<p>Yes, when I&#8217;m in charge, I always say at the start &#8220;We&#8217;re using spaces for tabs, the tab width is four spaces, here is a set of instructions for the most popular free Windows and Linux editors and IDEs&#8221;.<br />
I think that it makes sense. I like to code for the web. The web is about getting information from A to B. What if I&#8217;m at B and I want to edit the information?! By keeping an editor on my cellular phone, I can make little edits any time, any where.</p>
<p>(This is not advised for mental health reasons)</p>
<p>Now I&#8217;m considering upgrading to a phone that can run C++ apps (say a Symbian or Linux handset) which will surely alleviate some of my woes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mega Awesome CSS Resource List! &#124; WebDevLounge &#124; design, development, SEO and wordpress &#124; articles, discussion and community</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-363048</link>
		<dc:creator>Mega Awesome CSS Resource List! &#124; WebDevLounge &#124; design, development, SEO and wordpress &#124; articles, discussion and community</dc:creator>
		<pubDate>Sun, 03 Aug 2008 14:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-363048</guid>
		<description>[...] Indentation of code One thing that Iâ€™ve always taken for granted how to do is the indentation of code. Sure, people [...]</description>
		<content:encoded><![CDATA[<p>[...] Indentation of code One thing that Iâ€™ve always taken for granted how to do is the indentation of code. Sure, people [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: john</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-105803</link>
		<dc:creator>john</dc:creator>
		<pubDate>Tue, 18 Sep 2007 07:27:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-105803</guid>
		<description>&quot;Can someone give me an example of how using tabs can Ã¢â‚¬Å“mess things up for people with different editorsÃ¢â‚¬Â, because I have never experienced this, and I simply donÃ¢â‚¬â„¢t understand the concept&quot;

I think many people had been confused. When working in a team, everyone should follow the same standard, if one uses spaces, all others should use spaces, if one uses tab, all others should use tabs. This way, the appearence will not get messed up.

Things got messed up when some developers use tabs while others use spaces. This normally happens in a big development team. This is when a document indentations contain a mixture of spaces and tabs (this happens when different people edits the same document or source code). When this happens, the appearence will appear differently with different editors because the editors has different tab settings as some prefers 2 spaces for a tab and some others prefer 4 spaces for a tab, etc.

If tabs is preferred, the leader has to fucking make sure the others follow the standard.</description>
		<content:encoded><![CDATA[<p>&#8220;Can someone give me an example of how using tabs can Ã¢â‚¬Å“mess things up for people with different editorsÃ¢â‚¬Â, because I have never experienced this, and I simply donÃ¢â‚¬â„¢t understand the concept&#8221;</p>
<p>I think many people had been confused. When working in a team, everyone should follow the same standard, if one uses spaces, all others should use spaces, if one uses tab, all others should use tabs. This way, the appearence will not get messed up.</p>
<p>Things got messed up when some developers use tabs while others use spaces. This normally happens in a big development team. This is when a document indentations contain a mixture of spaces and tabs (this happens when different people edits the same document or source code). When this happens, the appearence will appear differently with different editors because the editors has different tab settings as some prefers 2 spaces for a tab and some others prefer 4 spaces for a tab, etc.</p>
<p>If tabs is preferred, the leader has to fucking make sure the others follow the standard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-51615</link>
		<dc:creator>Arthur</dc:creator>
		<pubDate>Thu, 19 Apr 2007 23:50:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-51615</guid>
		<description>Sigh.... Can someone give me an example of how using tabs can &quot;mess things up for people with different editors&quot;, because I have never experienced this, and I simply don&#039;t understand the concept.

Of course, things can be messed up if one is talking about tabs in the middle of lines for the purpose of table-based aligning, but I don&#039;t see how initial tabs, used soley for initial indentation, can possibly &quot;mess&quot; anything up.

Maybe some editors that aren&#039;t intended for writing code in the first place might mess things up (like a desktop publishing program), but why would someone be using anything other than a source code editor in the first place?

The W3C&#039;s insistance that tabs be rendered at 8 spaces per tab is excessive and stupid, and I can&#039;t believe that even the CSS3 proposal still refuses to provide a tab-setting property.</description>
		<content:encoded><![CDATA[<p>Sigh&#8230;. Can someone give me an example of how using tabs can &#8220;mess things up for people with different editors&#8221;, because I have never experienced this, and I simply don&#8217;t understand the concept.</p>
<p>Of course, things can be messed up if one is talking about tabs in the middle of lines for the purpose of table-based aligning, but I don&#8217;t see how initial tabs, used soley for initial indentation, can possibly &#8220;mess&#8221; anything up.</p>
<p>Maybe some editors that aren&#8217;t intended for writing code in the first place might mess things up (like a desktop publishing program), but why would someone be using anything other than a source code editor in the first place?</p>
<p>The W3C&#8217;s insistance that tabs be rendered at 8 spaces per tab is excessive and stupid, and I can&#8217;t believe that even the CSS3 proposal still refuses to provide a tab-setting property.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michal Caplygin</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-46146</link>
		<dc:creator>Michal Caplygin</dc:creator>
		<pubDate>Sun, 01 Apr 2007 22:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-46146</guid>
		<description>I use the space bar for indenting code. I use just one space; for many many reasons I consider that  the best way, but I am aware of the fact that most probably no-one else will agree with it.

But, gosh, is it really a problem to write a stupid script for indent conversion, that would calm every upset programmer, who just received someone else&#039;s source-code and swears at his indentation habits?

I tried to write &lt;a href=&quot;http://eldar.cz/myf/pub/firefox/indentizr.html&quot; title=&quot;IndentizR - indent converter&quot; rel=&quot;nofollow&quot;&gt;such one&lt;/a&gt; :). (do not laugh, I&#039;m not javascript guru at allÃ¢â‚¬Â¦)</description>
		<content:encoded><![CDATA[<p>I use the space bar for indenting code. I use just one space; for many many reasons I consider that  the best way, but I am aware of the fact that most probably no-one else will agree with it.</p>
<p>But, gosh, is it really a problem to write a stupid script for indent conversion, that would calm every upset programmer, who just received someone else&#8217;s source-code and swears at his indentation habits?</p>
<p>I tried to write <a href="http://eldar.cz/myf/pub/firefox/indentizr.html" title="IndentizR - indent converter" rel="nofollow">such one</a> <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . (do not laugh, I&#8217;m not javascript guru at allÃ¢â‚¬Â¦)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jermayn Parker</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-45230</link>
		<dc:creator>Jermayn Parker</dc:creator>
		<pubDate>Thu, 29 Mar 2007 09:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-45230</guid>
		<description>I use an online editor sometimes for my cpanel websites and if you use &#039;tab&#039; it will actually tab to the &#039;save&#039; button.

When not using the editor on cpanel, I use tab though. Although I will admit I did not even think about the fact of extra memory, I just did it because tabing is easier than spacing.</description>
		<content:encoded><![CDATA[<p>I use an online editor sometimes for my cpanel websites and if you use &#8216;tab&#8217; it will actually tab to the &#8217;save&#8217; button.</p>
<p>When not using the editor on cpanel, I use tab though. Although I will admit I did not even think about the fact of extra memory, I just did it because tabing is easier than spacing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-45190</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 29 Mar 2007 07:14:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-45190</guid>
		<description>Robert Wellock,

Whatever makes you happy... :-)</description>
		<content:encoded><![CDATA[<p>Robert Wellock,</p>
<p>Whatever makes you happy&#8230; <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Wellock</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-45061</link>
		<dc:creator>Robert Wellock</dc:creator>
		<pubDate>Wed, 28 Mar 2007 15:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-45061</guid>
		<description>No, I will not rethink I do it because I am crazy. ;-)</description>
		<content:encoded><![CDATA[<p>No, I will not rethink I do it because I am crazy. <img src='http://robertnyman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-45053</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 28 Mar 2007 15:06:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-45053</guid>
		<description>AndrÃƒÂ©,

Thanks. :-)</description>
		<content:encoded><![CDATA[<p>AndrÃƒÂ©,</p>
<p>Thanks. <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AndrÃƒÂ© LuÃƒÂ­s</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-45045</link>
		<dc:creator>AndrÃƒÂ© LuÃƒÂ­s</dc:creator>
		<pubDate>Wed, 28 Mar 2007 14:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-45045</guid>
		<description>I wasn&#039;t aware this was even a question. I haven&#039;t used spaces to ident code since... COBOL, where you actually have to be careful about in which column you&#039;re writing your code.

Spaces increase file size which is what we&#039;re consistently trying to reduce (in the web industry, at least). So, I say no no to spaces. Never used them, never will.

The only question I have is how many tabs to write in each line (in css, particularly). But that&#039;s because my editor doesn&#039;t allow changing the tab-size. At least, I don&#039;t think it does... gotta check that when I&#039;m back at work. :)

Thanks for the relevant questions you keep putting us, Rob. You rock. Period.</description>
		<content:encoded><![CDATA[<p>I wasn&#8217;t aware this was even a question. I haven&#8217;t used spaces to ident code since&#8230; COBOL, where you actually have to be careful about in which column you&#8217;re writing your code.</p>
<p>Spaces increase file size which is what we&#8217;re consistently trying to reduce (in the web industry, at least). So, I say no no to spaces. Never used them, never will.</p>
<p>The only question I have is how many tabs to write in each line (in css, particularly). But that&#8217;s because my editor doesn&#8217;t allow changing the tab-size. At least, I don&#8217;t think it does&#8230; gotta check that when I&#8217;m back at work. <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for the relevant questions you keep putting us, Rob. You rock. Period.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo Carrasco</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44878</link>
		<dc:creator>Ricardo Carrasco</dc:creator>
		<pubDate>Tue, 27 Mar 2007 22:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44878</guid>
		<description>I use Metapad 3.51, indenting at all is so wrong. It is very rare that I download a script and don&#039;t have to take out whitespace and trailing whitespace.</description>
		<content:encoded><![CDATA[<p>I use Metapad 3.51, indenting at all is so wrong. It is very rare that I download a script and don&#8217;t have to take out whitespace and trailing whitespace.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Allen</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44800</link>
		<dc:creator>Allen</dc:creator>
		<pubDate>Tue, 27 Mar 2007 15:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44800</guid>
		<description>I find myself disagreeing with you again and with some of the other comment posters.  The tab *character* is horrible.  There&#039;s no telling what any individual persons tabstops in a given editor will be set to.

The correct method for making your code readable across a wide range of editors and UIs is to use the tab *key*, but tell your editor to use a certain number of spaces instead of the tab *character*.

I use UltraEdit32 for just about everything and it&#039;s simple to tell it to never save tabs characters in a file and to convert them to &#039;n&#039; spaces whenever it encounters them.  Most editors have a similar capability.

If the tab key hadn&#039;t evolved from typewriters and accountants tabbing to specific columns (2 spaces, then 6, then 8, etc) then we&#039;d be ok but as it is, spaces are better.</description>
		<content:encoded><![CDATA[<p>I find myself disagreeing with you again and with some of the other comment posters.  The tab *character* is horrible.  There&#8217;s no telling what any individual persons tabstops in a given editor will be set to.</p>
<p>The correct method for making your code readable across a wide range of editors and UIs is to use the tab *key*, but tell your editor to use a certain number of spaces instead of the tab *character*.</p>
<p>I use UltraEdit32 for just about everything and it&#8217;s simple to tell it to never save tabs characters in a file and to convert them to &#8216;n&#8217; spaces whenever it encounters them.  Most editors have a similar capability.</p>
<p>If the tab key hadn&#8217;t evolved from typewriters and accountants tabbing to specific columns (2 spaces, then 6, then 8, etc) then we&#8217;d be ok but as it is, spaces are better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jrf</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44788</link>
		<dc:creator>Jrf</dc:creator>
		<pubDate>Tue, 27 Mar 2007 14:12:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44788</guid>
		<description>Oh my... Robert.. I definitely second your call for using tabs rather than spaces.

Even so, my quick &amp; dirty solution is to use the ConText or Zend IDE editor whenever someone has used spaces in their code. Both can convert tabs to spaces and visa versa without a hitch.</description>
		<content:encoded><![CDATA[<p>Oh my&#8230; Robert.. I definitely second your call for using tabs rather than spaces.</p>
<p>Even so, my quick &amp; dirty solution is to use the ConText or Zend IDE editor whenever someone has used spaces in their code. Both can convert tabs to spaces and visa versa without a hitch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44754</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Tue, 27 Mar 2007 10:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44754</guid>
		<description>Wow, apparently this was an interesting topic! :-)

In the end, it sounds like it&#039;s mostly about environment settings; if you can tune how spaces vs. tabs are handled, and you can agree within the team, it&#039;s either way.

Personally, I think it&#039;s harder/more annoying to edit a file with space indentation since it&#039;s far harder to make sure that all spaces are consistent throughout the file.

And last, but not least, when i comes to HTML, CSS and JavaScript it will affect the file size that the end user has to download, so in those languages I&#039;m strongly for tabs.</description>
		<content:encoded><![CDATA[<p>Wow, apparently this was an interesting topic! <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In the end, it sounds like it&#8217;s mostly about environment settings; if you can tune how spaces vs. tabs are handled, and you can agree within the team, it&#8217;s either way.</p>
<p>Personally, I think it&#8217;s harder/more annoying to edit a file with space indentation since it&#8217;s far harder to make sure that all spaces are consistent throughout the file.</p>
<p>And last, but not least, when i comes to HTML, CSS and JavaScript it will affect the file size that the end user has to download, so in those languages I&#8217;m strongly for tabs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: halans</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44746</link>
		<dc:creator>halans</dc:creator>
		<pubDate>Tue, 27 Mar 2007 09:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44746</guid>
		<description>In regards to Java, the Sun Java/JSP code conventions states:
&quot;Indentations should be filled with space characters. Tab characters cause different interpretation in the spacing of characters in different editors. A unit of indentation corresponds to 4 space characters.&quot; And that&#039;s what we use at work. Everyone is &quot;encouraged&quot; to use the same settings, as else keeping track of or merging changes in CVS/SVN becomes quite hard. Eclipse can be set to automatically convert tabs to X spaces. Checkstyle and FormatOnSave plugins help you to keep your code formatted according to company policy.
For CSS I use TopStyle to expand and collapse the code, as extra characters do make a difference in bytes in the end.
My 2c.</description>
		<content:encoded><![CDATA[<p>In regards to Java, the Sun Java/JSP code conventions states:<br />
&#8220;Indentations should be filled with space characters. Tab characters cause different interpretation in the spacing of characters in different editors. A unit of indentation corresponds to 4 space characters.&#8221; And that&#8217;s what we use at work. Everyone is &#8220;encouraged&#8221; to use the same settings, as else keeping track of or merging changes in CVS/SVN becomes quite hard. Eclipse can be set to automatically convert tabs to X spaces. Checkstyle and FormatOnSave plugins help you to keep your code formatted according to company policy.<br />
For CSS I use TopStyle to expand and collapse the code, as extra characters do make a difference in bytes in the end.<br />
My 2c.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lachlan Hunt</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44671</link>
		<dc:creator>Lachlan Hunt</dc:creator>
		<pubDate>Tue, 27 Mar 2007 01:08:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44671</guid>
		<description>oh well, my use of the pre element got stripped, so my examples are kind of messed up.   Heres&#039; the CSS again using dots for alignment instead of spaces:

&lt;code&gt;body { background: white; color: black;
.......font: medium sans-serif; text-align: justify; }&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>oh well, my use of the pre element got stripped, so my examples are kind of messed up.   Heres&#8217; the CSS again using dots for alignment instead of spaces:</p>
<p><code>body { background: white; color: black;<br />
.......font: medium sans-serif; text-align: justify; }</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lachlan Hunt</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44670</link>
		<dc:creator>Lachlan Hunt</dc:creator>
		<pubDate>Tue, 27 Mar 2007 01:05:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44670</guid>
		<description>I don&#039;t format my CSS like that, so my indentation technique doesn&#039;t really apply to those that do.  I use spaces for alignment in CSS.  This is how I lay out my CSS: (It would normally wrap at roughly 80-100 chars, but you should get the idea.

body { background: white; color: black;
       font: medium sans-serif; text-align: justify; }

I find that technique most suitable for CSS because it&#039;s nice and compact and allows me to see and work with so much more on one screen than other techniques, like one-property-per-line, etc.


For other code, JavaScript and other programming languages, I use an appropriate mix of tabs and spaces to work around the alignment problems that occur with different settings.  In other words, tabs for indentation and spaces for alignment.

Note: Underscores represent tabs, dots represent spaces.

function.foo().{
____var a.......=.1;
____var longvar.=.2;

____if.(a.!=.b.........// A multi-line comment that
____.&amp;&amp;.c.!=.d).{......// is aligned using spaces
________doSomething();
____}
}


Here&#039;s the same code again using actual spaces and tabs for indentation:

function foo() {
	var a       = 1;
	var longvar = 2;

	if (a != b         // A multi-line comment that
	 &amp;&amp; c != d) {      // is aligned using spaces
		doSomething();
	}
}

As far as I&#039;m concerned, that&#039;s the only sensible aproach.  Tabs for everything (including alignment) isn&#039;t acceptable because it breaks in editors with different settings.  Spaces for everything is acceptable on the condition that exactly 4 spaces are used for each indentation level.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t format my CSS like that, so my indentation technique doesn&#8217;t really apply to those that do.  I use spaces for alignment in CSS.  This is how I lay out my CSS: (It would normally wrap at roughly 80-100 chars, but you should get the idea.</p>
<p>body { background: white; color: black;<br />
       font: medium sans-serif; text-align: justify; }</p>
<p>I find that technique most suitable for CSS because it&#8217;s nice and compact and allows me to see and work with so much more on one screen than other techniques, like one-property-per-line, etc.</p>
<p>For other code, JavaScript and other programming languages, I use an appropriate mix of tabs and spaces to work around the alignment problems that occur with different settings.  In other words, tabs for indentation and spaces for alignment.</p>
<p>Note: Underscores represent tabs, dots represent spaces.</p>
<p>function.foo().{<br />
____var a&#8230;&#8230;.=.1;<br />
____var longvar.=.2;</p>
<p>____if.(a.!=.b&#8230;&#8230;&#8230;// A multi-line comment that<br />
____.&amp;&amp;.c.!=.d).{&#8230;&#8230;// is aligned using spaces<br />
________doSomething();<br />
____}<br />
}</p>
<p>Here&#8217;s the same code again using actual spaces and tabs for indentation:</p>
<p>function foo() {<br />
	var a       = 1;<br />
	var longvar = 2;</p>
<p>	if (a != b         // A multi-line comment that<br />
	 &amp;&amp; c != d) {      // is aligned using spaces<br />
		doSomething();<br />
	}<br />
}</p>
<p>As far as I&#8217;m concerned, that&#8217;s the only sensible aproach.  Tabs for everything (including alignment) isn&#8217;t acceptable because it breaks in editors with different settings.  Spaces for everything is acceptable on the condition that exactly 4 spaces are used for each indentation level.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pat</title>
		<link>http://robertnyman.com/2007/03/26/indentation-of-code/#comment-44665</link>
		<dc:creator>Pat</dc:creator>
		<pubDate>Tue, 27 Mar 2007 00:41:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.robertnyman.com/2007/03/26/indentation-of-code/#comment-44665</guid>
		<description>I like spaces, however I prefer the tab key.. so in all my coding, be it Perl, CSS, HTML, I&#039;ve used EditPlus forever, and I configured it so my tabs turn out to be spaces (like Eric said). I made my editor do that because I noticed with tabs, my code looked all weird and off indentation wise when I viewed source. I&#039;ve found that spaces are much better when viewing your files in different editors.. everything looks like I wanted it to.

If you&#039;re not careful this could turn into obsessive behaviour {{guilty}} :).</description>
		<content:encoded><![CDATA[<p>I like spaces, however I prefer the tab key.. so in all my coding, be it Perl, CSS, HTML, I&#8217;ve used EditPlus forever, and I configured it so my tabs turn out to be spaces (like Eric said). I made my editor do that because I noticed with tabs, my code looked all weird and off indentation wise when I viewed source. I&#8217;ve found that spaces are much better when viewing your files in different editors.. everything looks like I wanted it to.</p>
<p>If you&#8217;re not careful this could turn into obsessive behaviour {{guilty}} <img src='http://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
</channel>
</rss>
