<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tony Hicks</title>
    <description>The latest articles on DEV Community by Tony Hicks (@tonyhicks20).</description>
    <link>https://dev.to/tonyhicks20</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F34648%2F1411a0e6-c49d-4825-b2b1-bc28ab3beaed.JPG</url>
      <title>DEV Community: Tony Hicks</title>
      <link>https://dev.to/tonyhicks20</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tonyhicks20"/>
    <language>en</language>
    <item>
      <title>The Power of Convention</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Sat, 16 Sep 2023 06:00:00 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/the-power-of-convention-4hd8</link>
      <guid>https://dev.to/tonyhicks20/the-power-of-convention-4hd8</guid>
      <description>&lt;p&gt;While doing some investigation into &lt;a href="https://www.avaloniaui.net/"&gt;AvaloniaUI&lt;/a&gt;, I came across some great open-source projects that use it and was delighted to find that they follow the more conventional, modern ways of setting up a C# project. I just want to specifically talk about my experience when looking at the &lt;a href="https://github.com/TolikPylypchuk/KeyboardSwitch/blob/master/KeyboardSwitch/Program.cs"&gt;startup code&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Keeping all the config and bootstrapping code in one, easy to find and read place makes it a pleasure to see what's going on in the project at a moment's glance. &lt;/p&gt;

&lt;p&gt;I see environment variables being set, the projects dependencies - what needs to be registered (and some idea why), command line arguments that it accepts, background jobs being hosted and all the other things that you'd expect from a non-trivial application written in modern day C#. &lt;/p&gt;

&lt;p&gt;This tells me many things about the code. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Whoever wrote this cared enough to make this maintainable for themselves and everyone else - they took the time to follow industry standard conventions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I can expect a certain standard of code quality from this project - It is probably written using decent SOLID principles and hopefully a sane amount of Object Oriented design. Why do I think this? Because looking at the way the dependencies are loaded, and just browsing to look at the code inside a few, it's clear what each portion of the code is responsible for, and what other parts of the system it interacts with. One could easily trace the pieces together with a diagram, and you'd probably be able to follow it without it looking like a bird's nest of dependency overlap.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The code is easy to isolate and therefore test if need be - seeing this approach gives me a level of confidence that the code is written in a way that the dependencies are clear and  any static classes used do not hold any state. This may be false, by the way. The subsystems may be a total mess! But seeing the almost unspoken conventions that they've adhered to, gives me a good feeling in the design of their software. I have a high degree of confidence that they have adhered to other, familiar ways of structuring an application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I already know how to configure this because I'm familiar with the dependencies used. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;i.e)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ServiceCollection for the DI container&lt;/li&gt;
&lt;li&gt;Extension methods on ServiceCollection used to register subsystems &lt;/li&gt;
&lt;li&gt;Option objects for setting on the services&lt;/li&gt;
&lt;li&gt;Serilog for logging&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It makes me realize how far we've come in the .NET world from the days of opening a new project and seeing a completely different DI container being used, each having different ways of doing the same thing, or even worse - performing all sorts of highly customized, black magic that is tough to understand and also to debug (looking at you Castle.Windsor). &lt;/p&gt;

&lt;p&gt;It's amazing how much convention plays a role in our daily lives and how useful it is. I don't just mean inside of .NET projects. All of software benefits from conventions and the more widespread, the more transferable and useful they are. &lt;/p&gt;

&lt;p&gt;Just think of the rules of the road while driving. It's great to go to most places in the world and still be able to drive there. This convention is not always enforced but even when it isn't, people still follow it to some degree because it minimizes the chance of something bad happening.&lt;/p&gt;

&lt;p&gt;It's why opinionated frameworks like Angular have always drawn me more then React - Angular projects generally have pre-defined conventions, whereas the less opinionated ones tend to have a bespoke, naturally-evolved one or, worse, something that has been fitted retro-actively which always leads to inconsistencies in the codebase (rewriting is a lie). &lt;br&gt;
You always end up with a convention - a "right" or a "wrong" way to do things in any project. I just prefer to have that as clearly defined as possible and is widely known and understood. &lt;/p&gt;

