No two projects are ever the same, EVER
Now, this might come as a shock … or not … actually I can feel that you are awkwardly smiling and nodding your head while reading this. Good, if we are on the same page, than let me throw in a quick question, why than do we always look for and obsess about “best practices”, “frameworks”, and generally absolut, generic and impersonal way of doing things ?
Well, actually, this is the meat of the matter, this is a story about trying to fit square pegs into round holes.
Well, its not all bad …
Now, if you think about it, it is actually not all bad, there is a good reason for having “best practices” and “frameworks” and the like for some problems. But usually the type of this kind of problems are usually narrow in scope. For example, from a code perspective, we have various design patterns, let’s chose one random cat of the bag, and lets go with the “Repository” pattern. ( Don’t worry, it is just for illustration purposes, we will not be delving to much on this today … )
So, at its simplest, a repository has the following job:
Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
According to the folks at — MartinFowler.com
This seems, useful, this seems nice, but is this a “must” on every project with a database ?
If repositories are way to specific to a few OOP languages, than maybe we can raise the abstraction level, and look at JS frameworks, I mean, anytime you need to build a highly interactive, reactive, nice and fluid website, it is amazing that we have the opportunity to pick from React, Svelte, Vue, Angular and a lot more, but should ALL websites be SPAs ?
When you have a software project to deliver, with various requirements, timelines, and a steady stream of new features, and no clear end in site, SCRUM maybe a good option, but should ALL software projects adhere to Agile SCRUM with (2–3 weeks ) sprints, a lot of status meetings, and various stakeholders giving their 2 cents ?
Go is webscale, Flutter is the new hot potato, Kotlin is modern and Java smells like old people… C# ? More like Windows simp … SQL ? The 90s just called and want their tech back!
Oh, this escalated quickly… from an “eloquent essay” to “get off my lawn” in 3 paragraphs, but I just wanted to get you in the proper mindset.
What was the problem again ?
The problem, mainly is that nowadays, with all the hype titles, ChatGPT content, everything is so divisive and absurdly decisive.
I mean, I don’t want to put any print screen to shame anyone, but just open a tech stack focus search on youtube, or here, on medium, and you will see titles like this:
- Don’t do this do that!
- Y things real people do!
- Y signs you suck, and what to do about it
It should be quite obvious that is is highly exaggerated, but if you use the internet and the mentioned platforms ( well you are reading this on medium … 🤭) you know what I mean.
And while, this articles and videos might have valuable information, nearly all of them lack on important thing, and from my perspective, the most important thing…
👑 Context
Yep, this 👆. And just for the fun of it :
“Why Context matters, and why you s#uck for not providing any”
In the context of highly specific things, like setting up Keyclock / IdentityServer with LDAP, this does not really matter context wise.
But when you are preaching, why “Repositories” are the bane of our existence and how you, due to them went from writing code at 243 wpm ( words per minute) to 72, and how you spent 4 weeks removing all traces of this vile practice from you codebase, I would like to know a few things your context and usecase. I mean, maybe you are in the right, and “Repositories” should never have been used, or maybe you have drunk the coolaid and want to yolo the “JPA/ADO.NET/SDK” CQRS lifestyle, or maybe for you this is a good choice. But without context, and a few lines on what the product does, what the team structure is (are you han-SOLO, or part of a team), what level of seniority is in the project.
So, the takeaway is quite simple, wrapped in a to-go bag, try to keep an open mind, try not to make absolute claims, and always think about context, because, say it with me:
Context is 👑 (king) !
Have a great one!