<?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: Chris Mathurin</title>
    <description>The latest articles on DEV Community by Chris Mathurin (@hatsrumandcode).</description>
    <link>https://dev.to/hatsrumandcode</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%2F61839%2F2e473e8d-a559-422b-a4ff-a1557e69f2e7.jpg</url>
      <title>DEV Community: Chris Mathurin</title>
      <link>https://dev.to/hatsrumandcode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hatsrumandcode"/>
    <language>en</language>
    <item>
      <title>Front-end development (React in this case) and the SOLID principles</title>
      <dc:creator>Chris Mathurin</dc:creator>
      <pubDate>Tue, 13 Mar 2018 02:38:12 +0000</pubDate>
      <link>https://dev.to/hatsrumandcode/front-end-development-react-in-this-case-and-solid-principles--592m</link>
      <guid>https://dev.to/hatsrumandcode/front-end-development-react-in-this-case-and-solid-principles--592m</guid>
      <description>

&lt;p&gt;Having been a full-stack developer for a number of years now, I have mainly seen SOLID mentioned (let alone enforced) when working on back-end code. Maybe a few years ago it was harder to implement, but we have libraries and framework such as Knockout, Angular, Vue and React, which should make this at least a bit easier.&lt;/p&gt;

&lt;p&gt;"&lt;a href="https://dev.to/kayis/is-react-solid-630"&gt;Is React SOLID?&lt;/a&gt;" is a short article about how React allows you to use the SOLID principles. As React is a library, it does not force you to apply any principles...&lt;/p&gt;

&lt;h2&gt;
  
  
  What does SOLID stand for?*
&lt;/h2&gt;

&lt;p&gt;SOLID is an acronym build by the first letter of 5 object-oriented programming design principles. The basic idea is, if you follow these principles, your software gets better.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S&lt;/strong&gt;ingle responsibility principle&lt;br&gt;&lt;br&gt;
&lt;strong&gt;O&lt;/strong&gt;pen/closed principle&lt;br&gt;&lt;br&gt;
&lt;strong&gt;L&lt;/strong&gt;iskov substitution principle&lt;br&gt;&lt;br&gt;
&lt;strong&gt;I&lt;/strong&gt;nterface segregation principle&lt;br&gt;&lt;br&gt;
&lt;strong&gt;D&lt;/strong&gt;ependency inversion principle&lt;/p&gt;

&lt;p&gt;In case you need a reminder, &lt;a href="https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa"&gt;here's a link&lt;/a&gt; to a good intro. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The conclusion of the article is:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;*"While React doesn't force the principles onto you, at least it often allows you to follow them. Sometimes it gets easier because of JavaScript, sometimes JavaScript makes it harder, but overall it is possible to write SOLID applications with React."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a C# developer, I definitely find it is much easier to apply SOLID to back-end code, probably because I've spent most of my time working on back-end code.  &lt;/p&gt;

&lt;p&gt;I am currently learning React, well at least trying... I know that I'll try to follow at least Single Responsibility and Open/Close principle. I am not so sure about Dependency Inversion, as front-end testing makes it much easier to test and mock your code, wherein C# you would be required abstract things using interfaces with the help of some DI mechanism. Liskov substitution perhaps, but Interface segregation probably not.  &lt;/p&gt;

&lt;p&gt;I did a spike to find out ways to implement dependency injection. Some of the things I looked into were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  InversifyJS&lt;/li&gt;
&lt;li&gt;  Redux Observable&lt;/li&gt;
&lt;li&gt;  Using the module system&lt;/li&gt;
&lt;li&gt;  PropTypes&lt;/li&gt;
&lt;li&gt;  Redux
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As we are using Redux to manage states, it made sense for us to use it for DI where (and if) required.  We are not currently enforcing the use of TypeScript in our current project, but it is something that we want to adopt as we previously trialled it while working on an Angular SPA. Using TypeScript would make applying SOLID much easier and more aligned with C#, which I think is great. C# developers should find it familiar and front-end devs would be exposed to concepts already used in C#. Maybe a good path into full-stack for those interested?&lt;/p&gt;