&lt;p&gt;Backend code in general has also benefited by convention in the now, pretty much universal, Web API. All the conventional business 3rd party integrations I've done as well as new backend applications I've written in the past few years have all been Web API's. JSON and Web API's have become the default choice.&lt;/p&gt;

&lt;p&gt;No more needing to deal with weird compatibility issues of WCF and Autofac. Trying to debug WCF services with their strange policy of breaking whenever the smallest thing is wrong with the data contract, and then being completely obscure when it comes to telling you exactly what the problem was. Downloading and parsing files over FTP and parsing them with complex XML code, or managing a custom, delimited format. Nope - it's all Rest API's, JSON and OpenAPI (Swagger) documentation. &lt;/p&gt;

&lt;p&gt;None of this is new though. Conventions are basically loose versions of protocols. As our software stacks mature, natural ones begin to emerge and I'm excited to see that happen more in the software I deal with. Everything becomes so much simpler and I don't see how that's a bad thing for anyone.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>angular</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Angular two way binding between parent and child components</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Thu, 28 Jul 2022 07:11:27 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/angular-two-way-binding-between-parent-and-child-components-16kl</link>
      <guid>https://dev.to/tonyhicks20/angular-two-way-binding-between-parent-and-child-components-16kl</guid>
      <description>&lt;p&gt;In Angular, it's well known how to pass data from the parent component to the child. What I would like to demonstrate is how in Angular with two way binding we can ensure that changes in the child are also propagated to the parent when needed.&lt;/p&gt;

&lt;p&gt;To see a working example, check out the &lt;a href="https://stackblitz.com/edit/angular-ivy-wmflay"&gt;stackblitz&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's have a look first at input properties!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;templateUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./child.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;ChildComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;//Input() decorator means that &lt;/span&gt;
  &lt;span class="c1"&gt;//we can pass parameters to this component&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we can make use of it from a parent component like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;child&lt;/span&gt; &lt;span class="na"&gt;[count]=&lt;/span&gt;&lt;span class="s"&gt;"counterOnParent"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this means now is that whenever the parent modifies the variable (counterOnParent) that's being passed to the child component, the child will also receive the new value in its input (@Input()) variable.&lt;/p&gt;

&lt;p&gt;Ok, so far so good. &lt;/p&gt;

&lt;p&gt;What would happen to the variable in the parent if we modified it in the child component though?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;templateUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./child.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;ChildComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;//What will happen to the value in the parent? &lt;/span&gt;
  &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Well it turns out... nothing. The parent is not notified of this change that was made in the child. Which may not be a problem, unless we are also modifying it in the parent. This can lead to some strange results as can be seen in the first example in the &lt;a href="https://stackblitz.com/edit/angular-ivy-wmflay"&gt;stackblitz&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Let's have a look at some pseudocode as an example of what happens exactly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//parent.count: 1, child.count: 1&lt;/span&gt;
&lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//parent.count: 2, child.count: 2&lt;/span&gt;
&lt;span class="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;//parent.count: 2, child.count: 3&lt;/span&gt;
&lt;span class="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;//parent.count: 2, child.count: 4&lt;/span&gt;
&lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="c1"&gt;//parent.count: 3, child.count: 3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note how in the last line, the child count goes back to match the parent state. &lt;/p&gt;

&lt;p&gt;You may have noticed that this problem is because we are managing two different pieces of state (one in the parent and one in the child) and they are going out of sync. By modifying the value in the child, we are breaking the usual data flow that Angular expects in this case, which is from parent to child. Not child to parent.  &lt;/p&gt;

&lt;h2&gt;
  
  
  The solution
&lt;/h2&gt;

