<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1036613" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1036613</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210985</link>
    <description> &lt;p&gt;I think if your company uses closed/proprietary software then yes you should use the company standards (which I think should be based on some standard).&lt;/p&gt;
&lt;p&gt;But I think with Open Source there should be a common standard, and not individual standards that are preferable to the developer.&lt;/p&gt;
 </description>
     <pubDate>Mon, 27 Nov 2006 10:39:55 +0000</pubDate>
 <dc:creator>infocom</dc:creator>
 <guid isPermaLink="false">comment 1210985 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210963</link>
    <description> &lt;p&gt;I find myself using the &quot;bad&quot; method most of the time.  When I work on something with a friend of mine, I use the &quot;good&quot; method, just because that is what he uses.&lt;/p&gt;
&lt;p&gt;All the scripting/programming books I&#039;ve ever read say that the right way is the way the company you work for/with uses.  If they say &quot;do it this way,&quot; then you do it that way.  Otherwise, do it how you feel comfortable.  That&#039;s the glory of using languages where spacing doesn&#039;t matter.&lt;/p&gt;
&lt;p&gt;As for an editor, I use &lt;a href=&quot;http://www.crimsoneditor.com/&quot; class=&quot;bb-url&quot;&gt;Crimson&lt;/a&gt; for just about everything.&lt;/p&gt;
 </description>
     <pubDate>Sun, 26 Nov 2006 19:55:14 +0000</pubDate>
 <dc:creator>olcore</dc:creator>
 <guid isPermaLink="false">comment 1210963 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210795</link>
    <description> &lt;p&gt;I will try Emacs. Think I tried it some time ago on linux. Always thought it was a *nix only system but can see on the link you gave its Windows too.&lt;/p&gt;
&lt;p&gt;Perhaps its the indentation, or combination with, which makes it unreadable then. Perhaps better indentation would improve identifying the blocks using that style.&lt;/p&gt;
&lt;p&gt;Pewrhaps I just need to get used to &quot;spotting&quot; the blocks. Maybe I am not used to it and that&#039;s why. Maybe its possible to train yourself to spot it better.&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 Nov 2006 10:14:12 +0000</pubDate>
 <dc:creator>infocom</dc:creator>
 <guid isPermaLink="false">comment 1210795 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210788</link>
    <description> &lt;p&gt;Your &quot;bad&quot; example is the K&amp;amp;R style.  It comes from the Kernighan and Ritchie book The &lt;em&gt;C Programming Language&lt;/em&gt;.  It&#039;s good mainly because it doesn&#039;t waste a line for a single brace, which means you can fit more on the screen (or page) vertically -- to avoid &quot;loads of scrolling&quot;.  Note that the header is aligned with the closing brace; with sufficient visual emphasis (bold, colour) on the opening keyword, you won&#039;t need the brace on the next line to identify blocks.&lt;/p&gt;
&lt;p&gt;Your &quot;good&quot; example is the Allman style.  There are a few other popular ones, see the Wikipedia article on &lt;a href=&quot;http://en.wikipedia.org/wiki/Indent_style&quot; class=&quot;bb-url&quot;&gt;indent style&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Adding extra indentation can make K&amp;amp;R style equally readable.  In fact, I think your second example is more readable for that reason.  Use 8-space indents on the first and it will look much better.  You padded the first snippet in a great deal extra too.&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;infocom wrote:&lt;/strong&gt;&lt;br /&gt;
Perhaps I should try some other editors/IDEs. Any other you recommend?&lt;/p&gt;
&lt;p&gt;I just think that if something can be done better, it should be. I dont see why a not so good a system should be used for old times sake, if a better one exists.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;May I suggest &lt;a href=&quot;http://www.gnu.org/software/emacs/&quot; class=&quot;bb-url&quot;&gt;Emacs&lt;/a&gt;?  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;infocom wrote:&lt;/strong&gt; Perhaps if everyone used the second example there would be no reason to develop editors to identify the blocks.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;No way, block-level editing is useful for many, many other reasons.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 Nov 2006 03:28:01 +0000</pubDate>
 <dc:creator>Abhishek Reddy</dc:creator>
 <guid isPermaLink="false">comment 1210788 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210784</link>
    <description> &lt;p&gt;I always do the opening brace on a separate line because it is easier to read.  It seems that people prefer method #1 to save space, but I don&#039;t understand the point of saving space.  Generally, the more spread out it is, the more easier it is to read.  I have many organizational spaces in my code.&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Nov 2006 23:37:22 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1210784 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210778</link>
    <description> &lt;p&gt;lol... again I do:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#div {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; color: black;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-weight: bold;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 10px;&lt;br /&gt;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Nov 2006 21:21:13 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1210778 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210775</link>
    <description> &lt;p&gt;Yeah, I use Notepad++ now and this also highlights the opening and closing brackets, but this doesn&#039;t help if it is off the screen. You have to do loads of scrolling. Perhaps I should try some other editors/IDEs. Any other you recommend?&lt;/p&gt;
