DEV Community

Cover image for WTH is a ConfigurationBuilder?

Posted on

WTH is a ConfigurationBuilder?

OOP is hard. In my case, it's hard because it's a totally new way of thinking, everything is interconnected, and everyone assumes you know the basics.

I don't.

Know the basics.

Over 6 months into my SWE career, I still find myself scratching my head at common OOPisms. Sometimes it's just a matter of getting unstuck enough to make progress with my stated goal. But often, I find myself tempted to unravel and unravel until I get to the root of my question.

This is an even more pronounced issue when we're talking about company code. Not only do I need to understand the general OOPisms, but also how they do or (more often than not) don't work with the way we write code.

We have many internal libraries that weave in and out of the general workings of OOP and .Net. Some of these libraries are fundamental to any tool that we build. So much so that a basic concept inevitably becomes more complex because to understand what the library does means taking the time to understand why the library exists. But going down that rabbit hole often leads back to the start of this madness.

It's like looking up the definition of communication only to find "the act of communicating". While true, that definition is useless to someone who doesn't know either word, aka me. It's useless to me.

What spurred this rant?

you're probably wondering. Get to the point already.

It all started with auth. But also logging. Dependency injection. And just getting and app started at the most basic level.

I ended last week working on some basic auth for a dummy app to test something pointless. No expectations.

I started the most recent library to implement one requirement--logging. It's a dummy app, with no external classes or anything else. Easy peasy. ..?


But 2 hours later, I'm asking myself, what the heck is a ConfigurationBuilder?

Why are ConfigurationBuilders everywhere? And why are there a million flavors to them? Which flavor applies to this situation? When do I need a new ConfigurationBuilder vs ConfigurationManager or a LoggerConfiguration or CreateDefaultBuilder()? What items will require some configuration builder?

I've passed by this question several times before this point. But now I need to dive deep. My question list is getting to be unmanageable.

Sorry to disappoint..

If you clicked on this post with the same question, I have nothing else to offer but that I see you and I feel your pain.

This was mostly a rant. But I'm also hoping someone might have a simple response. Most resources (MS docs, YouTube, Stack Overflow) jump into using one flavor or another without explaining the basic premise-- What is a ConfigurationBuilder?


Top comments (0)