&lt;p&gt;It's best to keep the flow of data changes from parent to child. &lt;br&gt;
This is where two-way binding comes in. It's fortunately such a commonly used pattern in Angular that there is a convention for creating it. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Create an EventEmitter with the same name as the input variable but with the word "Change" appended to it.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;child&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;templateUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./child.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;ChildComponent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="nx"&gt;countChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;EventEmitter&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="nx"&gt;increment&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countChange&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;emit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now the usage from the parent is like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;child&lt;/span&gt; &lt;span class="na"&gt;[(count)]=&lt;/span&gt;&lt;span class="s"&gt;"counterOnParent"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see we are combining the syntax for binding to input properties (square brackets) and binding to an event (round brackets). Since we've used this convention that Angular understands there was no need to specify the actual event name on the parent! &lt;/p&gt;

&lt;p&gt;Now everytime the child component wants to change it's variable value, instead of modifying it directly, it will send an event to the parent which will change its variable and propogate it appropriately in the correct data flow direction. &lt;/p&gt;

&lt;p&gt;We can see this in the second example of the &lt;a href="https://stackblitz.com/edit/angular-ivy-wmflay"&gt;stackblitz&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Happy coding :-) &lt;/p&gt;

</description>
      <category>angular</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Automatically organize imports</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Tue, 12 Oct 2021 13:00:40 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/automatically-organize-imports-dmj</link>
      <guid>https://dev.to/tonyhicks20/automatically-organize-imports-dmj</guid>
      <description>&lt;p&gt;While refactoring your javascript/typescript code it's easy to remove things but forget to get rid of the unused imports.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hHymgPer--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfb04yf67dur21b7gotn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hHymgPer--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfb04yf67dur21b7gotn.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In VSCode, you can easily remove these with the shortcut : Shift + Alt + O. &lt;br&gt;
This is sometimes easy to forget to do though, and wouldn't it be better if there was some way to do this automatically every time you save? &lt;/p&gt;

&lt;p&gt;In VSCode, go to File -&amp;gt; Preferences -&amp;gt; Settings and click on the icon in the top right hand corner to open up the settings in JSON.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--icIjwqpl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l9eab8h2071qde0goq7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--icIjwqpl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l9eab8h2071qde0goq7z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add the following json:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"editor.codeActionsOnSave": {
    "source.organizeImports": true
},
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So that it looks something like the following: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NhBbTEzo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojdjwjz7fs2svtz6nnkp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NhBbTEzo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojdjwjz7fs2svtz6nnkp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Et voilà! &lt;br&gt;
Your imports will now be organized every time you save a file. &lt;br&gt;
Enjoy :-)&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>typescript</category>
      <category>javascript</category>
      <category>tip</category>
    </item>
    <item>
      <title>Microservices and Multiple Technologies</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Wed, 18 Sep 2019 09:36:28 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/microservices-and-multiple-technologies-39hc</link>
      <guid>https://dev.to/tonyhicks20/microservices-and-multiple-technologies-39hc</guid>
      <description>&lt;p&gt;Running your system in smaller, &lt;a href="https://dev.to/tonyhicks20/microservices-and-multiple-delivery-streams-35g4"&gt;independently deployable&lt;/a&gt;  and &lt;a href="https://dev.to/tonyhicks20/microservices-and-enforced-modularity-b1h"&gt;isolated modules&lt;/a&gt; allows you to use whatever technology that can suite your problem the best for that particular business domain. &lt;/p&gt;

&lt;p&gt;Since each service is self-contained, and the only way in which it can be communicated with is via the publicly-defined interface of the service, it means that pretty much whatever happens behind the public interface is the sole business of your service! So, &lt;em&gt;in theory&lt;/em&gt;, you are free to use whatever technology that your tech-crazed heart desires! &lt;/p&gt;

&lt;h2&gt;
  
  
  Why would you want to do this?
&lt;/h2&gt;

&lt;p&gt;There's a very (I think) over-used expression in the software world that says: "if all you have is a hammer, everything looks like a nail". &lt;/p&gt;

