<?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: Romans Pokrovskis</title>
    <description>The latest articles on DEV Community by Romans Pokrovskis (@amoenus).</description>
    <link>https://dev.to/amoenus</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%2F19347%2F83e16551-7562-410c-b381-a2156c3ba784.png</url>
      <title>DEV Community: Romans Pokrovskis</title>
      <link>https://dev.to/amoenus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amoenus"/>
    <language>en</language>
    <item>
      <title>Turn Swagger Theme to the Dark Mode</title>
      <dc:creator>Romans Pokrovskis</dc:creator>
      <pubDate>Fri, 25 Jun 2021 18:43:46 +0000</pubDate>
      <link>https://dev.to/amoenus/turn-swagger-theme-to-the-dark-mode-4l5f</link>
      <guid>https://dev.to/amoenus/turn-swagger-theme-to-the-dark-mode-4l5f</guid>
      <description>&lt;p&gt;So you have Swagger integrated into your .NET Core Web API application. Maybe even using my &lt;a href="https://amoenus.dev/swagger-for-dotnet-core-webapi" rel="noopener noreferrer"&gt;previous guide&lt;/a&gt;. And now you want to customize it a bit.&lt;/p&gt;

&lt;p&gt;I prefer my UI’s dark. So, when I am presented with a predominantly white screen from the Swagger default theme, I immediately want to change it. Luckily SwaggerUI supports CSS injection.&lt;/p&gt;

&lt;p&gt;Here are the tweaks that we need to make:&lt;/p&gt;

&lt;h2&gt;
  
  
  Changes for &lt;code&gt;Startup.cs&lt;/code&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Enable support for static files in a &lt;code&gt;Configure()&lt;/code&gt; method
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

app.UseStaticFiles();



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Add folder structure with custom CSS
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

wwwroot/
   └──swagger-ui/
      └── SwaggerDark.css



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598982216244%2F9OHU5YoJd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598982216244%2F9OHU5YoJd.png" alt="Folder structure and location of SwaggerDark.css"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Inject custom CSS
&lt;/h3&gt;

&lt;p&gt;Now we can inject the custom CSS with &lt;code&gt;InjectStylesheet()&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

app.UseSwaggerUI(c =&amp;gt;
{
    c.SwaggerEndpoint("/swagger/v1/swagger.json", "MyAPI");
    c.InjectStylesheet("/swagger-ui/SwaggerDark.css");
});



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You’ve read till the end, so as a thank you here’s the link to the dark theme I just mentioned. It even comes with a dark scroll bar and custom drop-down arrows. &lt;a href="https://github.com/Amoenus/SwaggerDark/" rel="noopener noreferrer"&gt;https://github.com/Amoenus/SwaggerDark/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for reading. Consider subscribing and leaving a comment.&lt;/p&gt;

</description>
      <category>css</category>
      <category>tutorial</category>
      <category>swagger</category>
      <category>aspnetcore</category>
    </item>
    <item>
      <title>How to integrate Swagger UI in a .NET Core Web API application | Amoenus Dev</title>
      <dc:creator>Romans Pokrovskis</dc:creator>
      <pubDate>Thu, 03 Sep 2020 15:35:28 +0000</pubDate>
      <link>https://dev.to/amoenus/how-to-integrate-swagger-ui-in-a-net-core-web-api-application-amoenus-dev-13o1</link>
      <guid>https://dev.to/amoenus/how-to-integrate-swagger-ui-in-a-net-core-web-api-application-amoenus-dev-13o1</guid>
      <description>&lt;p&gt;&lt;a href="https://swagger.io/"&gt;Swagger&lt;/a&gt; tooling allows you to generate beautiful API documentation, including a UI to explore and test operations, directly from your routes, controllers and models.&lt;br&gt;
Setting it up is simple but requires some code changes.&lt;br&gt;
To enable swagger integration for your .NET Core Web API project you will need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Swashbuckle.AspNetCore package from NuGet&lt;/li&gt;
&lt;li&gt;Change the &lt;code&gt;Startup.cs&lt;/code&gt; class of your Net Core Web API application.

&lt;ul&gt;
&lt;li&gt;Add using statement for &lt;code&gt;OpenApiInfo&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;Configure(IApplicationBuilder app, IWebHostEnvironment env)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;ConfigureServices(IServiceCollection services)&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Changes for &lt;code&gt;Startup.cs&lt;/code&gt;
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Installing Swagger
&lt;/h3&gt;

