I typically code a lot. With a recent role change, not so much at work. To compensate, because I need to code, I have a side project I'm working on.
While working on various aspects of this, I've found a recurring theme. I don't write code.
I want to work on it... but I can't. I can't see 'the way' forward. I don't have a good grasp of the solution to sit down and work through.
This is a side project - I have a lot more freedom to "not code" when it doesn't feel right.
With work, I normally use my own time and play with things that don't sit right.
Struggling
I'm writing this now because I've had the experience again and it finally really pinged.
I didn't want to work on the project. I mean, I DID want to. Very much. I just didn't have a good place to start from.
The Problem
The project, for simplicity, is a website that can be logged into. That's nice and simple. Templates a plenty ABOUND for this.
Even Visual Studio ASP.NET Core projects enable you to set this up. It even has configuration to hook into Azure Active Directory. I thought this would be great. Spent a lot of time beating my head agaisnt AAD and AADB2C. Got the AAD side of things working. Postman is great to simplify that head-bashing.
Got the AADB2C side working as well.
Even got the site to use the AADB2C JWT for authorization!!! This was very exciting. I had gotten each piece I needed to function in isolation.
Like early 1900's Physics, just a few things around the Electron to iron out.
This is where I started to struggle. I got some azure functions written to offload the work from the website itself. Then I started to struggle. I expect A LOT of this struggle is that I don't know how to appropriately sacrifice the chicken.
How do I add information into AADB2C? How to do automate setting up the AADB2C for different environments? How do I automate application creation in AAD to access AADB2C?
AAD Rant
I didn't have answers - and there are no good places for answers.
In the end, my stance on interacting with AAD is that it isn't going to be automated. The reason for this is that there's a single instance of it. I can use AADB2C for more instances, but it's a new "Azure" I can interact with, not just a different AAD ... thing...
If I'm creating multiple environments, and deploying to them from AzDO, I don't want my Test build agent to have access to Prod things... I don't know how to automate the AADB2C creation/deployment/WHATEVER enough to enable that... And I don't have time to futz with that space.
I've rolled back my "AUTOMATE ALL THE THINGS" approach because AAD is so foreign to me, I can't make substantial progress. I don't know if it's me or the tool, but it sure as hell is the documentation.
End Rant
With all the questions lacking answers I... couldn't make progress. I didn't know where to go next, or what to try next. The entire AAD(B2C) space was open as an option... and I probably don't know 90% of the options.
That was the route I was going. I couldn't get myself to code.
I'd sit down... play Path of Exile... get bored... want to code... and go do something else.
I had this MASSIVE internal resistance to doing work on the project. This wasn't because I was blocked. When I'm blocked I will beat myself bloddy against that wall. I WILL find a way around it. Blocked means I don't have a solution yet.
This... I had solutions. I have things I COULD do... but they didn't feel right.
I struggle to code things that don't feel right. The solution I had... wasn't coming easily. It felt like I had to fight the code to get things done.
One of the big lessons from the training I got from Fred was to listen to the code. If you're fighting the code to get things done... you're probably not implementing the correct solution.
I don't fight the code anymore. For work, I spend time playing to figure out better solutions. For the side project, I don't always have the time/energy/focus. Maybe I don't even have the knowledge... The AAD(B2C) stuff is probably pretty heavily entrenched in the 'lack of knowledge' reason. I had solutions, though.
It didn't sit right.
The Twist
I sat down a couple nights ago and faced the fact I didn't like where I was going. I put up a few ideas.
Created some pro/con lists.
Thought about thigns.
Sketched out designs.
Resketched designs.
Dug into some designs.
Went away.
I didn't like the options. Felt like reinventing the wheel. AAD(B2C) exists and DOES everything (99.9999% sure) I need it to.
Came back.
Picked one.
Experimented.
Create JWT - Easy.
Auth JWT - Easy.
Hashing Password - Easy.
Fuck... database... Oh - Not bad.
I'm using Azure functions for the heavy lifting. Running the functions locally, with postman, makes database development not suck nearly as much as it has in the past.
This is where I stopped. I got about 12 hours of work in over the weekend implementing functionality and MicroObjects. This got me to about 75% of where I was with AAD. The exception is that I know how to hit that 20% I didn't know how to do through AAD. It also excludes some extra work that AAD would have forced. I have to so similar, but without, for example, syncing information between the AAD and the locally used user information.
I didn't start back up because I wouldn't of stopped until the birds started chirping. Once I started down the "reinvent the wheel" path, I could make progress. I could see the path far into the distance. Not some short hop and then darkness.
What's this mean?
What all this emphasizes for me is that when I struggle to be motivated to code on something; I should start checking if it's because I don't agree with the plan. Take the time to write out the options, pro/con list, sketch designs... do experiments.
This level of struggle is pretty new to me, but it's just like when the code resisted my intent, the design wasn't fitting nicely.
Don't Be Me
I want to minimize any potential impact of "this is what an engineer should be" from my obsessive approach to software. A lot of us put in too much time, others are more naturally gifted at it.
We all can be engineers, and none of us will approach it the same.
Software Engineering is my hobby. I do it for fun.
There are downsides... and it's who I am. This post is an example of one of the things affecting me, because I'm me. :)