&lt;p&gt;Sometimes you are using the incorrect tool for the job that you are trying to do. In a monolithic codebase, however, it can be difficult to change since you may find that you would need to change everything at once which would be too risky and time-consuming. Since &lt;strong&gt;micro&lt;/strong&gt;services are small, you could experiment by changing the underlying technology for a portion of your system while leaving the remainder of the system unchanged. You can then test this thoroughly in your staging environment and determine whether or not it does better than the existing technology. &lt;/p&gt;

&lt;p&gt;This is not necessarily just good for trying new technologies out and fixing a technical problem, but it can &lt;em&gt;also help your business by expanding the pool of developers to hire from&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If, for example, your company does only Java for the backend, but good Java developers are difficult for your company to find and employ, and the company has seen that there are a lot of good Python developers in the market, then you could, again - &lt;strong&gt;in theory&lt;/strong&gt;, now start to hire python developers! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/xT0xeJpnrWC4XWblEk/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/xT0xeJpnrWC4XWblEk/giphy.gif" alt="Mind Blown"&gt;&lt;/a&gt;&lt;/p&gt;
Coming to an HR department near you!



&lt;h2&gt;
  
  
  The potential problems with this
&lt;/h2&gt;

&lt;p&gt;Using new technology - whether that is a new framework, language, database - comes with more overheads than simply you, sitting at your computer and learning to use it. &lt;/p&gt;

&lt;p&gt;There will be quirks with it, hidden gotcha's that will come out of the woodwork when you least expect it. The grass is not always greener on the other side of the fence. Are the risks worth the potential rewards?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/GCjIE9C9Eb9V6/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/GCjIE9C9Eb9V6/giphy.gif" alt="Look at the grass"&gt;&lt;/a&gt;&lt;/p&gt;
Is the grass greener because it's fake?



&lt;p&gt;What about other people learning the new tech? Are the other developers willing to put in the time and effort to become familiar with it? &lt;/p&gt;

&lt;p&gt;How about maintenance? Many companies have DBA's that are familiar with the types of databases they use. Adding a new one to the company will require involvement from them too. &lt;/p&gt;

&lt;p&gt;What about down-stream reporting? How will the new database fit into the existing business processes? &lt;/p&gt;

&lt;p&gt;Adding new technology to your system will require some potentially big shifts in your organization in order to be successful!&lt;/p&gt;

&lt;h2&gt;
  
  
  It's good to have the option
&lt;/h2&gt;

&lt;p&gt;Even if you never use a different technology for a particular service, &lt;br&gt;
it's still really good to be able to if needed! Even if in the future the system becomes legacy and needs to be rewritten, at least it can now be done in isolated portions rather than a big bang approach often needed by large enterprise systems.&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Microservices and Multiple Delivery Streams</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Wed, 11 Sep 2019 11:38:28 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/microservices-and-multiple-delivery-streams-35g4</link>
      <guid>https://dev.to/tonyhicks20/microservices-and-multiple-delivery-streams-35g4</guid>
      <description>&lt;p&gt;Your work's been done for days. You've tested it, the QA team has tested it. The product owners have tested it and everyone on board wants it to go from staging to production. There's just one problem - Someone else's code has been merged in and is causing issues. It's not even in the same part of the system as yours but it's now in your staging branch and it's too tied up with other code to responsibly cherry-pick the changes you want into a release. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/o5oLImoQgGsKY/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/o5oLImoQgGsKY/giphy.gif" alt="Waiting"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you're now stuck waiting for that code to be fixed and tested before you can ship your code. Sound familiar? &lt;/p&gt;

&lt;h2&gt;
  
  
  Enter Microservices
&lt;/h2&gt;

&lt;p&gt;Going the microservices route means that you've divided up your codebase into smaller, separate &lt;a href="https://dev.to/tonyhicks20/microservices-and-enforced-modularity-b1h"&gt;modules&lt;/a&gt;. Each module is basically (as much as possible) a self-contained entity that can be deployed individually without having to worry too much about what is ready in other services.&lt;/p&gt;

