 
    
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code Archives - Complete, Concrete, Concise</title>
	<atom:link href="https://complete-concrete-concise.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>https://complete-concrete-concise.com/tag/code/</link>
	<description>Practical Information Without The Bloat</description>
	<lastBuildDate>Fri, 22 Mar 2019 20:02:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Comments in HTML and CSS</title>
		<link>https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/comments-in-html-and-css/</link>
		
		<dc:creator><![CDATA[richardsplanet]]></dc:creator>
		<pubDate>Mon, 11 Feb 2019 15:36:32 +0000</pubDate>
				<category><![CDATA[Front-End Basics]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html5]]></category>
		<guid isPermaLink="false">https://complete-concrete-concise.com/?p=3789</guid>

					<description><![CDATA[<p>Comments help to document and explain your code to others and your future self.</p>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/comments-in-html-and-css/">Comments in HTML and CSS</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="preamble">
<p>An important part of coding is documenting your code with comments</p>
</div>
<h2 id="contents">Contents</h2>
<ol class="incremental" type="1">
<li><a href="#introduction-to-comments">Introduction to Comments</a></li>
<li><a href="#html-comments">HTML Comments</a></li>
<li><a href="#css-comments">CSS Comments</a></li>
<li><a href="#guidelines-for-writing-good-comments">Guidelines for Writing Good Comments</a></li>
<li><a href="#final-words">Final Words</a></li>
<li><a href="#references">References</a></li>
</ol>
<h2 id="introduction-to-comments">Introduction to Comments</h2>
<p>In a perfect world, code would be self documenting and as you read it from top to bottom you would perfectly understand its structure and behaviour.</p>
<p>In the real world &#8211; except for trivial code examples (the kind you fit in a dozen lines or less and can keep in your head) &#8211; understanding any significant piece of code takes considerable effort.</p>
<p>Comments are textual information that are added to the code to help document the code. Comments do not affect the behaviour of the code in any way and are ignored when the code is processed. Comments are there to help humans understand the code easier &#8211; but only if they are useful and accurate.</p>
<h2 id="html-comments">HTML Comments</h2>
<p>HTML comments begin with <code>&lt;!--</code> and end with <code>--&gt;</code>. In between those characters, you can have almost any type of text string you like and it can span multiple lines.</p>
<div class="sourceCode" id="cb1">
<pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb1-1" title="1"><span class="co">&lt;!--This is an HTML comment--&gt;</span></a>
<a class="sourceLine" id="cb1-2" title="2"></a>
<a class="sourceLine" id="cb1-3" title="3"><span class="co">&lt;!-- While a space is not necessary after</span></a>
<a class="sourceLine" id="cb1-4" title="4"><span class="co">     the opening characters, it does make it</span></a>
<a class="sourceLine" id="cb1-5" title="5"><span class="co">     easier to read and avoid certain problems --&gt;</span></a>
<a class="sourceLine" id="cb1-6" title="6"></a>
<a class="sourceLine" id="cb1-7" title="7"><span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb1-8" title="8"><span class="co">  You can also put the comment markers on</span></a>
<a class="sourceLine" id="cb1-9" title="9"><span class="co">  separate lines to make it a little neater.</span></a>
<a class="sourceLine" id="cb1-10" title="10"><span class="co">--&gt;</span></a>
<a class="sourceLine" id="cb1-11" title="11"></a>
<a class="sourceLine" id="cb1-12" title="12"><span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb1-13" title="13"><span class="co">  The HTML code inside this comment</span></a>
<a class="sourceLine" id="cb1-14" title="14"><span class="co">  will never be processed.</span></a>
<a class="sourceLine" id="cb1-15" title="15"></a>
<a class="sourceLine" id="cb1-16" title="16"><span class="co">  &lt;div&gt;</span></a>
<a class="sourceLine" id="cb1-17" title="17"><span class="co">    &lt;div&gt;</span></a>
<a class="sourceLine" id="cb1-18" title="18"><span class="co">      &lt;p&gt;A paragraph inside divs&lt;/p&gt;</span></a>
<a class="sourceLine" id="cb1-19" title="19"><span class="co">    &lt;/div&gt;</span></a>
<a class="sourceLine" id="cb1-20" title="20"><span class="co">  &lt;/div&gt;</span></a>
<a class="sourceLine" id="cb1-21" title="21"></a>
<a class="sourceLine" id="cb1-22" title="22"><span class="co">--&gt;</span></a></code></pre>
</div>
<p>The specification has a few rules regarding HTML comments:</p>
<ol class="incremental" type="1">
<li>the text must not start with the string <code>&gt;</code>,</li>
<li>nor start with the string <code>-&gt;</code>,</li>
<li>nor contain the strings <code>&lt;!--</code>, <code>--&gt;</code>, or <code>--!&gt;</code>, +</li>
<li>nor end with the string <code>&lt;!-</code></li>
</ol>
<p>Basically, as long as you don’t try to nest HTML comments inside HTML comments, you will be fine.</p>
<div class="sourceCode" id="cb2">
<pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb2-1" title="1"><span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb2-2" title="2"><span class="co">  &lt;!</span><span class="er">--</span><span class="co"> Nested comments are bad --&gt;</span></a>
<a class="sourceLine" id="cb2-3" title="3">--&gt;</a></code></pre>
</div>
<h2 id="css-comments">CSS Comments</h2>
<p>CSS comments begin with <code>/*</code> and end with <code>*/</code>. In between those characters you can have almost any types of text string you like and it can span multiple lines.</p>
<div class="sourceCode" id="cb3">
<pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb3-1" title="1"><span class="co">/*This is a CSS comment*/</span></a>
<a class="sourceLine" id="cb3-2" title="2"></a>
<a class="sourceLine" id="cb3-3" title="3"><span class="co">/* A leading space makes the comment</span></a>
<a class="sourceLine" id="cb3-4" title="4"><span class="co">   easier to read */</span></a>
<a class="sourceLine" id="cb3-5" title="5"></a>
<a class="sourceLine" id="cb3-6" title="6"><span class="co">/*</span></a>
<a class="sourceLine" id="cb3-7" title="7"><span class="co">   You can also put the comment markers on</span></a>
<a class="sourceLine" id="cb3-8" title="8"><span class="co">   separate lines to make it a little neater.</span></a>
<a class="sourceLine" id="cb3-9" title="9"><span class="co">*/</span></a>
<a class="sourceLine" id="cb3-10" title="10"></a>
<a class="sourceLine" id="cb3-11" title="11"><span class="co">/*</span></a>
<a class="sourceLine" id="cb3-12" title="12"><span class="co">   The CSS code inside this comment</span></a>
<a class="sourceLine" id="cb3-13" title="13"><span class="co">   will never be processed.</span></a>
<a class="sourceLine" id="cb3-14" title="14"></a>
<a class="sourceLine" id="cb3-15" title="15"><span class="co">   .my-style {</span></a>
<a class="sourceLine" id="cb3-16" title="16"><span class="co">     font-size: 24px;</span></a>
<a class="sourceLine" id="cb3-17" title="17"><span class="co">     color: green;</span></a>
<a class="sourceLine" id="cb3-18" title="18"><span class="co">     padding: 5px;</span></a>
<a class="sourceLine" id="cb3-19" title="19"><span class="co">     background: orange;</span></a>
<a class="sourceLine" id="cb3-20" title="20"><span class="co"> }</span></a>
<a class="sourceLine" id="cb3-21" title="21"></a>
<a class="sourceLine" id="cb3-22" title="22"><span class="co">*/</span>   </a></code></pre>
</div>
<p>As with HTML comments, you cannot nest CSS comments, so the first <code>*/</code> will always end the comment:</p>
<div class="sourceCode" id="cb4">
<pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb4-1" title="1"><span class="co">/*</span></a>
<a class="sourceLine" id="cb4-2" title="2"><span class="co">  /* Nested comments are bad */</span></a>
<a class="sourceLine" id="cb4-3" title="3"><span class="op">*</span>/</a></code></pre>
</div>
<h2 id="guidelines-for-writing-good-comments">Guidelines for Writing Good Comments</h2>
<p>Comments are written for two types of audience:</p>
<ol class="incremental" type="1">
<li>Your future self</li>
<li>Others</li>
</ol>
<p>Your future self (technically speaking) is somebody else because, 6 months or a year or 10 years in the future, you are unlikely to still be in the same frame of mind as when you wrote the code. So everything that was “obvious” when you were writing your code is no longer <em>obvious</em>.</p>
<p>Comments are written for two different purposes:</p>
<ol class="incremental" type="1">
<li>Documenting (<strong>what</strong> you are doing)</li>
<li>Clarifying (<strong>why</strong> you are doing it)</li>
</ol>
<p>Comments should answer the questions: <strong>what</strong> and <strong>why</strong>. The <strong>how</strong> is answered by the code itself because that is the implementation.</p>
<p>Let’s comment the <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/your-first-webpage-hello-world/">first HTML program we encountered</a> in this tutorial series:</p>
<div class="sourceCode" id="cb5">
<pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb5-1" title="1"><span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-2" title="2"><span class="co">  The following is not HTML, it is a document declaration.</span></a>
<a class="sourceLine" id="cb5-3" title="3"><span class="co">  It tells the browser what type of document it is.</span></a>
<a class="sourceLine" id="cb5-4" title="4"><span class="co">  It is case-insensitive. This declaration tells the</span></a>
<a class="sourceLine" id="cb5-5" title="5"><span class="co">  browser that all the code that follows is HTML5 code.</span></a>
<a class="sourceLine" id="cb5-6" title="6"><span class="co">--&gt;</span></a>
<a class="sourceLine" id="cb5-7" title="7"><span class="dt">&lt;!DOCTYPE </span>HTML<span class="dt">&gt;</span></a>
<a class="sourceLine" id="cb5-8" title="8"></a>
<a class="sourceLine" id="cb5-9" title="9"><span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-10" title="10"><span class="co">  This is an HTML tag and marks the start of the HTML</span></a>
<a class="sourceLine" id="cb5-11" title="11"><span class="co">  document.</span></a>
<a class="sourceLine" id="cb5-12" title="12"></a>
<a class="sourceLine" id="cb5-13" title="13"><span class="co">  There is a corresponding closing tag &lt;/html&gt;. Most</span></a>
<a class="sourceLine" id="cb5-14" title="14"><span class="co">  HTML tags come in pairs.</span></a>
<a class="sourceLine" id="cb5-15" title="15"><span class="co">--&gt;</span></a>
<a class="sourceLine" id="cb5-16" title="16"><span class="kw">&lt;html&gt;</span></a>
<a class="sourceLine" id="cb5-17" title="17"></a>
<a class="sourceLine" id="cb5-18" title="18">  <span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-19" title="19"><span class="co">     The head section contains metadata (a fancy way of</span></a>
<a class="sourceLine" id="cb5-20" title="20"><span class="co">     saying information) about the document. Things which</span></a>
<a class="sourceLine" id="cb5-21" title="21"><span class="co">     are not part of the content of the document tend to</span></a>
<a class="sourceLine" id="cb5-22" title="22"><span class="co">     go in this section.</span></a>
<a class="sourceLine" id="cb5-23" title="23"></a>
<a class="sourceLine" id="cb5-24" title="24"><span class="co">     There is a corresponding closing tag &lt;/head&gt; which</span></a>
<a class="sourceLine" id="cb5-25" title="25"><span class="co">     marks the end of the head section</span></a>
<a class="sourceLine" id="cb5-26" title="26"><span class="co">  --&gt;</span></a>
<a class="sourceLine" id="cb5-27" title="27">  <span class="kw">&lt;head&gt;</span></a>
<a class="sourceLine" id="cb5-28" title="28"></a>
<a class="sourceLine" id="cb5-29" title="29">    <span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-30" title="30"><span class="co">      The title of the document. Typically appears in</span></a>
<a class="sourceLine" id="cb5-31" title="31"><span class="co">      the browser tab.</span></a>
<a class="sourceLine" id="cb5-32" title="32"><span class="co">    --&gt;</span></a>
<a class="sourceLine" id="cb5-33" title="33">    <span class="kw">&lt;title&gt;</span>Hello World<span class="kw">&lt;/title&gt;</span></a>
<a class="sourceLine" id="cb5-34" title="34"></a>
<a class="sourceLine" id="cb5-35" title="35">    <span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-36" title="36"><span class="co">      Use UTF-8 character encoding for this page. In</span></a>
<a class="sourceLine" id="cb5-37" title="37"><span class="co">      general, it should always be UTF-8.</span></a>
<a class="sourceLine" id="cb5-38" title="38"><span class="co">    --&gt;</span></a>
<a class="sourceLine" id="cb5-39" title="39">    <span class="kw">&lt;meta</span><span class="ot"> charset=</span><span class="st">&quot;utf-8&quot;</span>  <span class="kw">/&gt;</span></a>
<a class="sourceLine" id="cb5-40" title="40"></a>
<a class="sourceLine" id="cb5-41" title="41">  <span class="kw">&lt;/head&gt;</span> <span class="co">&lt;!-- The end of the head section --&gt;</span></a>
<a class="sourceLine" id="cb5-42" title="42"></a>
<a class="sourceLine" id="cb5-43" title="43">  <span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-44" title="44"><span class="co">    The body section contains the content that is</span></a>
<a class="sourceLine" id="cb5-45" title="45"><span class="co">    displayed in the web browser.</span></a>
<a class="sourceLine" id="cb5-46" title="46"></a>
<a class="sourceLine" id="cb5-47" title="47"><span class="co">    There is a corresponding closing tag &lt;/body&gt; which</span></a>
<a class="sourceLine" id="cb5-48" title="48"><span class="co">    marks the end of the body section.</span></a>
<a class="sourceLine" id="cb5-49" title="49"><span class="co">  --&gt;</span></a>
<a class="sourceLine" id="cb5-50" title="50">  <span class="kw">&lt;body&gt;</span></a>
<a class="sourceLine" id="cb5-51" title="51"></a>
<a class="sourceLine" id="cb5-52" title="52">    <span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb5-53" title="53"><span class="co">      Content is, generally, contained between paragraph</span></a>
<a class="sourceLine" id="cb5-54" title="54"><span class="co">      tags.</span></a>
<a class="sourceLine" id="cb5-55" title="55"><span class="co">    --&gt;</span></a>
<a class="sourceLine" id="cb5-56" title="56">    <span class="kw">&lt;p&gt;</span>Hello World!<span class="kw">&lt;/p&gt;</span></a>
<a class="sourceLine" id="cb5-57" title="57"></a>
<a class="sourceLine" id="cb5-58" title="58">  <span class="kw">&lt;/body&gt;</span> <span class="co">&lt;!-- The end of the body section --&gt;</span></a>
<a class="sourceLine" id="cb5-59" title="59"><span class="kw">&lt;/html&gt;</span> <span class="co">&lt;!-- The end of the HTML document --&gt;</span></a></code></pre>
</div>
<p>In general, you shouldn’t comment as extensively as I did in the example above &#8211; but for a tutorial it is fine.</p>
<p>When you are learning, it is a good idea to comment freely &#8211; explain what you are doing and why you are doing it. As your knowledge develops, you will find yourself documenting less and less.</p>
<p>Your comments should document why you are doing something. For example, you might have a requirement for a particular type of webpage, you could embed the webpage description as a comment:</p>
<div class="sourceCode" id="cb6">
<pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb6-1" title="1"><span class="co">&lt;!-- This is a page with a single column layout that has</span></a>
<a class="sourceLine" id="cb6-2" title="2"><span class="co">     the following general structure:</span></a>
<a class="sourceLine" id="cb6-3" title="3"></a>
<a class="sourceLine" id="cb6-4" title="4"><span class="co">     Header</span></a>
<a class="sourceLine" id="cb6-5" title="5"><span class="co">     Navbar</span></a>
<a class="sourceLine" id="cb6-6" title="6"><span class="co">     body of articles</span></a>
<a class="sourceLine" id="cb6-7" title="7"><span class="co">     Footer</span></a>
<a class="sourceLine" id="cb6-8" title="8"></a>
<a class="sourceLine" id="cb6-9" title="9"><span class="co">     The body has a width of 960px and is centered on the</span></a>
<a class="sourceLine" id="cb6-10" title="10"><span class="co">     page.</span></a>
<a class="sourceLine" id="cb6-11" title="11"></a>
<a class="sourceLine" id="cb6-12" title="12"><span class="co">     Each article in the body is a card which fits the full</span></a>
<a class="sourceLine" id="cb6-13" title="13"><span class="co">     width of the body less 35px padding on the left and</span></a>
<a class="sourceLine" id="cb6-14" title="14"><span class="co">     right side.</span></a>
<a class="sourceLine" id="cb6-15" title="15"></a>
<a class="sourceLine" id="cb6-16" title="16"><span class="co">     Each card consists of an image with a 16:9 aspect</span></a>
<a class="sourceLine" id="cb6-17" title="17"><span class="co">     ratio, a title with a font-size of 24px, followed</span></a>
<a class="sourceLine" id="cb6-18" title="18"><span class="co">     by a byline at 12px and a published date (also 12px)</span></a>
<a class="sourceLine" id="cb6-19" title="19"><span class="co">     The text content of the card has a font size of 16px.</span></a>
<a class="sourceLine" id="cb6-20" title="20"><span class="co">--&gt;</span></a></code></pre>
</div>
<p>Of course, this information could be in an external design document instead of the webpage.</p>
<p>The big problem is maintaining the code comments up to date. You have to be diligent to ensure that you update the comments when making changes to the code that don’t do what the comments say.</p>
<p>I recommend you comment freely as you learn to develop. Comment what you have learned:</p>
<div class="sourceCode" id="cb7">
<pre class="sourceCode html"><code class="sourceCode html"><a class="sourceLine" id="cb7-1" title="1"><span class="co">&lt;!--</span></a>
<a class="sourceLine" id="cb7-2" title="2"><span class="co">  There are two kinds of HTML lists:</span></a>
<a class="sourceLine" id="cb7-3" title="3"><span class="co">  - ordered &lt;ol&gt; and</span></a>
<a class="sourceLine" id="cb7-4" title="4"><span class="co">  - unordered &lt;ul&gt;.</span></a>
<a class="sourceLine" id="cb7-5" title="5"></a>
<a class="sourceLine" id="cb7-6" title="6"><span class="co">  List can take and attribute called &#39;reversed&#39; todo</span></a>
<a class="sourceLine" id="cb7-7" title="7"><span class="co">  display the list in reverse order.</span></a>
<a class="sourceLine" id="cb7-8" title="8"><span class="co">--&gt;</span></a>
<a class="sourceLine" id="cb7-9" title="9"></a>
<a class="sourceLine" id="cb7-10" title="10"><span class="kw">&lt;p&gt;</span>Normal list ordering:<span class="kw">&lt;/p&gt;</span></a>
<a class="sourceLine" id="cb7-11" title="11"><span class="kw">&lt;ol&gt;</span></a>
<a class="sourceLine" id="cb7-12" title="12">  <span class="kw">&lt;li&gt;</span>Item one<span class="kw">&lt;/li&gt;</span></a>
<a class="sourceLine" id="cb7-13" title="13">  <span class="kw">&lt;li&gt;</span>Item two<span class="kw">&lt;/li&gt;</span></a>
<a class="sourceLine" id="cb7-14" title="14">  <span class="kw">&lt;li&gt;</span>Item three<span class="kw">&lt;/li&gt;</span></a>
<a class="sourceLine" id="cb7-15" title="15"><span class="kw">&lt;/ol&gt;</span></a>
<a class="sourceLine" id="cb7-16" title="16"></a>
<a class="sourceLine" id="cb7-17" title="17"><span class="kw">&lt;p&gt;</span>Reversed list ordering:<span class="kw">&lt;/p&gt;</span></a>
<a class="sourceLine" id="cb7-18" title="18"><span class="kw">&lt;ol</span><span class="ot"> reversed</span><span class="kw">&gt;</span></a>
<a class="sourceLine" id="cb7-19" title="19">  <span class="kw">&lt;li&gt;</span>Item one<span class="kw">&lt;/li&gt;</span></a>
<a class="sourceLine" id="cb7-20" title="20">  <span class="kw">&lt;li&gt;</span>Item two<span class="kw">&lt;/li&gt;</span></a>
<a class="sourceLine" id="cb7-21" title="21">  <span class="kw">&lt;li&gt;</span>Item three<span class="kw">&lt;/li&gt;</span></a>
<a class="sourceLine" id="cb7-22" title="22"><span class="kw">&lt;/ol&gt;</span></a></code></pre>
</div>
<p>Eventually, you will stop writing mundane comments.</p>
<p>You should avoid commenting what is obvious from reading the code because it adds nothing to the information:</p>
<div class="sourceCode" id="cb8">
<pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb8-1" title="1"><span class="fu">.header</span> {</a>
<a class="sourceLine" id="cb8-2" title="2">  <span class="co">/* set the background color to blue */</span></a>
<a class="sourceLine" id="cb8-3" title="3">  <span class="kw">background-color</span>: <span class="cn">blue</span><span class="op">;</span></a>
<a class="sourceLine" id="cb8-4" title="4">}</a></code></pre>
</div>
<p>But you can document specific requirements:<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></p>
<div class="sourceCode" id="cb9">
<pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb9-1" title="1"><span class="fu">.header</span> {</a>
<a class="sourceLine" id="cb9-2" title="2">  <span class="kw">background-color</span>: <span class="cn">#1DA1F2</span><span class="op">;</span> <span class="co">/* Twitter blue */</span></a>
<a class="sourceLine" id="cb9-3" title="3">}</a></code></pre>
</div>
<p>One use of comments is to structure your code:</p>
<div class="sourceCode" id="cb10">
<pre class="sourceCode css"><code class="sourceCode css"><a class="sourceLine" id="cb10-1" title="1"><span class="co">/* Global */</span></a>
<a class="sourceLine" id="cb10-2" title="2"></a>
<a class="sourceLine" id="cb10-3" title="3"></a>
<a class="sourceLine" id="cb10-4" title="4"><span class="co">/* Header */</span></a>
<a class="sourceLine" id="cb10-5" title="5"></a>
<a class="sourceLine" id="cb10-6" title="6"></a>
<a class="sourceLine" id="cb10-7" title="7"><span class="co">/* Content */</span></a>
<a class="sourceLine" id="cb10-8" title="8"></a>
<a class="sourceLine" id="cb10-9" title="9"></a>
<a class="sourceLine" id="cb10-10" title="10"><span class="co">/* Footer */</span></a></code></pre>
</div>
<p>Unfortunately, your code won’t always cooperate to break down into such nice clear categories.</p>
<h2 id="final-words">Final Words</h2>
<ol class="incremental" type="1">
<li>Comment your code freely.</li>
<li>Don’t comment anything that is obvious.</li>
<li>You can explain <strong>what</strong> you are doing.</li>
<li>You can explain <strong>why</strong> you are doing something.</li>
<li>Don’t explain <strong>how</strong> how you are doing something because that is the code itself.</li>
<li>Keep your comments up to date (in general, you should avoid comments that could be rendered obsolete)</li>
</ol>
<h2 id="references">References</h2>
<ol class="incremental" type="1">
<li><a href="https://html.spec.whatwg.org/multipage/syntax.html#comments">HTML comments</a></li>
<li><a href="https://www.w3.org/TR/CSS21/syndata.html#comments">CSS comments</a></li>
</ol>
<div class="prev">
<p><a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/a-quick-introduction-to-two-development-tools-built-into-your-browser/">Prev</a></p>
</div>
<div class="next">
<p><a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/css-understanding-inheritance-and-default-values/">Next</a></p>
</div>
<div class="clear">
</div>
<section class="footnotes">
<hr />
<ol>
<li id="fn1">
<p><a href="https://about.twitter.com/content/dam/about-twitter/company/brand-resources/en_us/Twitter_Brand_Guidelines_V2_0.pdf">Read more about Twitter’s brand requirements</a>. Many organizations and companies have very specific rules regarding the use of colours or fonts or any other aspects that are associated with their brand.<a href="#fnref1" class="footnote-back">↩</a></p>
</li>
</ol>
</section>
<p>The post <a href="https://complete-concrete-concise.com/tutorials/webdev/front-end-basics/comments-in-html-and-css/">Comments in HTML and CSS</a> appeared first on <a href="https://complete-concrete-concise.com">Complete, Concrete, Concise</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
