<?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>Documentation Archives - Symatech Labs</title>
	<atom:link href="https://symatechlabs.com/tag/documentation/feed/" rel="self" type="application/rss+xml" />
	<link>https://symatechlabs.com/tag/documentation/</link>
	<description>We at Symatech Labs Limited believe Great Software solves Great Problems. Our services range from Desktop Software Development to Mobile Application Development. Over the years we have been able to develop software for reputable organisations and that has never changed.</description>
	<lastBuildDate>Sat, 11 Nov 2023 06:38:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://symatechlabs.com/wp-content/uploads/2023/07/cropped-logo_2401x1067-32x32.png</url>
	<title>Documentation Archives - Symatech Labs</title>
	<link>https://symatechlabs.com/tag/documentation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How Code can be documented</title>
		<link>https://symatechlabs.com/how-code-can-be-documented/</link>
		
		<dc:creator><![CDATA[Brian Osoro]]></dc:creator>
		<pubDate>Fri, 04 Nov 2022 15:09:19 +0000</pubDate>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Code Documentation]]></category>
		<category><![CDATA[Documentation]]></category>
		<guid isPermaLink="false">https://www.symatechlabs.com/blog/?p=112</guid>

					<description><![CDATA[<p>How Code can be documented   Documentation is the instruction manual that explains how code is structured and, consequently, how it works. This is often accomplished by outlining the arguments that the function or method anticipates, the body of the function, and the results of the function. For a variety of reasons, code documentation is [&#8230;]</p>
<p>The post <a href="https://symatechlabs.com/how-code-can-be-documented/">How Code can be documented</a> appeared first on <a href="https://symatechlabs.com">Symatech Labs</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="112" class="elementor elementor-112">
									<section class="elementor-section elementor-top-section elementor-element elementor-element-fe490f0 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="fe490f0" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-528e2dd" data-id="528e2dd" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
								<div class="elementor-element elementor-element-5736068 elementor-widget elementor-widget-heading" data-id="5736068" data-element_type="widget" data-widget_type="heading.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.14.0 - 26-06-2023 */
.elementor-heading-title{padding:0;margin:0;line-height:1}.elementor-widget-heading .elementor-heading-title[class*=elementor-size-]>a{color:inherit;font-size:inherit;line-height:inherit}.elementor-widget-heading .elementor-heading-title.elementor-size-small{font-size:15px}.elementor-widget-heading .elementor-heading-title.elementor-size-medium{font-size:19px}.elementor-widget-heading .elementor-heading-title.elementor-size-large{font-size:29px}.elementor-widget-heading .elementor-heading-title.elementor-size-xl{font-size:39px}.elementor-widget-heading .elementor-heading-title.elementor-size-xxl{font-size:59px}</style><h4 class="elementor-heading-title elementor-size-default">How Code can be documented<br></h4>		</div>
				</div>
				<div class="elementor-element elementor-element-287cf11 elementor-widget elementor-widget-image" data-id="287cf11" data-element_type="widget" data-widget_type="image.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.14.0 - 26-06-2023 */
.elementor-widget-image{text-align:center}.elementor-widget-image a{display:inline-block}.elementor-widget-image a img[src$=".svg"]{width:48px}.elementor-widget-image img{vertical-align:middle;display:inline-block}</style>												<img fetchpriority="high" decoding="async" width="1000" height="420" src="https://symatechlabs.com/wp-content/uploads/2022/11/ttbzcx5npi9al3gaqfly.webp" class="attachment-large size-large wp-image-113" alt="Code documentation" srcset="https://symatechlabs.com/wp-content/uploads/2022/11/ttbzcx5npi9al3gaqfly.webp 1000w, https://symatechlabs.com/wp-content/uploads/2022/11/ttbzcx5npi9al3gaqfly-300x126.webp 300w, https://symatechlabs.com/wp-content/uploads/2022/11/ttbzcx5npi9al3gaqfly-768x323.webp 768w" sizes="(max-width: 1000px) 100vw, 1000px" />															</div>
				</div>
					</div>
		</div>
							</div>
		</section>
				<section class="elementor-section elementor-top-section elementor-element elementor-element-5179ab5 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="5179ab5" data-element_type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-6a707f2a" data-id="6a707f2a" data-element_type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
								<div class="elementor-element elementor-element-65952c63 elementor-widget elementor-widget-text-editor" data-id="65952c63" data-element_type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
			<style>/*! elementor - v3.14.0 - 26-06-2023 */
.elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}</style>				
<p> </p>
<p>Documentation is the instruction manual that explains how code is structured and, consequently, how it works. This is often accomplished by outlining the arguments that the function or method anticipates, the body of the function, and the results of the function. For a variety of reasons, code documentation is important. Well-documented code is simpler to maintain and update, and future developers will have a better understanding of the codebase as they will know where to make modifications when adjustments are required. Documentation may also assist in learning from the errors we made today so that we don&#8217;t make the same ones again when working on future projects. </p>

<h2 class="wp-block-heading"> </h2>
<h2>Nobody Has Time For Documentation</h2>

<p>Rarely do we have time to stop everything we&#8217;re doing and concentrate on documenting our code when working on a project that has a deadline. Whatever you are doing, there&#8217;s a good chance you or a colleague will need to review the source code at some point. It will be difficult to recall what you wrote and why as clearly as it was on that day. And even if you get to remember what you wrote, there might be some edge instances or particular uses that aren&#8217;t immediately obvious. Documentation becomes the obvious option.</p>

<p>Spending a little more time now to properly describe the work you did will pay off in the long run. The next time someone wants to understand what happens inside your code, you will only have to point them to the detailed documentation. Both you and they will save time since you won&#8217;t need to explain things to them, and they will save time because they won&#8217;t need to rely on you.</p>

<h2 class="wp-block-heading"> </h2>
<h2>Some Principles To Consider</h2>

<ol class="wp-block-list">
<li>The documentation should not be ambiguous but precise and to the point.</li>

<li>In terms of context, it should be from the point of view of the person reading the code.</li>

<li>Assume the person reading your code knows nothing.</li>

<li>Should describe how the codebase has been organized in terms of structure and how the various components interact. A description of the design pattern used is equally important. </li>

<li>Document bugs and how they got solved.</li>

<li>Document changes made to the code and why they were made.</li>

<li>Making use of glossaries to aid the reader in understanding terms that directly relate to a subject</li>

<li>The documentation needs to be up to date, updates/changes made to the codebase would require a similar update in the documentation for relevance. </li>

<li>Documentation should be a collaborative affair more so if the codebase had more than one author.</li>

<li>Getting rid of what is not being used <em>dead </em>is essential especially when the same could become a source of misinformation. </li>
</ol>

<p> </p>

<h2 class="wp-block-heading"> </h2>
<h2>Nested Code</h2>

<p>Conditionals are primarily responsible for nested code. We can&#8217;t really get rid of conditionals because they are the foundation of all programming logic. We must be aware of how they affect the reading of the source code.</p>

<p>An important aspect when reading nested code is the number of levels the nested code has. The more levels, the more complicated it gets when reading the source code. When reading source code, we ideally intend to create a mental model of the program’s behavior. Readable code requires less effort to create and maintain the mental model than code that is hard to read. </p>

<p>An example of nested code, as you can see, it takes some time for one to get around and there’s a possibility of misinterpreting what the code intends to achieve.</p>
<p> </p>

<p><img decoding="async" src="https://lh5.googleusercontent.com/hH3QcMv8Z5v_BSBguEugqVutMfirqcDDVVXKxjvqxFBrO_7G7mbkj4TyXtxpBwQ3CXleqkgDadSU-JEUm5jUyj_fKJjyAhI9iKMoFvOluZlirFP67UQEmnLd_fLRz_CLCFHpGT2LAEvErbxPjgTMIXMx7MN99yz1ah5lz5HFJsFJD1NRpQuox2kqnFdgxg" width="444" height="682" /></p>

<p>The above code snippet is an example of nested code, its understanding is subjective to the author and will be difficult for anyone else to understand and create a mental model. Possible solutions for this could be:</p>

<ol class="wp-block-list">
<li>Document each line of the code to give a detailed explanation of what was to be achieved. </li>

<li>Refactor the different nested blocks into separate functions.</li>

<li>Use of <a href="https://deviq.com/design-patterns/guard-clause">guard clauses</a></li>
</ol>

<p> </p>

<h2 class="wp-block-heading">Example</h2>

<p>Below are screenshots and the actual Java files demonstrating how the documentation has been done on the selected classes. It is a part of a bigger project that can be found <a href="https://bit.ly/3Uzg2AL" target="_blank" rel="noreferrer noopener">here</a></p>

<p>Link to the documentation example: <a href="https://bit.ly/3UuF4kd" target="_blank" rel="noreferrer noopener">https://bit.ly/3UuF4kd </a></p>

<p> </p>

<p><a href="https://symatechlabs.com/contact-us/" target="_blank" rel="noreferrer noopener">Symatech L</a><a href="https://symatechlabs.com/" target="_blank" rel="noreferrer noopener">abs</a> is a Software Development company based in Nairobi, Kenya that specializes in Software Development, Mobile App Development, Web Application Development, Integrations, USSD and Consultancy.</p>
						</div>
				</div>
					</div>
		</div>
							</div>
		</section>
							</div>
		<p>The post <a href="https://symatechlabs.com/how-code-can-be-documented/">How Code can be documented</a> appeared first on <a href="https://symatechlabs.com">Symatech Labs</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