&lt;p&gt;I just think that if something can be done better, it should be. I dont see why a not so good a system should be used for old times sake, if a better one exists. I read somewhere the first style is a Unix based style so I think it must just have been around for some time and people just use the system they are familiar with. &lt;/p&gt;
&lt;p&gt;Or does my bad example have advantages over the second? Perhaps I am missing something, but I just cant see why it should be used when the second one is more clear. I dont think because we have editors to identify blocks is a good enough reason for staying with it. Perhaps if everyone used the second example there would be no reason to develop editors to identify the blocks.&lt;/p&gt;
&lt;p&gt;Similarly in stylesheets! &lt;/p&gt;
&lt;p&gt;I hate this:-&lt;br /&gt;
&lt;code&gt;#div { color: black; font-weight: bold; font-size: 10px; }&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;Arrrgghhh!!&lt;/p&gt;
&lt;p&gt;Why not this:-&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#div&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; color: black;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-weight: bold;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 10px;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Its just easier to identify.&lt;/p&gt;
&lt;p&gt;I wish there was a LAW and when something better came out everyone had to go and change their code to the better one ha ha!&lt;/p&gt;
&lt;p&gt;Thanks for your replies! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Nov 2006 19:26:19 +0000</pubDate>
 <dc:creator>infocom</dc:creator>
 <guid isPermaLink="false">comment 1210775 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210774</link>
    <description> &lt;p&gt;That&#039;s what I was thinking. Usually after I put a line break or two before a new block so I can see it clearly i.e.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;if($x == $y) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $thisblock = &amp;quot;different&amp;quot;;&lt;br /&gt;&lt;br /&gt;} else {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $thisblock = &amp;quot;whatever&amp;quot;;&lt;br /&gt;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Which I find to be just as clear.&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Nov 2006 17:49:46 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1210774 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210773</link>
    <description> &lt;p&gt;While I usually use the second method, I think both are just fine as long as you stay consistant with the indentation. The example you gave, I could read both just fine (although on your &quot;bad&quot; xample, the first line&#039;s indentation didn&#039;t match the rest).&lt;/p&gt;
&lt;p&gt;With so many good IDE&#039;s now for PHP, either method is easy to deug now. I like how Zend Studio will find matching brackets and highlight them. One really nice thing is say the if statement is scrolled off of the top of the screen, putting the cursor at the brackt, it will show the line for the matching bracket at the top so you can see what you are matching even though the code isn&#039;t on the screen &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Nov 2006 17:42:14 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1210773 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/coding-standards-blocks-code-why-do-people-use-bad-one#comment-1210772</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: I work with a lot of developers and only one of them uses the second method.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;That&#039;s the problem!&lt;/p&gt;
 </description>
     <pubDate>Mon, 20 Nov 2006 17:24:10 +0000</pubDate>
 <dc:creator>infocom</dc:creator>
 <guid isPermaLink="false">comment 1210772 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