&lt;p&gt;In fact, it's a good idea to think of each service as their own little completely separate company! Just like when integrating with 3rd parties, they are free to make changes to their systems and deploy on their own schedule. &lt;/p&gt;

&lt;p&gt;No more waiting for other parts of the system to be ready! Deploy your changes!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/l0MYt5jPR6QX5pnqM/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/l0MYt5jPR6QX5pnqM/giphy.gif" alt="Party!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, not quite. Microservices still needs to communicate with each other and maybe the outside world. So if you're changing any of the public-facing aspects of your service, you will have to ensure that you version your calls properly and provide backwards compatibility so that the other parts of your system still works after deploying your service. &lt;/p&gt;

&lt;p&gt;Also, your deployment may still be blocked if your service is dependent on new changes being deployed in a different service and &lt;strong&gt;that&lt;/strong&gt; service is blocked! &lt;/p&gt;

&lt;p&gt;You have to always remember that your service will have clients and also be a client to other services. &lt;/p&gt;

&lt;p&gt;Unfortunately, microservices won't solve your interdependency woes but if you do a good job in identifying the bounded context of your service, &lt;em&gt;most&lt;/em&gt; of your changes will be internal, which means that you absolutely can deploy whenever your service is ready. &lt;/p&gt;

&lt;h2&gt;
  
  
  Do you &lt;strong&gt;really&lt;/strong&gt; need microservices to achieve this?
&lt;/h2&gt;

&lt;p&gt;Probably not. I just wanted to highlight that this is another benefit of using this architecture. &lt;/p&gt;

&lt;p&gt;You could achieve something quite similar if you create environments for feature branches and have the business test on these environments before merging the new changes into staging or production. This, however, is not a trivial thing to set up. &lt;/p&gt;

&lt;h2&gt;
  
  
  But wait, there's more
&lt;/h2&gt;

&lt;p&gt;An additional benefit of the separation of your codebase is the fact that you can now secure portions of your code from specific people. Maybe you don't want the junior developers touching the core logic of the system? &lt;/p&gt;

&lt;p&gt;You can now achieve this by simply denying them access to that service's code.&lt;/p&gt;

&lt;p&gt;Again, it's not the only way to solve this - You should have automated unit and integration tests to ensure this doesn't happen and branch policies with a code review done by at least 3 senior devs and the catholic pope for good measure - but in my experience, what should happen and what does happen are generally two very different things. &lt;/p&gt;

&lt;p&gt;Some projects have no tests. Unit tests can miss things, integration tests may be slow and only get run once in a while. It's possible for even senior devs to miss things and the pope may just be too busy that day to attempt to exorcise your code (I've been asked to please stop calling the Vatican). &lt;/p&gt;

&lt;p&gt;So just in the case of enforcing modularity because of making it impossible to directly reference code that you shouldn't, it also creates the opportunity to make it impossible for people to change parts of the system that they shouldn't.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/BoIUmD3M39B0rTCF4I/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/BoIUmD3M39B0rTCF4I/giphy.gif" alt="Hallelujah!"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Microservices and Enforced Modularity</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Tue, 10 Sep 2019 08:34:12 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/microservices-and-enforced-modularity-b1h</link>
      <guid>https://dev.to/tonyhicks20/microservices-and-enforced-modularity-b1h</guid>
      <description>&lt;h2&gt;
  
  
  What is modularity in your code?
&lt;/h2&gt;

&lt;p&gt;Heard of the Single Responsibility principle? It's basically the same thing but instead of applying it to a single class, we apply it to an interconnected set of code - A bounded context (to borrow a term from Domain Driven Design). &lt;/p&gt;