&lt;p&gt;Any SOLID and/or TypeScript fans in the building? If you have used it, what is your experience, good or bad? And are you a full-stack or front-end dev?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt;&lt;br&gt;
*&lt;a href="https://dev.to/kayis/is-react-solid-630"&gt;Is React SOLID? (From a fellow Dev.to member :)&lt;/a&gt;&lt;/p&gt;


</description>
      <category>frontend</category>
      <category>react</category>
      <category>softwaredevelopment</category>
      <category>javascript</category>
    </item>
    <item>
      <title>NET Core 2: Why xUnit and not NUnit or MSTest</title>
      <dc:creator>Chris Mathurin</dc:creator>
      <pubDate>Tue, 13 Mar 2018 02:08:55 +0000</pubDate>
      <link>https://dev.to/hatsrumandcode/net-core-2-why-xunit-and-not-nunit-or-mstest--aei</link>
      <guid>https://dev.to/hatsrumandcode/net-core-2-why-xunit-and-not-nunit-or-mstest--aei</guid>
      <description>

&lt;p&gt;With a recent new project using NET Core 2, my team and I looked at whether we should move to MS Test(Didn't consider MS Test 2 at that time), stick with NUnit or try xUnit. We had a spike, where I looked into whether we could still use NUnit in case we were not able to use xUnit, as we were not keen on MSTest as an alternative framework. In the end, we decided to give xUnit a go!&lt;/p&gt;

&lt;p&gt;xUnit is pretty lean compared to NUnit and MsTest and has been written more recently. The .NET framework has evolved since NUnit was first created. XUnit leverage some of the new features to help developers write cleaner test, as tests should be kept clean and treated as first-class citizens. The authors wanted to codify some rules rather than repeating guidance about “do X” or “don’t do Y". You can read more about why xUnit was created here:  &lt;a href="https://xunit.github.io/docs/why-did-we-build-xunit-1.0.html"&gt;https://xunit.github.io/docs/why-did-we-build-xunit-1.0.html&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some of the reasons why we went with xUnit:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  NUnit was not fully compatible with .NET Core 2 at the time&lt;/li&gt;
&lt;li&gt;  We wanted to move away from MS Test, as the team preferred the xUnit and NUnit way of writing tests&lt;/li&gt;
&lt;li&gt;  xUnit is aimed at improving test isolation and trying to codify a set of rules to establish a testing standard.&lt;/li&gt;
&lt;li&gt;  xUnit [Fact] and [Theory] attributes are extensible, so you can implement your own testing functionality.xUnit doesn’t use Test Lists and .vsmdi files to keep track of your tests.&lt;/li&gt;
&lt;li&gt;  Microsoft is using xUnit internally, one of its creators is from Microsoft. xUnit was also created by one of the original authors of NUnit.&lt;/li&gt;
&lt;li&gt;  There are no [Setup] and [Teardown] attributes, this is done using the test class’ constructor and an IDisposable. This encourages developers to write cleaner tests.&lt;/li&gt;
&lt;li&gt;  xUnit allows us to write less code since its flexibility allows things like subspec which allow you to write only what you need to do. Using tools such as xBehave: &lt;a href="%5Bhttp://xbehave.github.io/%5D(https://reed.jiveon.com/external-link.jspa?url=http%3A%2F%2Fxbehave.github.io%2F)."&gt;http://xbehave.github.io/&lt;/a&gt; and &lt;a href="https://github.com/ttutisani/Xunit.Gherkin.Quick"&gt;Xunit.Gherkin.Quick&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;  xUnit is easier to read and uses intuitive terminology.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An interesting recent article from Uncle Bob on (unit) testing:&lt;br&gt;
&lt;a href="http://blog.cleancoder.com/uncle-bob/2017/05/05/TestDefinitions.html"&gt;http://blog.cleancoder.com/uncle-bob/2017/05/05/TestDefinitions.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A performance (with a new update to Visual Studio 2017) comparison was released a few months after picking our testing framework, comparing NUnit, xUnit and MS Test 2. You can find the blog post from Microsoft &lt;a href="https://blogs.msdn.microsoft.com/visualstudio/2017/11/16/test-experience-improvements/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://georgemauer.net/2015/05/01/why-not-mstest"&gt;http://georgemauer.net/2015/05/01/why-not-mstest&lt;/a&gt;&lt;br&gt;
&lt;a href="https://seankilleen.com/2015/06/xUnit-vs-MSTest/"&gt;https://seankilleen.com/2015/06/xUnit-vs-MSTest/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://stackify.com/unit-test-frameworks-csharp/"&gt;https://stackify.com/unit-test-frameworks-csharp/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://xunit.github.io/docs/why-did-we-build-xunit-1.0.html"&gt;https://xunit.github.io/docs/why-did-we-build-xunit-1.0.html&lt;/a&gt;&lt;a href="http://blog.cleancoder.com/uncle-bob/2017/05/05/TestDefinitions.html"&gt;http://blog.cleancoder.com/uncle-bob/2017/05/05/TestDefinitions.html&lt;/a&gt;&lt;/p&gt;


</description>
      <category>unittest</category>
      <category>testframework</category>
      <category>softwaredevelopment</category>
      <category>testing</category>
    </item>
    <item>
      <title>Brief intro to Evolutionary Architecture</title>
      <dc:creator>Chris Mathurin</dc:creator>
      <pubDate>Tue, 13 Mar 2018 01:39:21 +0000</pubDate>
      <link>https://dev.to/hatsrumandcode/evolutionary-architecture--2n7o</link>
      <guid>https://dev.to/hatsrumandcode/evolutionary-architecture--2n7o</guid>
      <description>

&lt;p&gt;A few weeks ago I attended a talk organised by Thoughtworks about "&lt;a href="https://info.thoughtworks.com/evolutionary-architecture-london.html"&gt;Building Evolutionary Architectures&lt;/a&gt;". This was a very interesting and important subject, which addressed the issues that most software development teams will encounter at one point or another. The main one being  &lt;a href="https://martinfowler.com/bliki/TechnicalDebt.html"&gt;Tech Debt&lt;/a&gt;, and how to monitor, reduce and prevent the same type of Tech from re-occurring.&lt;/p&gt;

&lt;p&gt;This topic addresses the new kid on the block, Microservices, and how this new architecture has made us rethink how we design software.&lt;/p&gt;

&lt;p&gt;"For many years, software architecture was described as "the parts that are hard to change later". But then microservices showed that if architects build &lt;em&gt;evolvability&lt;/em&gt; into the architecture, change becomes easier."  &lt;/p&gt;

&lt;p&gt;"Incremental change is critical for the mechanics of evolution, while uncontrolled evolution leads to undesirable side effects. Predictability is impossible when the foundation architects plan against changes constantly in unexpected ways. Instead, prefer &lt;strong&gt;evolvability over predictability&lt;/strong&gt;."&lt;/p&gt;

&lt;p&gt;One of the focus of the talk was "&lt;strong&gt;Fitness Function&lt;/strong&gt;", which is described as follows:&lt;/p&gt;

&lt;p&gt;"Mathematically speaking, a function takes input from some allowed set of input values and produces an output in some allowed set of output values. In software, we also generally use the term function to refer to something that is actually implementable. However, as with acceptance criteria in agile software development, the fitness functions for evolutionary architecture may not be implementable in software (e.g., a required manual process for regulatory reasons), but architects must still define manual fitness functions to help guide the evolution of the system. While automated checks are preferable, some projects cannot automate all fitness functions. Thus, it is still useful for architects to elucidate architectural verifications explicitly as fitness functions for many reasons that will become evident."&lt;/p&gt;

&lt;p&gt;Conveniently some of the people at ThoughtWorks have just published a book called "&lt;strong&gt;Building Evolutionary Architectures&lt;/strong&gt;", you can download a free chapter  &lt;a href="https://www.thoughtworks.com/books/building-evolutionary-architectures"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://info.thoughtworks.com/evolutionary-architecture-london.html"&gt;Building Evolutionary Architectures&lt;/a&gt;&lt;/p&gt;


</description>
      <category>architecture</category>
      <category>meetup</category>
      <category>softwaredevelopment</category>
      <category>thoughtworks</category>
    </item>
  </channel>
</rss>
