93 points · by sdeframond · 3y ago · 40 comments
If you start putting it all together you will most likely only confuse other developers, especially juniors. Don't do it. The point of gathering all this knowledge should be making the application simpler and easier to maintain. So introduce stuff gradually and only when you find the added complexity pays out.
Also: train your juniors, please. Getting thrown into the deep end REALLY hurts the speed of learning.
There needs to be a progression and you go from focus on low level stuff to focus on high level stuff.
For any single thing, at least at the beginning of the career, you first start with copying, then you imitate, then you get proficient, then you hopefully go to understand it on a deep level -- mastery.
Junior devs -- learn to use the tools. The focus of juniors should be on getting productive within the team and this means being able to do a significant volume of tasks that require least high level knowledge -- repetitive/routine tasks, low level tasks, localised changes. As far as the high level concepts, juniors are not expected to contribute or even understand them -- they are expected to be able to work within the the project structure. It is the tech leadership job to make sure that juniors can be productive even without understanding high level concepts, strategy, etc.
Senior devs -- are expected to know the tools, learn the high level design concepts. They are also expected to have enough experience to be able to tell right from wrong. The focus of senior developers is to understand and be able to productively use high level development concepts. This means ability to design single applications, modules, interfaces, etc. Work productively with stakeholders. Work productively with juniors. Etc. Seniors is when you should start understanding programming patterns, paradigms, learn when to use them, etc. Seniors are not expected to be able to solve all problems and still require some supervision. Seniors also are not expected to be able to form or understand strategic concepts.
Tech leader / principal developer -- are expected to know the tools, know high level development concepts AND also be strategic about it. Tech leader, however intelligent he/she is, is also expected to have immense experience at various types of projects so that he can immediately tell right from wrong and use his experience to put forward solutions that worked in the past and critique solutions that are known not to work. Tech leader is the person that needs to be able to understand and debug entirety of technical situation, form the vision of where he/she wants to be in future and put together coherent strategy. For example, tech leader is the one responsible for understanding blockers for individual contributor productivity and find strategy to improve and resolve these issues. Tech leader IMO should also be a person that is able to solve ANY problem, technical or otherwise.
A question like "how do I put it all together" signals focus on tools rather than focus on the product. When developers learn new things they frequently look for opportunity to use them. This preoccupation with the tool they just learned usually happens at the cost of the product. They are looking for a way to add things to the project rather than look for ways to remove unnecessary things.
The right state of mind for architect/designer is to seek learning/understanding paradigms, tools, technologies, etc. to have a library of solutions for when they are needed and be able to recognise when it is the right time to do it, not to try to find a way to use something they just learned.
The argument that juniors will have a hard time understanding it can be said about anything you don't like / don't want. And then you can begin to lay it on thick. It's a convenient scape goat for sure.
My goal in life is to learn so that I can engineer systems and write code that is as simple as possible. It takes a bit of courage to put forward code that looks like everybody could write it -- which is exactly the point of getting more mature in software development.
One problem I always had is that managers seem to reward people for how complicated projects they are working on rather than reward for putting in effort into making things simple. This makes a bit of conflict of interest but I personally resolved to do what is right and feel good with myself rather than to play the silly game of who can overcomplicate the project the most and still get away with it. Half the time the benefits of my approach become apparent after some time with the project -- the other half I don't get enough time or get a manager who doesn't want to understand where the productivity comes from.
> Understand all of this, but use only what you need.
As one of those engineers that's forbidden to talk in public, I can assure you these patterns are extremely useful to keep valuable software viable, extensible, and maintainable for 15+ years. I just can't drop any specifics because IP lawyers are assholes.
Combination of CQRS, event sourcing and kafka.
And I agree with falkensmaz3, they definitely do exist and they work much better in terms of defining the business domains and the way(s) the business "Nouns" interact with each other.
CQRS is another story, it is relatively widely used and very handy in certain scenarios.
Is LINE Pay designed in a form of some kind of onion architecture?
If the business still exists and is continuing to evolve 15 years later, why shouldn't the code base?
Onion architecture, vertical slice, ports & adapters, hexagonal architecture, clean architecture, functional core imperative shell. These are all very similar, and tends to get invented over and over again.
Most of the projects I ever workers with either started off as DD+Clean/Hexagonal architecture, or were refactored to comply with those architecture styles.
It's easy to understand why once you realize that those buzzwords are basically tags for a group of fundamental best practices that lead projects to become clear and easy to include changes.
I should have probably gone to Google for this before posting, because it is one of those things that should exist, so it probably does.
Edit: Maybe http://aosabook.org/en/index.html
These architectures were introduced around 20 years ago to address technical shortcomings of enterprise systems at that time.
Quoting the original article on Hexagonal architecture (https://web.archive.org/web/20090327032122/http://alistair.c...), the motivation was to address those 3 problems:
> - First, the system can’t neatly be tested with automated test suites because part of the logic needing to be tested is dependent on oft-changing visual details such as field size and button placement;
> - For the exact same reason, it becomes impossible to shift from a human-driven use of the system to a batch-run system;
> - For still the same reason, it becomes difficult or impossible to allow the program to be driven by another program when that becomes attractive.
Is any of the above a real pain in the project that you are building in 2022?
I very much doubt it is. And if it's not, then introducing such an architecture will bring more harm than benefit.
There were some interesting discussions on that topic lead by Martin Fowler few years ago: https://www.martinfowler.com/articles/badri-hexagonal/
It sounds like you don't do much, if any, professional work.
> These architectures were introduced around 20 years ago to address technical shortcomings of enterprise systems at that time.
No, not really, and your personal assertion completely misses the whole point of DDD or any software architectural style you mentioned.
The whole point is to keep software flexible and accommodating of change, and in the process reflect a set of very basic software design principles that avoid/eliminate problems such as circular dependencies or testability.
> Is any of the above a real pain in the project that you are building in 2022?
Again, you don't seem to have much if any professional experience. UI testing, or any type of testing involving UI work either directly or indirectly such as accessibility/localization or any end-to-end test in general, is still an unsolved problem and a bane of software engineers.
Nevertheless, your comment reads like a strawman. The main benefit, and the whole point, of layered architectures is to ensure the software architecture to simplify modifying/updating the bits that change very frequently and stabilize and minimize the need the fundamental bits that only rarely need to be touched. UIs tend to be the part of an application that is updated the most, thus it makes all the sense in the world to adopt a software architecture which handles UI as a separate external component which minimizes or eliminates both fan-in, and turns fan-out to be a non-issue by depending on abstract interfaces whose concrete implementations are injected. These are not dad's from the 1990s,these are fundamental software engineering concerns.
Most of this stuff is just developing against interfaces, and having that interface owned by the business code.
All infrastructure code implements those interfaces. Business code code doesn't get polluted by technical infrastructure stuff. It's easy swap out databases, etc
Always a good idea.
Functional core, imperative shell is also a modern term for this.
I won't name and shame, but I shudder at the thought of all that organically-grown spaghetti.
Why would you do this to yourself voluntarily?
Also Django, while arguably not really FP is still perfectly testable, and not dealing with any of all of that. Why would I want to manage at minimum three classes for every endpoint?
Maybe this has some justification in a situation with a couple hundred devolpers on software handling millions of dollars worth of stuff... but otherwise??