&lt;p&gt;Similarly to a class, as a module you want your code to be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;lowly coupled - be careful about how many and what kind of dependencies you create&lt;/li&gt;
&lt;li&gt;highly cohesive - you want the code in your module to be closely related&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many programming languages by default have a mechanism of logically grouping code together. &lt;br&gt;
In C# for example, we have namespaces. In Java, packages.&lt;/p&gt;

&lt;p&gt;You isolate this portion of code and give it a name that represents the purpose of it, being very careful as to what you make it dependent on since any external dependency could be coupling your module to something else. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yMCyF0X6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/mgzkz4viq576i17zyk11.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yMCyF0X6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/mgzkz4viq576i17zyk11.jpg" alt="Red Green Class Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If an external module needs to communicate, then you would define a public interface as a means of facilitating that need!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T77_R01i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/989xu1nihmirluucnvm0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T77_R01i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/989xu1nihmirluucnvm0.jpg" alt="Correct Module Communication"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why would you want to do this?
&lt;/h2&gt;

&lt;p&gt;Because it logically breaks your system into smaller, isolated chunks instead of having one big ball of spaghetti! If all your code is allowed to be referenced anywhere, regardless of the business context, it becomes extremely difficult to follow. &lt;/p&gt;

&lt;h2&gt;
  
  
  The difficulties in a single codebase
&lt;/h2&gt;

&lt;p&gt;You can (and should!) create modular software in any application - but it can be challenging if you have a single codebase since there are no actual physical restrictions about where to put your code. &lt;/p&gt;

&lt;p&gt;Someone can easily &lt;strong&gt;break the design principles&lt;/strong&gt; of the module since you can simply reference other portions of the code and bring them in. &lt;/p&gt;

&lt;h3&gt;
  
  
  Like So:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vWIzVfGg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/gb93iysjsgemehstmfk8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vWIzVfGg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/gb93iysjsgemehstmfk8.jpg" alt="Incorrect Module Communication"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/xT39Dd9GsrpvWAsjXa/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/xT39Dd9GsrpvWAsjXa/giphy.gif" alt="Watching You"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, don't forget about the database! In a single codebase, generally, there's also a single database - which means that even though your code can be pristinely separated, your queries can now create dependencies across modules since you can join across different contexts!&lt;/p&gt;

&lt;h2&gt;
  
  
  How do the microservices come in?
&lt;/h2&gt;

&lt;p&gt;Microservices helps this scenario by creating a physical restriction since the code and the database becomes divided up into smaller, isolated portions. &lt;/p&gt;

&lt;p&gt;You can take a module (or a few!), turn this into a microservice and now it's not so easy to add a piece of code from somewhere else in the system from where it doesn't belong. Still possible, but not as simple as joining a table or importing a new namespace! &lt;/p&gt;

&lt;p&gt;Not only that but since each microservice must have its own database, you cannot query across different domains either.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/TkERwbWzAxvfa/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/TkERwbWzAxvfa/giphy.gif" alt="Thumbs Up"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Thought experiment - Create your own degree </title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Sat, 28 Oct 2017 21:12:00 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/thought-experiment---create-your-own-degree-480</link>
      <guid>https://dev.to/tonyhicks20/thought-experiment---create-your-own-degree-480</guid>
      <description>&lt;p&gt;If you had to make a syllabus for a degree, what would you deem essential for an aspiring software developer to learn and why?&lt;/p&gt;

&lt;p&gt;What has been your experience with developers that do vs. don't have a computer related degree?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>education</category>
      <category>thoughtexperiment</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Good Coding Manners</title>
      <dc:creator>Tony Hicks</dc:creator>
      <pubDate>Wed, 25 Oct 2017 08:31:43 +0000</pubDate>
      <link>https://dev.to/tonyhicks20/good-coding-manners-d3e</link>
      <guid>https://dev.to/tonyhicks20/good-coding-manners-d3e</guid>
      <description>&lt;p&gt;Having recently taken over a project with a LOT of legacy and bad practices in it, I'd like to lay out  some general guidelines of using code as a means of communication and how to respect your craft and fellow craftsmen that have to work with and/or take over from you. &lt;/p&gt;

