The move to API Driven Development

Throughout my time developing software I have seen many different architectures, but on some of my recent projects, there is one that stands above the rest. API Driven Development. I absolutely love this architecture and I’m sure most of you would too.

Continue reading →
Posted by DCCoder in General, 0 comments

Working with collections – IAsyncEnumerable

Perhaps the most exciting feature in C# 8.0 was IAsyncEnumerable. At work, we have been dealing with a LOT of async calls. Prior we were having to block the thread just to get the data, and process it accordingly.

One of the more annoying things was converting existing enumerable to IAsyncEnumerable so we wouldn’t have to block the thread and could keep trucking on. The following is a neat little Gist that I partially found and partially developed that I figured I’d show off.

This is an extension method, just drop into your project and call “.SelectAsync” on a collection you want to pull data out of asynchronously as well as convert to an asynchronous enumerable.

Continue reading →
Posted by DCCoder in General, Programming, 0 comments
AWS Secret Storage

AWS Secret Storage

Working with any form of a secret in development such as usernames, connection strings, passwords, etc is always difficult. Simply finding a convenient and efficient way of storing them without putting them in source control can be a daunting task. While there are many ways of handling this such as dotNet secrets, Azure Key Vault, and Hashicorp Vault. I, however, decided to go with AWS’s secret manager.

Continue reading →
Posted by DCCoder in General, Programming, 0 comments
Creating objects at runtime

Creating objects at runtime

For the past few days, I’ve been working with a fairly large dataset (2.87GB) that is in a collection of 66 different tabular delimited files. This in and of itself isn’t bad, but the problem is that I was wanting to be able to easily place it into various formats and have an easy way of working with it.

Posted by DCCoder in General, Programming, 0 comments
Unit Testing while maintaining access restrictions

Unit Testing while maintaining access restrictions

Let’s start off by saying that if you’re not writing Unit Tests….you should.  Unit testing is everywhere these days, from Bootcamps, to tutorials, to books.  There is a good reason behind this too.  Unit tests help developers create a fully functional, bug-free applications.  Giving near instant feedback on whether you just broke your code or not can save many headaches in the long run.  I see many of those new to unit testing falling trap to a common pitfall: Changing access modifiers.  Let’s take a look at how to write your unit tests without having to change your modifiers.

Continue reading →

Posted by DCCoder in Programming, Tutorials, 0 comments
Flow control: If/else, switches and….dictionaries?

Flow control: If/else, switches and….dictionaries?

.NET languages have a variety of forms of flow control, if statements are easily among the most noticeable. When having to compare multiple statements it is common practice to utilize switch statements due to it’s improved performance, but is there another way? It turns out there is!  We can actually use a dictionary and delegates for flow control! Before we delve into this, how exactly are switch statements utilized by the compiler?

TLDR;

You can use dictionaries in place of large switches and the code is found here.

Continue reading →

Posted by DCCoder in General, Programming, 0 comments
Reinstalling Nuget Packages

Reinstalling Nuget Packages

So the majority of this morning I have been struggling trying to get a project to correctly build, fighting nuget packages.  The issue was coming from missing dependencies.  I tried all sorts of methods through visual studio to attempt to get the problem fixed, yet nothing worked.  I tried multiple times, but each time visual studio claimed they were up-to-date.  We have been having issues with redirect bindings so a coworker suggested I check those.  The redirect bindings in the project were fine, but finally I figured it out.

While visual studio thought everything was good, the problem was that the nugets were not installed.  I opened the package manager console and typed the following command:

1
Update-Package -reinstall

This reinstalled all of the nugets in my solution without updating them and viola! The problem was fixed.  I bring this up to remind everyone of just how useful that little console at the bottom of your screen can be.  If it was not for the package manager console the problem could still be fixed but would have been very tedious.  Another useful command is:

1
Update-Package -reinstall -Project ProjectName

This will perform the same action but only on a single project within your solution.

Posted by DCCoder in General, 0 comments
Code Lint – What is it? What can help?

Code Lint – What is it? What can help?

So what exactly is code lint?  I’m sure we’ve all heard of a linter but how many out there have actually taken the time to sit down and use one?  What are they used for?  Well, getting rid of code lint, of course!  A linter is defined by Wikipedia as:

A linter or lint refers to tools that analyze source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.

So obviously feeding off of the definition of a linter, a good explanation for the lint itself could possibly be clearly defined as:

Code lint is a software programming “smell” that is identified by programming errors, bugs, stylistic errors and/or suspicious constructs.

I personally believe that this is a good explanation to those.  There are linters out there for nearly every language, however; I’m going to focus on JavaScript for soon-to-be apparent reasons.

Continue reading →

Posted by DCCoder in Design and Best Practice, Programming, 0 comments
Building a self-hosted API with OWIN

Building a self-hosted API with OWIN

So it’s Friday and I haven’t published anything this week yet.  Figured I’d push out a short and quick tutorial on OWIN and give everyone something to play with over the weekend!

What is Owin?

OWIN is an acronym that stands for Open Web Interface for .NET and is meant to define a standard interface between web servers and applications. The goal of OWIN is to decouple servers and applications.  Due to this it encourages the development of simple modules for .NET web development.  Because of this OWIN is great for building small, simple, self-hosted applications.  It’s ability really shines when it comes to the creation of micro-service APIs.  Within this tutorial I will take you through the basic process of creating a small self-hosted API.  We will go from inception all the way to implementation and discuss possible use cases.

Continue reading →

Posted by DCCoder in Tutorials, 0 comments
Why I don’t post on the weekends

Why I don’t post on the weekends

I do my best to continue to push content and well-written, informative, articles out to my subscribers.  You may,  or may not, have noticed that no content goes out on the weekends.  Aside from maybe the odd pre-scheduled post.  The reason behind this is because, like many others, I too am susceptible to burn-out.  So what is this burn-out?  Well it’s basically a type of stress that leads to:

  • Physical, mental, and emotional exhaustion
  • Cynicism and detachment
  • Feelings of ineffectiveness and lack of accomplishment

In other words, you will stop caring and lose all motivation.  I have personally experienced burn-out many times.  One of the worst times it got me lasted over a year.  Probably one of the worst things about burn-out is while you may want to push forward and just “get through it”, that has the adverse effect.  There are many well-written articles on this topic, and on how to combat it.  I personally try to simply limit my work to weekdays and focus solely on Family and friends during the weekend.

Taking this approach helps me keep my priorities straight.  This includes both my personal and professional life.  Burn-out is a very serious threat, especially to those of us in IT.  Quite frequently our hobby and our living coincide.  This typically means that 8-5 we are working, 5-11 we are still working (just on personal projects), and 11-7 we are dreaming of work.  I love what I do just as much as the rest but to say the human mind isn’t built for that is an understatement.  Step back from work and find, completely unrelated, hobbies.  Spend time with family, or outside.

This is exactly why I don’t post on the weekends.  I stay away from any form of work and just enjoy life.  This helps me step back into each Monday with a fresh and clear head.

Posted by DCCoder in General, Personal, 0 comments