<?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: Morgan Faget</title>
    <description>The latest articles on DEV Community by Morgan Faget (@manny42).</description>
    <link>https://dev.to/manny42</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%2F19242%2F9c1e1edf-b195-46b5-9a25-47e7e77697c5.jpg</url>
      <title>DEV Community: Morgan Faget</title>
      <link>https://dev.to/manny42</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manny42"/>
    <language>en</language>
    <item>
      <title>Should I share my love for regex ?</title>
      <dc:creator>Morgan Faget</dc:creator>
      <pubDate>Tue, 02 Aug 2022 11:59:09 +0000</pubDate>
      <link>https://dev.to/manny42/should-i-share-my-love-for-regex--1394</link>
      <guid>https://dev.to/manny42/should-i-share-my-love-for-regex--1394</guid>
      <description>&lt;p&gt;Today, and probably for the 10th time since January, somebody asked for help with a regex. And I was, as usual, happy to help.&lt;/p&gt;

&lt;p&gt;I &lt;strong&gt;LOVE&lt;/strong&gt; regex, they feel like building a solution for a puzzle. It can be making sure that a pattern is followed, replacing large amount of data in a document or even extracting data.&lt;/p&gt;

&lt;p&gt;I've been thinking about writing a series of post about how they work and how to build them.&lt;br&gt;
I would love to hear from you what you would like to see in these posts.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>watercooler</category>
      <category>regex</category>
      <category>backtoschool</category>
    </item>
    <item>
      <title>Is a front-end and back-end team split a mistake</title>
      <dc:creator>Morgan Faget</dc:creator>
      <pubDate>Tue, 14 Jun 2022 09:11:17 +0000</pubDate>
      <link>https://dev.to/manny42/is-a-front-end-and-back-end-team-split-a-mistake-4lj8</link>
      <guid>https://dev.to/manny42/is-a-front-end-and-back-end-team-split-a-mistake-4lj8</guid>
      <description>&lt;p&gt;Currently there is a tendancy in our industry to specialise in front-end or back-end development and stick to it, it often comes down to interest or education. On top of this companies now tend to create two disctinct teams to take care of their applications and websites.&lt;/p&gt;

&lt;p&gt;This split was effective or put into place in the last companies I've worked at and I wanted to give my two cents on this trend. The split is not obvious and should not be done lightly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why would we want to ?
&lt;/h2&gt;

&lt;p&gt;This trend follows the logic that has been the default go-to architecture for websites and applications in the latest years. We build a stand-alone front-end that communicates with an API. No only does this give the possibility to release those two components independantly but it also gives the opportunity to develop other applications on top of the API without having to put in the effort of building a new back-end system to communicate with.&lt;/p&gt;

&lt;p&gt;And since we have two different code base, two different deploy pipeline and two different applications it looks like the two team split makes sense.&lt;/p&gt;

&lt;h2&gt;
  
  
  The benefits
&lt;/h2&gt;

&lt;p&gt;As mentionned, the fact that, in the end, the front and back end side of the application become two independant part of the same product means that there is no need to have the same team tackle these two development.&lt;/p&gt;

&lt;p&gt;One of the major benefit is the fact that you can hire experts in their fields, language or framework. It brings efficiency in their team as well as the insurance that the project can move forward avoiding some of the hurdles those project usually encounter.&lt;/p&gt;

&lt;p&gt;Communication also benefits from this. The team focuses on the same codebase, talk the same language and have a wider knowledge of the codebase since they're always working on the same one.&lt;br&gt;
A smaller team also means that voices are heard more easily and the ideas flow faster. It helps with productivity and reactivity on new features or bugfixes.&lt;/p&gt;

&lt;p&gt;A smaller and often underappreciated benefit is the added quality to documentation. Since the front-end team and the back-end team need to easily communicate, usually a standard way to communicate how things work is put into place.&lt;br&gt;
But we can easily see how this could be a problem in certain situations.&lt;/p&gt;

