<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="https://nielsabels.nl/feed.xml" rel="self" type="application/atom+xml" /><link href="https://nielsabels.nl/" rel="alternate" type="text/html" /><updated>2020-01-12T16:21:02+00:00</updated><id>https://nielsabels.nl/feed.xml</id><title type="html">On Developing Software</title><subtitle>on developing software</subtitle><entry><title type="html">An Introduction to the C4 Modelling Language</title><link href="https://nielsabels.nl/2020/01/06/an-introduction-to-the-c4-modelling-language.html" rel="alternate" type="text/html" title="An Introduction to the C4 Modelling Language" /><published>2020-01-06T12:28:40+00:00</published><updated>2020-01-06T12:28:40+00:00</updated><id>https://nielsabels.nl/2020/01/06/an-introduction-to-the-c4-modelling-language</id><content type="html" xml:base="https://nielsabels.nl/2020/01/06/an-introduction-to-the-c4-modelling-language.html">&lt;p&gt;The &lt;a href=&quot;https://c4model.com/&quot;&gt;C4 model&lt;/a&gt; was created between 2014 and 2017 by &lt;a href=&quot;https://twitter.com/simonbrown&quot;&gt;Simon Brown&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The C4 model was created as a way to help software development teams describe and communicate software architecture, both during up-front design sessions and when retrospectively documenting an existing codebase. It’s a way to create maps of your code, at various levels of detail, in the same way you would use something like Google Maps to zoom in and out of an area you are interested in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;the-c4-model&quot;&gt;The C4 Model&lt;/h2&gt;

&lt;p&gt;The C4 model is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Modeling_language&quot;&gt;modelling language&lt;/a&gt; with a few distinguishing characteristics. For instance, the four core diagrams are hierarchical and allow the user to explain a software system using different levels of detail, which optimizes the delivery of the information to different audiences.&lt;/p&gt;

&lt;h3 id=&quot;the-four-core-diagrams&quot;&gt;The Four Core Diagrams&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Context (highest)&lt;/li&gt;
  &lt;li&gt;Containers&lt;/li&gt;
  &lt;li&gt;Components&lt;/li&gt;
  &lt;li&gt;Code (lowest)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;context&quot;&gt;Context&lt;/h4&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Context&lt;/code&gt; level is the most abstract and shows the least amount of detail. This level shows which users are using the software, which of the systems are external and how the systems interact with your internal system. 
This level has been very helpful in my experience when you’re:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;introducing your team’s landscape to a new team member (both for technical and non-technical folk)&lt;/li&gt;
  &lt;li&gt;explaining your landscape to a different team in the organization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://res.infoq.com/articles/C4-architecture-model/en/resources/c4-4-1529935843626.jpg&quot; alt=&quot;Context&quot; /&gt;
&lt;em&gt;Level 1: A &lt;strong&gt;System Context diagram&lt;/strong&gt; provides a starting point, showing how the software system in scope fits into the world around it.&lt;/em&gt;&lt;br /&gt;
— &lt;a href=&quot;c4model.com&quot;&gt;c4model.com&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;containers&quot;&gt;Containers&lt;/h4&gt;

&lt;p&gt;At the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Containers&lt;/code&gt; level the internal system is no longer mapped as a black box. The internal system is exploded into containers, meaning &lt;a href=&quot;https://c4model.com/#ContainerDiagram&quot;&gt;deployable units&lt;/a&gt; (APIs, web applications, mobile applications, database schemas, filesystems, etc.) are shown individually.&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Containers&lt;/code&gt; level diagrams can be very helpful during team sessions (e.g. refinements) to get everybody on the same page and to reduce miscommunication. It can also be helpful in onboarding a new colleague, it’s like giving someone a map of a country/region they’re in for the first time. This serves as a tool for collaborating on deciding where the change should be implemented, and how the change should - or should not - affect its up-/downstream dependencies. When I’m new on a team and there are no architectural diagrams, I create the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Containers&lt;/code&gt; diagram first to map out the landscape. This tends to lead to interesting discussions with other developers regarding the landscape and quickens my understanding of it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://c4model.com/img/bigbankplc-Containers.png&quot; alt=&quot;Containers&quot; /&gt;
&lt;em&gt;Level 2: A &lt;strong&gt;Container diagram&lt;/strong&gt; zooms into the software system in scope, showing the high-level technical building blocks.&lt;/em&gt;&lt;br /&gt;
— &lt;a href=&quot;c4model.com&quot;&gt;c4model.com&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;components&quot;&gt;Components&lt;/h4&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Components&lt;/code&gt; level zooms in on an individual container. All users and up-/downstream dependencies (internal containers and external systems) are dropped from the diagram, except for the ones a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Component&lt;/code&gt; interfaces with directly.&lt;/p&gt;