&lt;p&gt;Why are software developers needed? Is it to write and maintain code? &lt;br&gt;
I'd argue no. &lt;/p&gt;

&lt;p&gt;Coding is a means to an end. Not the end in itself. It's merely the tool that we use in order to accomplish specific business cases. Without those business cases, there would be no need for developers. &lt;br&gt;
If we had a medium that we could express ourselves better in, we would probably use that instead of code. &lt;/p&gt;

&lt;p&gt;Our job is to bring order out of chaos.&lt;br&gt;
To model the world in a way that is logical and unambiguous so that both computers and other people can understand what we are doing. If we miss those goals, we have failed as professionals. &lt;br&gt;
Note that other people are a factor here. You are not just using the code to instruct computers but also as a means of communication between yourself and others. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;The key to good communication is simplicity.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Neither the business nor your users care about how elegant your implementation of some fancy framework is, nor how many amazing design patterns you've used. &lt;br&gt;
Your job is to deliver, to get things done. &lt;br&gt;
Anything that prevents or prohibits that from happening is your enemy. &lt;/p&gt;

&lt;p&gt;I'm not saying not to use a new, shiny framework or design pattern. I'm just saying that there should be a viable use case for it. &lt;/p&gt;

&lt;p&gt;Your code will be read far more than you will write it so when in doubt, keep it simple.&lt;/p&gt;

&lt;p&gt;Modelling the real world introduces it's own complexities and there's really no need to make things harder than they should be. &lt;/p&gt;

&lt;p&gt;As such, here are some things I would've liked to instill into the people whose code I am now stuck with and often attempting to decipher.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;At some point you will have to start defining data structures and have them reference and communicate with each other. &lt;br&gt;
Have clear rules as to what is and isn't valid with regards to this.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have the code flow logically and clearly.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;There are many schools of thought here, but what I've learned that works quite well for me is to divide your system up into layers and modules that go from generic to specific. A module can communicate with another module on the same layer or a more generic one, but never a more specific layer.  This helps you to clearly see what depends on what and if the business has more needs, you can easily build on top of your more generic layers. &lt;/p&gt;

&lt;h2&gt;
  
  
  Cleanup what you don't need
&lt;/h2&gt;

&lt;p&gt;Code is not your friend, despite how you may feel about it. &lt;br&gt;
You might be super proud having written it, but it comes with a cost. Someone else (including your future-self) has to read it and understand it. It often creates dependencies on other pieces of code that now make the project that much harder to change.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If no longer needed, delete it. That's it. Don't be sentimental.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;This is what source control is for. You can always go back and get it if a particular time comes that it's needed again, but chances are, it will need major refactoring anyway. Keeping it in your existing code base means that you have to keep maintaining pieces of code that aren't providing any value to you or the business. It will also increase the learning curve of anyone new joining the team. &lt;/p&gt;

&lt;h2&gt;
  
  
  Consistency
&lt;/h2&gt;

&lt;p&gt;Define specific patterns for doing things and stick to them. &lt;/p&gt;

&lt;p&gt;"Oh, you need a particular setting for an instance of the website? It's here, you use this tool to insert it into the database and then call this service to get it into your code." &lt;/p&gt;

&lt;p&gt;That's a nice experience right? &lt;/p&gt;

&lt;p&gt;Now contrast this to what I'm dealing with now which is:&lt;/p&gt;

&lt;p&gt;"Sometimes it's in this table, but other time's it's in this other table but it can also be in these particular files because some guy in the past wanted to create a domain specific language. Someone got annoyed with that however so it's also inserted into a config file and if it's not in any of those places then it's probably in this XML file that lives with the code now."&lt;/p&gt;

&lt;p&gt;I have no issue with any one of these methods (I prefer the database whenever possible) as long as it's consistent. I have no issue with changing these things, but you then need to take the plunge and change it everywhere. &lt;/p&gt;