&lt;h2&gt;
  
  
  The drawbacks
&lt;/h2&gt;

&lt;p&gt;The communication within the teams benefit from this split, but what about the communication between the two teams. And what about the communication between each team and other actor of the company.&lt;/p&gt;

&lt;p&gt;When building a project from scratch, or even developing new features, the communication between both teams and the product team must be crystal clear. And if it is not, it can lead to conflicts in what each team has understood about what needs to be developed.&lt;br&gt;
If the teams are in a configuration where they both have a manager and those manager don't communicate a lot and prefer going through their common superior, the slowness of the loop might create a divergence in the objectives of the teams and lead to changes or even large rewrite of the applications.&lt;/p&gt;

&lt;p&gt;In my experience this has lead to one of my biggest fear when this split is done, the front-end and back-end team are tired on waiting on each other and develop the parts of the application that both of them judge as the most critical and when the time comes to put things together, a huge refactor is necessary to be able to present the tiniest thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  So... Should we do it?
&lt;/h2&gt;

&lt;p&gt;I am not pretending to have the perfect answer to this but I think that this decision should not be taken lightly.&lt;/p&gt;

&lt;p&gt;From experience, I've been able to see it work extremely well and very poorly.&lt;/p&gt;

&lt;p&gt;It worked when the split was done at a point in the company where they wanted to grow and build something new on the front-end without having to pull resources from the back-end.&lt;br&gt;
It worked because the API was already designed, functional and documented. The front-end team was able to design their new application without having to wait on the API to be functional, and when it came to adding feature, the team knew how the API was designed and could ask for endpoints that were aligned with how the API worked.&lt;/p&gt;

&lt;p&gt;On the other hand it has gone very poorly on a full rewrite of an application. Both teams started working on their architecture for a while, this time was used by the product team to define the scope of the new application.&lt;br&gt;
The issue came when both teams did not finish their research at the same time. Some hurdles were encountered by one of the team and since the management wanted to keep a hard delimitation between the front-end and the back-end, resources were not moved around to help. And since the situation did not resolve, the product team was moved to other tasks and the time to answer grew longer.&lt;br&gt;
This stalling resulted in the project collapsing onto itself when this rewrite was necessary to help the company grow into new segments. Instead the failure pushed to drop the project and keep developping on the old stack.&lt;/p&gt;

&lt;p&gt;TL;DR: When doing a split, consult with the team members, make sure you have a strong plan and don't be too strict with it. The benefit of being able to hire more efficiently can be outweighted by the difficulty of communicate.&lt;/p&gt;

</description>
      <category>team</category>
      <category>management</category>
      <category>fullstack</category>
      <category>cto</category>
    </item>
    <item>
      <title>The importance of business knowledge for developers</title>
      <dc:creator>Morgan Faget</dc:creator>
      <pubDate>Fri, 14 Jun 2019 14:46:26 +0000</pubDate>
      <link>https://dev.to/manny42/the-importance-of-business-knowledge-for-developers-29nh</link>
      <guid>https://dev.to/manny42/the-importance-of-business-knowledge-for-developers-29nh</guid>
      <description>&lt;p&gt;Have you ever been in a situation where you produced some code without understanding the whole context of what you were doing? And later realised the implementation that you created was not inline with the direction the business was steering? Well here is a thought on why it is really important to know the WHAT and the WHY to master the HOW&lt;/p&gt;

&lt;h1&gt;
  
  
  Business Knowledge
&lt;/h1&gt;

&lt;h2&gt;
  
  
  We don't need to know everything
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt; it is important that we understand what the company we work for does. Not only the work we will deliver will be better in quality but it is also likely to improve maintainability and flexibility when the business will ask for new features.&lt;/p&gt;

&lt;p&gt;And it's not as hard as it could seem at first sight. Of course our job is first to understand the code base and architecture to be efficient in making any change, but it is essential that we understand the business basics, and a bit more when needed.&lt;/p&gt;