&lt;p&gt;This diagram allows for a lot of detail. I tend to let it depend on the situation whether I choose features, layers or classes as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Components&lt;/code&gt;. There can be multiple &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Component&lt;/code&gt; diagrams for a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Container&lt;/code&gt; if that proves valuable. My rule of thumb is:  as long as the diagram does its job at explaining the internals of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Container&lt;/code&gt; significantly better than opening the solution in an &lt;a href=&quot;https://en.wikipedia.org/wiki/Integrated_development_environment&quot;&gt;IDE&lt;/a&gt;, this diagram provides value. Otherwise, it would only add to the maintenance burden of updating it every time the code changes.&lt;/p&gt;

&lt;p&gt;In my experience, this diagram has been mainly helpful when dealing with messy, counter-intuitive codebases. It did not prove valuable when solutions were well designed, small, or were following a clear pattern (such as &lt;a href=&quot;https://www.youtube.com/watch?v=th4AgBcrEHA&quot;&gt;Ports &amp;amp; Adapters&lt;/a&gt;). When creating a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Component&lt;/code&gt; diagram, start with the composition root, and map all the code paths that go to either up- or downstream dependencies. The rest are probably helper classes and can be left out.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.infoq.com/articles/C4-architecture-model/en/resources/c4-6-1529935329999.jpg&quot; alt=&quot;Components&quot; /&gt;
&lt;em&gt;Level 3: A &lt;strong&gt;Component diagram&lt;/strong&gt; zooms into an individual container, showing the components inside it.&lt;/em&gt;&lt;br /&gt;
— &lt;a href=&quot;c4model.com&quot;&gt;c4model.com&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;code&quot;&gt;Code&lt;/h4&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Code&lt;/code&gt; level removes all users, all external systems and internal containers. Furthermore, it focusses on adding technical depth to a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Component&lt;/code&gt;. Disclaimer: I’ve never felt the need to create a diagram at this level of detail, since this kind of diagram can be generated from code. For instance, by using a tool that interprets your code base and &lt;a href=&quot;https://github.com/pierre3/PlantUmlClassDiagramGenerator&quot;&gt;generates a PlantUML definition&lt;/a&gt; of a class diagram.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://res.infoq.com/articles/C4-architecture-model/en/resources/c4-7-1529935331734.jpg&quot; alt=&quot;Code&quot; /&gt;
&lt;em&gt;Level 4: A code (e.g. UML class) diagram can be used to zoom into an individual component, showing how that component is implemented.&lt;/em&gt;&lt;br /&gt;
— &lt;a href=&quot;c4model.com&quot;&gt;c4model.com&lt;/a&gt;&lt;/p&gt;

&lt;h1 id=&quot;further-reading&quot;&gt;Further reading&lt;/h1&gt;

&lt;p&gt;Check out these official resources by Simon Brown.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.infoq.com/articles/C4-architecture-model/&quot;&gt;Simon Brown - outline of the C4 model&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=x2-rSnhpw0g&amp;amp;feature=youtu.be&quot;&gt;Simon Brown - introductionary video of C4 model&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;!-- You’ll find this post in your `_posts` directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run `jekyll serve`, which launches a web server and auto-regenerates your site when a file is updated.

Jekyll requires blog post files to be named according to the following format:

`YEAR-MONTH-DAY-title.MARKUP`

Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit numbers, and `MARKUP` is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:


&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hi, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Tom'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#=&amp;gt; prints 'Hi, Tom' to STDOUT.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;


Check out the [Jekyll docs][jekyll-docs] for more info on how to get the most out of Jekyll. File all bugs/feature requests at [Jekyll’s GitHub repo][jekyll-gh]. If you have questions, you can ask them on [Jekyll Talk][jekyll-talk].

[jekyll-docs]: https://jekyllrb.com/docs/home
[jekyll-gh]:   https://github.com/jekyll/jekyll
[jekyll-talk]: https://talk.jekyllrb.com/ --&gt;</content><author><name></name></author><summary type="html">The C4 model was created between 2014 and 2017 by Simon Brown.</summary></entry><entry><title type="html">Cmder: how to show changed Git files</title><link href="https://nielsabels.nl/2019/03/21/cmder-how-to-show-changed-git-files.html" rel="alternate" type="text/html" title="Cmder: how to show changed Git files" /><published>2019-03-21T14:25:00+00:00</published><updated>2019-03-21T14:25:00+00:00</updated><id>https://nielsabels.nl/2019/03/21/cmder-how-to-show-changed-git-files</id><content type="html" xml:base="https://nielsabels.nl/2019/03/21/cmder-how-to-show-changed-git-files.html">&lt;p&gt;From the &lt;a href=&quot;https://cmder.net/&quot;&gt;cmder website&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Cmder is a software package created out of pure frustration over the absence of nice console emulators on Windows. It is based on amazing software, and spiced up with the Monokai color scheme and a custom prompt layout, looking sexy from the start.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cmder is my favorite terminal emulator for Windows, and my use has been born out of the benefits it provides over using the standard &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cmd&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;powershell&lt;/code&gt; terminals.&lt;/p&gt;

&lt;p&gt;However, Cmder is a tad spartan when it comes to showing the amount of changes when you’re in a directory holding a Git repository.&lt;/p&gt;

&lt;p&gt;Note: this does not apply to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;powershell&lt;/code&gt; terminals.&lt;/p&gt;

&lt;h1 id=&quot;showing-git-changes&quot;&gt;Showing Git changes&lt;/h1&gt;
&lt;h2 id=&quot;default-behavior&quot;&gt;Default behavior&lt;/h2&gt;

&lt;p&gt;When adding a file and removing a file from the working directory, the terminal prompt shows that &lt;em&gt;something&lt;/em&gt; has changed (and on which branch).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://imgur.com/download/3d9KIpP&quot; alt=&quot;adding-and-removing-a-file-default&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This could benefit from showing a bit more information. For instance, it would be great if our terminal window would also indicate &lt;em&gt;what&lt;/em&gt; has currently been changed.&lt;/p&gt;

&lt;h2 id=&quot;improved-behavior&quot;&gt;Improved behavior&lt;/h2&gt;

&lt;p&gt;Using a gist &lt;a href=&quot;https://gist.github.com/nielsabels/2958e8128e63f9c76020efcd21c968f1&quot;&gt;I found on GitHub&lt;/a&gt;, more insight can be gained about the changes in the current working directory.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://imgur.com/download/bRxEshC&quot; alt=&quot;adding-and-removing-a-file-improved&quot; /&gt;&lt;/p&gt;

&lt;p&gt;With the addition of the script, we’re looking at the amount of files changed. Specifically, in green, we see which files have been added (+), modified (~), deleted (-) from the current index (read: &lt;em&gt;staged for commit&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;In red, we see the same numbers regarding added, modified and deleted files. These changes are scoped to the currently &lt;em&gt;untracked&lt;/em&gt; files in the working directory.&lt;/p&gt;

&lt;h2 id=&quot;how-it-works&quot;&gt;How it works&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://gist.github.com/nielsabels/2958e8128e63f9c76020efcd21c968f1#file-git_peek-lua-L356&quot;&gt;following line in the script&lt;/a&gt; executes a command using the standard Git command-line tooling:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git -c color.status=false status --short 2&amp;gt;nul
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output of the command is translated into the graphical representation on the command prompt. Look below to see them in action simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/EMjpvht.png&quot; alt=&quot;git-c-and-status-example&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;how-to-apply-the-script&quot;&gt;How to apply the script&lt;/h2&gt;

&lt;p&gt;Save the contents of the script into a file (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git_peek.lua&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Find the directory where Cmder is installed, and place the file into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/config&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You’re done! The script will be executed when Cmder starts up.&lt;/p&gt;

&lt;h1 id=&quot;credits&quot;&gt;Credits&lt;/h1&gt;

&lt;p&gt;This script was not written by me and credits go to the original author. I’d like to &lt;a href=&quot;https://gist.github.com/mattdkerr&quot;&gt;thank the author&lt;/a&gt; for &lt;a href=&quot;https://gist.github.com/mattdkerr/23db4db40c276b1481b01b0fa26de009&quot;&gt;the gist&lt;/a&gt; that the above post is based on.&lt;/p&gt;</content><author><name></name></author><summary type="html">From the cmder website:</summary></entry></feed>