&lt;p&gt;From your project folder install the Swagger Nuget package (6.1.4 for this instance)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;dotnet add package Swashbuckle.AspNetCore --version 6.1.4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Using statement
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Microsoft.OpenApi.Models&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Changes for &lt;code&gt;ConfigureServices()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In the &lt;code&gt;ConfigureServices()&lt;/code&gt; method you should add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddMvc&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddSwaggerGen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SwaggerDoc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;OpenApiInfo&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"My Awesome API"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;Version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"v1"&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;h3&gt;
  
  
  Changes for &lt;code&gt;Configure()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;In the &lt;code&gt;Configure()&lt;/code&gt; method you should add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwagger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwaggerUI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SwaggerEndpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/swagger/v1/swagger.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"My Awesome API V1"&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;I prefer to enable it only for development&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsDevelopment&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseDeveloperExceptionPage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwagger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;UseSwaggerUI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;SwaggerEndpoint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/swagger/v1/swagger.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"My Awesome API V1"&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;
  
  
  Taking it for a spin
&lt;/h2&gt;

&lt;p&gt;After all these changes, we are finally ready to test our new integration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;dotnet run
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to &lt;a href="https://dev.tolocalhost:4200/swagger"&gt;localhost:4200/swagger&lt;/a&gt; to see the SwaggerUI &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: your port may be different&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Bonus: Customisation
&lt;/h2&gt;

&lt;p&gt;Now that you have Swagger configured, you might want to change the default theme.&lt;br&gt;
You can learn how to do this in this &lt;a href="https://amoenus.dev/swagger-dark-theme"&gt;blog post&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Did you have any questions or feedback? Please share them in the comments 🤗&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>swagger</category>
      <category>tutorial</category>
      <category>api</category>
    </item>
    <item>
      <title>There is no ‘wrong’ way to develop software | Amoenus Dev</title>
      <dc:creator>Romans Pokrovskis</dc:creator>
      <pubDate>Fri, 21 Aug 2020 21:27:19 +0000</pubDate>
      <link>https://dev.to/amoenus/there-is-no-wrong-way-to-develop-software-amoenus-dev-4o19</link>
      <guid>https://dev.to/amoenus/there-is-no-wrong-way-to-develop-software-amoenus-dev-4o19</guid>
      <description>&lt;p&gt;Today I would like to discuss a topic of 'wrong' code in software development.&lt;/p&gt;

&lt;p&gt;I often find developers arguing. It can be about the use of languages, certain patterns or frameworks. Whichever topic it is, each of the arguers is adamant that the opposing approach is 'wrong'.&lt;/p&gt;

&lt;p&gt;Those arguments between developers are fierce. People defend their right to develop software in their preferred style. So in situations when the preferred approach is criticized, people start to treat it as a personal attack. This leads to violent responses towards opposing viewpoints.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598021748289%2FvQstFKl0S.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598021748289%2FvQstFKl0S.png" title="Bear fight" alt="Two bears fighting. Used as an illustration of an argument between two developers"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This often happens because people think that there is only one 'correct' way of doing things. That some people are not educated enough to follow 'the right way'. These personal biases often stem from education and experience.&lt;/p&gt;

&lt;p&gt;In reality, there is no such thing as 'wrong' code or 'wrong' approach, even though that term is used a lot in the industry.&lt;/p&gt;

&lt;p&gt;The word 'wrong' is completely meaningless when it comes to describing the way code is written. It won't sway either of arguing parties to change their opinion.&lt;/p&gt;

&lt;p&gt;Think. Will the opinion of others hinder your ability to solve the problems in your day-to-day life?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598021784109%2FMPLLYit4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598021784109%2FMPLLYit4o.png" title="Over-the-top Swiss army knife" alt="Over-the-top Swiss army knife. A visual aid depicting not ideal, the convoluted application that still is useful"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some argue that using specific language, framework or pattern will allow you to make fewer mistakes. This is misguided. It is with real complexity and a high volume of code where real problems arise. Difficulties come from the sheer amount of code and inter-connection within it. Regardless of the language or methodologies you use.&lt;/p&gt;

&lt;p&gt;All these patterns, frameworks, etc. help you to bootstrap your project at the very start. They are very helpful when the amount of code is very small.&lt;/p&gt;

&lt;p&gt;In contrast, you may have a codebase with the line count approaching 1 million. Even if those lines are written using the most ideal programming language, you still risk having problems. For example, you may have structured your code without proper separation. The code may also have some convoluted logic. The language choice or use of functional programming vs OOP will not save you from problems. When the complexity of the application raises, the significance of those choices approaches zero.&lt;/p&gt;