&lt;p&gt;Knowing what the company does or sell is the first intro that we will have to the company usually even during a job interview. Once we are sure of what the company creates or sell we will have a good idea of its product(s), that's the WHAT. This knowledge will enable us to find out competitors and potentially find out what our business is trying to do better or differently than them, that's the WHY.&lt;/p&gt;

&lt;p&gt;This knowledge will give us basic understanding of the business mission, its goal. Now do we, as developer, want to know everything about the strategy of the company or the financial details of all operations? Not really...&lt;/p&gt;

&lt;h2&gt;
  
  
  Get useful knowledge
&lt;/h2&gt;

&lt;p&gt;It is true we don't need extensive knowledge of all the business details. But here is the trick, sometimes it is important to know more than what is given in a ticket or a project description. Often developers are perceived as machines to build code and whatever is thrown our way will be done, sometimes good, sometimes buggy, but often done without discussion. Now if you have the chance to have a great lead and a product manager who know how to do his/her job, we sometimes feel like all the specifications have already been discussed and that there is nothing else to be done. But this is not always true.&lt;/p&gt;

&lt;p&gt;This is when it is important to understand our business well. Understand all the implications of the project. If it is a product we never worked on before, let's understand who it is for, how it is used, what impact it will have on our business. The thought process or the questions generated by figuring this out will sometimes (if not often) lead to an implementation plan different than the one you would have had.&lt;/p&gt;

&lt;h1&gt;
  
  
  What does this mean for your code
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Coding with a goal in mind
&lt;/h2&gt;

&lt;p&gt;Having the large picture in mind will have two nice effects. On one side it will make you avoid dirty hacks when a new feature comes along that would have been easily implemented if the architecture was more flexible. On the other hand it will enable you to see edge cases or isolated cases that should not require extensive over-engineering and loose of focus on some other important matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding hacks and edge cases
&lt;/h2&gt;

&lt;p&gt;And that's why we should always consider wether or not it is worth it to refactor a piece of code that needs a new feature or if a hack will do because this piece of code is being deprecated by the business or because another project has this refactor in its scope.&lt;/p&gt;

&lt;p&gt;Sometimes the dirty hack is OK, it needs to be documented well, explaining the what and why of it, but it's OK because we understand that its lifespan is not worth the effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid infinite feedback loops
&lt;/h2&gt;

&lt;p&gt;Finally, the main benefit of understanding the business well is to win a lot of time in feedback loops.&lt;/p&gt;

&lt;p&gt;Instead of developing the feature and then wait for the business to validate, ask for change and you implementing these changes over and over, you want to take steps to prevent this.&lt;/p&gt;

&lt;p&gt;First, starting by asking all the necessary questions will help you and your stakeholder realise what you may have missed during the definition of the project, and you'll be sure that you understand each other and have the same vision.&lt;/p&gt;

&lt;p&gt;Then, when you're developing the feature and testing it, you'll know what it should do and how it should feel like rather than having to wait for business feedback to realise.&lt;/p&gt;

&lt;h1&gt;
  
  
  TL;DR
&lt;/h1&gt;

&lt;p&gt;Ask a lot of question, make sure you understand not only what you work on but also who you work for and why you do it. It will save you a lot of time and improve the quality of the work you deliver!&lt;/p&gt;

</description>
      <category>business</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>What were your best and worst onboarding experience?</title>
      <dc:creator>Morgan Faget</dc:creator>
      <pubDate>Fri, 14 Jun 2019 10:23:49 +0000</pubDate>
      <link>https://dev.to/manny42/what-were-your-best-and-worst-onboarding-experience-59mg</link>
      <guid>https://dev.to/manny42/what-were-your-best-and-worst-onboarding-experience-59mg</guid>
      <description>&lt;p&gt;I am currently building a new onboarding experience for our new hires, and I thought I would love to know more about other people experiences.&lt;/p&gt;