&lt;p&gt;Use standards so that everyone is on the same page and it's clear what is happening throughout the system. &lt;/p&gt;

&lt;p&gt;Introducing new design patterns / frameworks, basically multiple ways of achieving the same thing, adds to the complexity of the system and therefore the maintenance and learning curve. &lt;/p&gt;

&lt;h2&gt;
  
  
  Just because you can, doesn't mean you should
&lt;/h2&gt;

&lt;p&gt;I've often seen developers who learn something new and lo and behold, what a coincidence! The very next thing they get tasked with doing is the PERFECT place to try out their new toy. &lt;/p&gt;

&lt;p&gt;Please, take a step back and properly understand what is needed instead of introducing something new for the sake of it.&lt;/p&gt;

&lt;p&gt;Not everyone is the same as you. They might not be as clever, they might not be that interested in learning every single feature of the framework you have put into place. I find that the 80/20 rule works quite well in the frameworks and libraries I've used in that 80% of what I need to do can be accomplished with 20% of the capabilities of the tool in question. &lt;/p&gt;

&lt;p&gt;I've met and worked with some amazingly clever and driven people. I've also worked with MANY people who I would describe differently. That's OK and it will happen. &lt;/p&gt;

&lt;p&gt;I'm always reminded of the analogy of a mine. You have a few, highly intelligent engineers that plan how to do things and what should be done next and then you have a force of people that actually do the digging. They are both important. They both fulfill their roles and it might not be ideal, but sometimes you are going to work with people that actually don't care. &lt;/p&gt;

&lt;p&gt;The unfortunate thing is, your company might hire people like this. Yes, they can get things done but it's not going to be all that pretty and well thought of. Using every clever design pattern and framework feature you can find will completely cripple them. Junior developers as well. It also increases the risk that they may not fully understand what all the implications are when changing something and potentially cause a really big problem later.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Comments and Documentation
&lt;/h2&gt;

&lt;p&gt;I've heard people argue against these things. &lt;/p&gt;

&lt;p&gt;"Code should be self documenting" and "Documentation means you now have two places to update the same thing". &lt;/p&gt;

&lt;p&gt;I agree with those statements, but they are guidelines rather than rules. &lt;/p&gt;

&lt;p&gt;Commenting every line of code, stating &lt;strong&gt;what&lt;/strong&gt; the code does is pointless and if this is necessary, then there is something seriously wrong with your code base. &lt;/p&gt;

&lt;p&gt;However, commenting &lt;strong&gt;why&lt;/strong&gt; a specific thing has been done in a certain way can save a lot of time, effort and pain for someone later when they cannot understand why you've done something a certain way. I'm not saying this has to go everywhere, and it's always a trick to know when someone else might need this but I think as a rule of thumb, take a step back and try see your code as someone who is reading it for the first time and ask "why?".  &lt;/p&gt;

&lt;p&gt;Documentation doesn't mean taking all the functions you are writing and drawing flow diagrams for each of them. &lt;/p&gt;

&lt;p&gt;Concentrate on high-level views with important pieces of detail. &lt;/p&gt;

&lt;p&gt;Integrating with a 3rd party? Great, document the URL's with the headers/schema's that are being passed back and forth in an event sequence diagram. &lt;/p&gt;

&lt;p&gt;These types of things become unlikely to change over time and are not always clear as to who calls who, when and with what information. &lt;/p&gt;

&lt;p&gt;By no means is this a complete list of &lt;strong&gt;everything&lt;/strong&gt; you should do but these are the principles that have been on my mind the most lately due to my day-to-day dealings with this system. &lt;/p&gt;

&lt;p&gt;Let me know what you think and what I've missed!&lt;/p&gt;

&lt;p&gt;Happy coding :) &lt;/p&gt;

</description>
      <category>goodpractice</category>
      <category>career</category>
    </item>
  </channel>
</rss>