&lt;p&gt;The bigger the project, the more important it becomes to have sensible architecture and separation of elements in your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598021819849%2FWhaFcs8bK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1598021819849%2FWhaFcs8bK.png" title="Maze" alt="Maze. Used as a visual aid to show complicated application"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After your code is separated arguing about 'wrong' code becomes a moot point. Each element can be written in a way and in a language that is the most practical for the problem at hand.&lt;/p&gt;

&lt;p&gt;I would like to underline once again that views of others no matter how radical are just that - views. It is perfectly normal to not share those viewpoints. At the end of the day, it's irrelevant for the end-user in which language you write your code in. It's also unimportant whether you used the latest version of EF Core.&lt;/p&gt;

&lt;p&gt;The application should solve the problem it was designed to solve. It should be delivered on time and have a pleasant and performant user experience. So, there is no point in arguing that the same thing could be achieved with 5 lines in Python.&lt;/p&gt;

&lt;p&gt;If you can achieve the result to the satisfaction of the end-user with the technology stack you feel most comfortable with, go for it. Play to your strengths, there is no reason to torture yourself or obsess over which js framework to use.&lt;/p&gt;

&lt;p&gt;As a software developer, the value you can bring to the project comes from your ability to strategically apply a slew of tools at your disposal. Your code does not automatically get better when you base it on the newest framework. Upgrade your code, not the framework it runs on.&lt;/p&gt;

&lt;p&gt;Technologies evolve at a break-neck speed and what is considered 'new' is ever-changing. So you will find your self in a never-ending loop of constant re-writes.&lt;/p&gt;

&lt;p&gt;There are software products that withstood the test of time. They are still popular not because they use a certain language or hot new framework. We use them because they solve a particular problem better than competitors.&lt;/p&gt;

&lt;p&gt;So, develop the code in a way you think is appropriate. Approach software development from different viewpoints. Seek out the workflow the most comfortable for you. Stop seeking a silver bullet, the universal approach does not exist.&lt;/p&gt;

&lt;p&gt;Did you ever defend a certain viewpoint or were told that the code you wrote was wrong? Share your thoughts in the comments 😤&lt;/p&gt;

</description>
      <category>development</category>
      <category>architecture</category>
      <category>engineering</category>
      <category>discuss</category>
    </item>
    <item>
      <title>No method too small</title>
      <dc:creator>Romans Pokrovskis</dc:creator>
      <pubDate>Sat, 08 Aug 2020 22:24:33 +0000</pubDate>
      <link>https://dev.to/amoenus/no-method-too-small-35pp</link>
      <guid>https://dev.to/amoenus/no-method-too-small-35pp</guid>
      <description>&lt;p&gt;This story starts with a call from the 1st line support that users were getting intermittent-production-only error in one of the key application my team were working on.&lt;/p&gt;

&lt;p&gt;The problem was that the application was behind the hardened environment that we had no access to.&lt;/p&gt;

&lt;p&gt;The only thing we could do is enable logging which in itself took a whole week to get approved. And the result the Developers favourite - &lt;code&gt;NullReferenceException&lt;/code&gt; in one of the biggest methods, I've ever seen in my whole career. Needless to say, that was not very helpful and we were no closer to the solution.&lt;/p&gt;

&lt;p&gt;What. A. Pain.&lt;/p&gt;

&lt;p&gt;Frustrated with the issue and with business breathing down my neck I started slicing this Monster of a method into smaller and smaller chunks. Even if some action was just a one-liner that would not stop me to create a method. At one point I could no longer care for method names resorting to such classics like &lt;code&gt;Method1&lt;/code&gt;, &lt;code&gt;FooBar123&lt;/code&gt; and &lt;code&gt;DoStuff&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But. It. Worked.&lt;/p&gt;

&lt;p&gt;After the next deployment logs were showing the same &lt;code&gt;NullReferenceException&lt;/code&gt; but now the stack trace pointed me to some &lt;code&gt;Method13&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The resulting stack trace finally allowed to pinpoint the issue. The fix then was just a simple null check.&lt;/p&gt;

&lt;p&gt;While Dev team who did not appreciate my creative method naming it was obvious to everyone that even that was better than one big blob of code.&lt;/p&gt;

&lt;p&gt;It might seem silly to separate the most obvious one-liners into their own methods and sometimes even whole classes but not living through that experience alone is worth it for me.&lt;/p&gt;

&lt;p&gt;Did you ever found yourself in a situation where you wished your stack trace was just a little bit more in-depth? Tell me in the comments ^_^&lt;/p&gt;

&lt;p&gt;So now go and look at your code and see if you can pepper it with smaller methods so that you stack traces can pave your way to your debugging success.&lt;/p&gt;

</description>
      <category>story</category>
      <category>method</category>
      <category>discuss</category>
      <category>development</category>
    </item>
  </channel>
</rss>