&lt;p&gt;What were your best or worst experiences with onboarding?&lt;/p&gt;

&lt;p&gt;Any experience is welcome, it does not have to be a technical story :)&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>My first experience with React, NodeJS and Azure</title>
      <dc:creator>Morgan Faget</dc:creator>
      <pubDate>Tue, 04 Jul 2017 14:28:13 +0000</pubDate>
      <link>https://dev.to/manny42/my-first-experience-with-react-nodejs-and-azure</link>
      <guid>https://dev.to/manny42/my-first-experience-with-react-nodejs-and-azure</guid>
      <description>&lt;p&gt;This is my first ever publication describing my first ever experience with commercial NodeJS, React and Azure. It has been a very fun journey understanding how all those pieces work together.&lt;/p&gt;

&lt;h2&gt;
  
  
  A bit of context
&lt;/h2&gt;

&lt;p&gt;I started this project because I wanted to find a better and more comfortable way for my colleagues and myself to work.&lt;br&gt;
Right now we are working with only a &lt;code&gt;master&lt;/code&gt; branch that holds the latest version of the code on our whole code base.&lt;br&gt;
This is a problem in two ways. First, we can't work independently on each project in our code base because they are all in the same git repo. Secondly, having only a &lt;code&gt;master&lt;/code&gt; branch that we build from and publish to our environment means that if there is a live issue, we can't come back in time to tags and make hot fixes unless no one has merged any work in since the last release (spoiler alert, this never happens when you have a team working on the repo). I have been thinking about those problems for a long time and after some research and failed experiments I finally got my chance.&lt;/p&gt;

&lt;p&gt;The company decided that it was time for us to have an API which means a complete rewrite of our client website. I was ecstatic! It was finally the time to split our code base in multiple projects and have a completely independent client that could be developed, built and deployed on its own side.&lt;br&gt;
I took a look around and tried building applications with AngularJs, Vue.js and React. I know there are more solutions out there but the idea was to find a solution that would suit my main criteria: my colleagues comfort.&lt;/p&gt;

&lt;p&gt;I had no experience with those framework before which was a good point to judge of the ease to learn and readability of each of these with very little experience. The story of my choice should probably be another blog post but I ended up choosing React and more precisely &lt;a href="https://github.com/facebookincubator/create-react-app"&gt;create-react-app&lt;/a&gt; to manage my project. The ease of building the client website and the ease of having a development environment with auto reload was a big plus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Azure, and how good is it?
&lt;/h2&gt;

&lt;p&gt;Currently our whole stack is using .Net MVC, so my first choice was to try to deploy my NodeJs client using Azure. I used &lt;a href="https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-get-started-nodejs"&gt;this very detailed tutorial&lt;/a&gt; to do so. I was charmed right away by the fact that you could trigger the deploy script by pushing to a branch and also the fact it was a very scalable solution.&lt;/p&gt;

&lt;p&gt;I decided that I would try to make a full proof of concept website using React and create a deployment flow with a development, a staging and a production environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make everything work together
&lt;/h2&gt;

&lt;p&gt;This was the point I hit the part where I am the less experienced. And where I struggled the most. Because on one side I had a React project using &lt;a href="https://github.com/facebookincubator/create-react-app"&gt;create-react-app&lt;/a&gt; and on the other I had the test project using &lt;a href="https://docs.microsoft.com/en-us/azure/app-service-web/app-service-web-get-started-nodejs"&gt;Microsoft tutorial&lt;/a&gt; and I wanted to make my Azure WebApp serve my client.&lt;/p&gt;

&lt;p&gt;I decided to recreate a React app in my Microsoft project. I now had a client directory where I could run &lt;code&gt;npm run start&lt;/code&gt; but most importantly I could run &lt;code&gt;npm run build&lt;/code&gt; and get a static website in the build folder.&lt;br&gt;
From there I could easily setup my &lt;code&gt;express&lt;/code&gt; instance to only serve the &lt;code&gt;index.html&lt;/code&gt; from the build directory.&lt;/p&gt;

&lt;p&gt;A rapid test on my local machine confirmed that after building I was serving the right thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  And now the fun part - Update the build script
&lt;/h2&gt;

&lt;p&gt;At this point I was amazed by how everything went fine all the way through the development of this POC. So the last part was to make sure that when pushing to my Azure branch the website would build before being deployed.&lt;br&gt;
And this is when the things got a little bit more complicated. All the solution that I found were not was I was looking for.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://medium.com/@to_pe/deploying-create-react-app-on-microsoft-azure-c0f6686a4321"&gt;This one&lt;/a&gt; was talking about copying the build directory using FTP. An easy solution but not at all good for a team of more than... 1 person.&lt;/li&gt;
&lt;li&gt;I found one that was talking about using Gulp to create the build and run it by modifying the deployment script.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And this was almost all I could find (with countless re-blog), the other solutions I would find would be outdated or would not use create-react-app. So I decided to create a custom solution using the Gulp solution as a wire frame for my own.&lt;/p&gt;

&lt;p&gt;What I had to do was to change the deploy script triggered after each push to the Azure branch. Those scripts can be downloaded at this address: &lt;code&gt;[your-webapp-name].scm.azurewebsites.net&lt;/code&gt; in Tools -&amp;gt; Download Deployment Script. Those scripts need to be added to your root directory and will be executed instead of the default ones.&lt;/p&gt;

&lt;p&gt;You want at this point to be aware that when we call &lt;code&gt;npm run build&lt;/code&gt; in a create-react-app application it calls an npm package called &lt;code&gt;react-scripts&lt;/code&gt; that is used to build the application.&lt;/p&gt;

&lt;p&gt;It took a while to find the right way to do it. Obviously using create-react-app command line was impossible as you can't install global command line on a WebApp. I then tried to get &lt;code&gt;react-scripts&lt;/code&gt; in my root project in order to use the &lt;code&gt;react-scripts.cmd build&lt;/code&gt; command from my root project but you can't pass a context to this command which means that my first functional version was doing this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run npm install in the root project, that would install &lt;code&gt;react-scripts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Move to the client directory&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;call ..\node_modules\.bin\react-scripts.cmd build&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This worked for my first very simple react app because I had everything needed to build the application in my root package.json. But as soon as I introduced new packages in my client application I realised that my build would fail.&lt;br&gt;
So I tuned my script a bit to install all the packages for the client and not include &lt;code&gt;react-scripts&lt;/code&gt; in my root &lt;code&gt;packages.json&lt;/code&gt; because it is not needed by the express app and should not be installed. And here is the &lt;a href="https://gist.github.com/manny42/4e03e39ca3e71d158f8e7a91668a9fda"&gt;current deployment script&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On top of that I ended up creating two more WebApp instances to prove this also works if we have different staging environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I am very happy with the way this proof of concept ended up looking. It was an interesting experience to discover all those new technologies and way to deploy applications.&lt;br&gt;
Azure WebApp are (at least for this usage) a very good and efficient way to deploy applications.&lt;br&gt;
On top of that I manage to reach all my objectives: Have a totally independent client code base, an easy way to manage staging environment using git branching strategies, while keeping everything easy to use and work with for my colleagues.&lt;/p&gt;

&lt;p&gt;TL;DR: You can make your React app served by Express running on Microsoft Azure Wep App using &lt;a href="https://gist.github.com/manny42/4e03e39ca3e71d158f8e7a91668a9fda"&gt;this deployment script&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope this was interesting. As this is my first blog post, please feel free to make comments on the form of this post as well so I can improve it!&lt;/p&gt;

</description>
      <category>node</category>
      <category>react</category>
      <category>azure</category>
      <category>microsoft</category>
    </item>
  </channel>
</rss>
