
Surfacing timeless dev wisdom to build better software. Help fund the coffee and books via tips or: https://xitter.cf/t.co/gAxtgimLaK ☕️
Joined May 2024
- Tweets166
- Following35
- Followers577
- Likes217
A software project is an evolutionary system. The software architect nominally defines the constraints on this evolution.
However, "architects never know all important parts of the architecture at the beginning [...] and thus must identify fitness functions as the system evolves" (Ford, Parsons and Kua, 2017, "Intentional Over Emergent", para. 1).
The system is evolutionary because the rules of the system change based upon the game that's played within it, i.e. we change our coding standards based upon issues we're encountering with our current standards.
By constraining the direction in which change is possible software architects try to prevent evolution in certain undesirable directions. It is impossible to micro-manage, it is only possible to constrain, such that, the direction of evoltuion points generally in a particular direction.
Sometimes, we discove that change is moving in an undesirable direction, it is at this point that we must re-consider the constraints we've placed on development.
References 👇
There are no reasonable templates in software design and architecture. There are patterns but they are a toolbox, selecting the right tool is the key decision.
The architecture of a software project should be intimetly optimized to the needs and abilities of a particular organisation.
"The specific architectural requirements differ greatly across systems and organizations, based on business drivers, technical capabilities, and a host of other factors. Some systems require intense security; others require significant throughput or low latency. Whereas some might need to be more resilient to failure" (Ford, Parsons and Kua, 2017, "Chapter 2. Fitness Functions", para. 3).
Don't try to drive nails with an electric drill. Rather, seek to undersand what the fundamental constraints of your system are and then find the tools to it the problem.
References 👇
I'm really tired of "architects" who have not made contact with the system in a year and spend all their time in meetings and on draw.io
The hardest technical decisions should constantly be bubbling up to your desk.
Poor software architects spend their time drawing low-dimensionality diagrams of their systems imaging these strawmen to be the system itself.
One must not forget: The map is not the terriotry.
If you're stuck at the top of the tower staring at your map all day you have failed as an architect. If you're not connecting with your developers, if you haven't seen any of the code recently, you've failed as an architect. You've disconnected from the reality of the system and are un-fit to make decisions. You have become an expensive obstrution and should be removed immedietly.
If you find yourself daunted by the idea of pivoting to a different framework something has gone wrong!
Vast amounts of content out there downplays the importance of separating business logic from the frameworks, libraries and third party systems that support it.
A sure-fire way to ensure progress on a project will grind to a halt in the long-term is to make framework logic is inseparable from what the software *actually does*
Good software leaves space for an evolution in the technology that supports it.
"Although we cannot predict when changes in the technical or domain landscape will occur, or which changes will persist, we know change is inevitable. Consequently, we should architect our systems knowing the technical landscape will change" (Ford, Parsons and Kua, 2017, "How Is Long-term Planning Possible", para. 8).
If you haven't had your technological decisions come back to bite you, forcing you to pivot, you haven't stuck with a project long enough. Cheaper and faster supporting technology is constantly becoming available to you, if you're not able to use the tools others will out-compete you.
References 👇
1
3
833
A test suite must feel good to use in order to be used and therefore be useful.
Many test suites are untrustworthy and slow to run. They generally don't expand upon it and when they rarely do write tests they do so bitterly.
To be useful a test suite should be:
* Fully automated
* Self-Checking
* Repeatable
* Independent
(Meszaros, 2007, p. 26-27)
If you're tests require manual work you'll skip some.
If your tests are flaky or randomly fail you won't trust them and you won't run them.
If you can't run an individual test the suite will feel like a slog to use and you won't run it as often as you should.
"With these four goals satisfied, one click of a button (or keyboard shortcut) is all it should take to get the valuable feedback the tests provide" (Meszaros, 2007, p. 27).
References 👇
1
1
514
In today's digital age, software plays a critical role in nearly every aspect of our lives. By focusing on the production of quality software, software engineers contribute to building a more reliable, safe and rich technological landscape for a global society.
"Engineering seeks quality; software engineering is the production of quality software" (Meyer, 2000, p. 3).
Software engineers should apply rigorous principles, methodologies, and tools to craft well-designed, efficient, secure, and maintainable code. We should collaborate closely with stakeholders to understand the requirements and ensure we solve actual problems for end-users.
Beyond just writing code, software engineering encompasses the entire software development life-cycle. From initial planning and design, to implementation, testing, deployment, and ongoing maintenance, software engineers should work diligently to produce software that meets the highest standards of quality.
References 👇
The most common failing and time-waster I see in software development is building something before you know what you're building.
As Gerard Meszaros (2007) puts it, "if our customer cannot define the tests before we have built the software, we have every reason to be worried!" (p. 4. footnote 1).
In general it is true that there's at least some small piece of a project that can be formally specified. There's always something the customer wants and can articulate. However, getting to it is difficult more often than not.
That is not to say that there isn't something meaningful to be gained in the exploration of building the *wrong* thing initially. Quite often through the process of building something we will discover something that makes us change course. It is very difficult to imagine a product holistically, it is only once customers start using the product they requested intimately do they understand that in fact *they wanted something different*.
This is one of the reasons benefits of shipping releases often and iteratively as is one of the intentions of Agile. It allows us to immediate feedback from our customers, either directly or through data, allowing us to course correct as early as possible, when it's as cheap as possible to do so.
Hence, it is crucial that as developers we strong arm the customer into defining one piece of the puzzle at a time as formally as possible. We should then write the tests that imply to us we have done what the customer has asked. We should then make those tests pass and we should ship a release to the customer as soon as technically possible.
#Testing
References 👇
Keeping options open is the thing that keeps soft-ware soft. If the software doesn't have plentiful options to evolve it falls behind and fails. (Martin, 2018).
"[Microservices] are a type of service-oriented architecture, albeit one that is opinionated about how service boundaries should be drawn, and one in which independent deployability is key. [...] This means microservice architectures avoid the use of shared databases in most circumstances; instead, each microservice encapsulates its own database where required" (Newman, 2021, p. 3-4).
There are a lot of misconceptions about what architecture is. In reality, all the benefits of microservices are not about architecture. They are about deployment. An architecture should allow you but not force you to deploy your software as microservices.
If the architecture overly constrains your deployment options consider what trade-offs you've made.
References 👇
Software engineers have long recognized the value of immutability in their code.
Immutability simplifies reasoning about code and reduces the potential for bugs.
"If you've lived all your programming life with mutation as an ever-present possibility, you may not realize how much easier immutability makes everything" (Seemann, 2024, "Conclusion", para. 1).
However, achieving full immutability is not always practical. "One of the most common compromises in regard to immutability is to segregate the application, or the services within the application, into mutable and immutable components" (Martin, 2018, p. 68). This allows developers to reap the benefits of immutability where it matters most while still allowing for necessary mutations in other parts of the system.
The tension between the mathematical purity of immutability and the practical needs of software development has long been recognized.
In as Bertrand Meyer says in his book Object Oriented Software Construction, "The problem is that if we allow functions to change things as well as commands, we lose many of the simple mathematical properties that enable us to reason about our software. [...] This immutability is the principal difference between the worlds of mathematics and computer software. [...] Some approaches to programming seek to retain the immutability of mathematics: Lisp in its so-called 'pure' form. [...] But they have not caught on for practical software development, suggesting that change is a fundamental property of software" (2000, p. 750).
Despite these challenges, the benefits of immutability are becoming increasingly clear.
"Many of us in the software industry are starting to take notice of the benefits of immutability in software architecture. [...] The claim (which many of us believe based on informal empirical evidence) is that immutability leads to programs that are easier to reason about and harder to screw up" (Fowler, 2013, pp. 8).
As software systems become increasingly complex, the value of immutability in reducing cognitive load and improving reliability will only continue to grow. By embracing immutability where possible and carefully managing mutations where necessary, developers can create more robust and maintainable software systems.
xitter.cf/ploeh/status/180091504…
References 👇
New article: Simpler encapsulation with immutability. blog.ploeh.dk/2024/06/12/sim…
Reconciling the abstract and the concrete IS software development 🧮💻
"For some scientists, software development is a branch of mathematics; for some engineers, it is a branch of applied technology. In reality, it is both. The software developer must reconcile the abstract concepts with their concrete implementations" (Meyer, 2000, p. 9).
As developers, we live at the intersection of theory and practice. We take the elegant mathematical models and algorithms dreamed up by computer scientists and translate them into reliable, efficient code that solves real-world problems. It's a constant dance between the idealized and the pragmatic.
Great software strikes that delicate balance — remaining true to the underlying principles while adapting to the constraints and edge cases that inevitably arise during implementation. As engineers, our job is to hold these twin truths in our minds, leveraging the power of abstraction without losing sight of the nitty gritty details.
Next time you're deep in a challenging project, embrace the duality of our craft. That's the art of software development!
References 👇
References
Meyer B., (2000). Object Oriented Software Construction. (2nd ed.) [Online edition.]. Accessed from: bertrandmeyer.com/wp-content…
Times are changing, with the rise of machine learning and "big data".
"Computer scientists, by nature, don't respect data. They have traditionally been taught that the algorithm was the thing, and that data was just meat to be passed through a sausage grinder" (Skiena, 2017, p. 2).
Many CS programs have historically placed far more emphasis on clever algorithmic techniques than on the quality and curation of datasets. The result? A generation of computer scientists who see data as secondary - just fodder to feed the machine.
Lost is the deep understanding that good data is the lifeblood of any successful real-world system. As the old adage goes, garbage in, garbage out.
References 👇
There's no mistake you can't get away with when the scale is small.
It is only at a large scale that otherwise manageable change becomes daunting.
Ensuring that the software can continue to evolve is the great discriminator.
Features are easy to copy, quality is hard to achieve.
"Software is supposed to be soft, and indeed is in principle; nothing can be easier than to change a program if you have access to its source code. Just use your favorite text editor.
The problem of extendibility is one of scale. For small programs change is usually not a difficult issue; but as software grows bigger, it becomes harder and harder to adapt" (Meyer, 2000, p. 6).
References 👇
References
Meyer, B., (2000) Object Oriented Software Construction. (2nd ed.) [Online edition.]. Accessed from: bertrandmeyer.com/wp-content…
Many projects that start off with a microservice "architecture" end up with an explosion of components. Expensive to maintain, hard to deploy.
Components are fundamentally a unit of release. "They are the smallest entities that can be deployed as part of a system" (Martin, 2018, p. 105). They are therefore expensive to maintain, they require a release schedule and versioning if they are to be reliably depended upon.
"For most applications, maintainability is more important than reusability. If the code in an application must change, you would rather that all of the changes occur in one component, rather than being distributed across many components" (Martin, 2018, p. 114).
When change spans multiple components it requires more organizational coordination to implement. It may require multiple teams to coordinate, or a single team to implement, release and integrate changes across multiple components. Hence, change that requires the updating of several components is more likely not to be implemented.
It's easy to overlook these costs when the project is small. However, as a project's size increases businesses are often paying in DevOps hours for perceived savings in developer hours.
References 👇
Every change to an abstract interface corresponds to a change to its concrete implementations.
Conversely, changes to concrete implementations do not always, or even usually, require changes to the interfaces that they implement" (Martin, 2018, p. 100).
Cross-cutting functionality has the highest maintainability return on investment to isolate. Changes in cross-cutting functionality can often have cascading effects on the rest of the system.
Cross-cutting components are fundamentally "stable". They are stable, not because the abstractions they provide are necessarily particularly well designed, but, rather, because their abstractions are so readily depended upon that any breaking change to the interface fundamentally triggers an expensive cascade of down-stream changes that make instability undesirable.
References 👇
1
4
567
Often programmers never get to see the full consequences of their decisions.
"Every software system provides two different values to the stakeholders: behavior and structure. Software developers are responsible for ensuring that both those values remain high. Unfortunately, they often focus on one to the exclusion of the other. Even more unfortunately, they often focus on the lesser of the two values, leaving the software system eventually valueless" (Martin, 2018, p. 36).
The median tenure of programmers tends to around 18-24 months. Therefore, most programmers are not in a position to have ever seen the long term effect of their early decisions.
"Discussions of software methodology tend to focus on the development phase; so do introductory programming courses. But it is widely estimated that 70% of the cost of software is devoted to maintenance" (Meyer, 2000, p. 17).
Making something work today is the most basic requirement. However, the real value of software is in its ability to change. If you have never had to maintain the software you have written and add features to it over half a decade you have never had your choices come back to bite you.
References 👇
References
Martin R. C., (2018). Clean Architecture A craftsman's Guide to Software Structure and Design. Pearson Education, Inc..
Meyer, B., (2000). Object Oriented Software Construction. (2nd ed.) [Online edition.]. Accessed from: [bertrandmeyer.com/wp-content…](bertrandmeyer.com/wp-content…)
160
Independent deployability is about drawing component boundaries that truly isolate change.
"[It] is the idea that we can make a change to a microservice, deploy it, and release that change to our users, without having to deploy any other microservices" (Newman, 2021, p. 6).
"Regardless of how they are eventually deployed, well-designed components always retain the ability to be independently deployable and, therefore, independently developable" (Martin, 2018, p. 105).
Independent deployability is a key concept, however, many think that simply putting things into different databases gets the job done. This is false. It is more likely than not that one simply ends up with a distributed monolith, highly complex to operate and expensive to deploy.
References 👇
Software maintenance cost are more than capable of growing faster than your company's revenue.
"We all want our software systems to be fast, reliable, easy to use, readable, modular, structured and so on" (Meyer, 2000, p. 3).
However, these describe two different sorts of factors: External and Internal. Those that are visible by the user (External) of the software and those that are visible to the maintainer (Internal) (Meyer, 2000, p. 3-4).
Most programmers understand intuitively that qualities visible to the user are essential to selling a product.
However, most do not understand the importance of software qualities that are only visible to the maintainer.
It is more probable than not that without directing your attention towards it the internal quality of software will decline. A decline in internal software quality necessarily increase development cost in the long term.
Poor internal quality will: increase costs, increase employee turnover, and inevitably lead to poor external quality as well.
References 👇
Software architecture is fundamentally about drawing boundaries and isolating change in order to keep options open.
"We don’t know what the future holds, so we’d like an architecture that can theoretically help us solve whatever problems we might face down the road. Finding a balance between keeping your options open and bearing the cost of architectures like this can be a real art" (Newman, 2021, p. 10).
Software architecture is much more about the technology than it is about the domain. It is about minimizing the amount of technical decisions that need to be made. It is about being able to use simple solutions today and swapping them out cheaply tomorrow.
References 👇
Writing tests opens us up to our own blind-spots.
Often you will find that through the process of testing issues that you otherwise would not have considered come to the surface. 🐳
"[W]hen we ask developers why they write tests, they look at us as if we just asked if they still coded using punched cards and they’d say “to make sure the code works [..] Testing Is Not About Finding Bugs. We believe that the major benefits of testing happen when you think about and write the tests, not when you run them" (Thomas & Hunt, 2019, p. 214).
By writing tests we engage with the code we write differently. We engage with it more actively and from a more detached perspective.
References 👇
3
4
703
Everyone's first question about microservices is about "size". A microservice should be the size of a bounded context. It depends on the business your software supports and the experience of team you have.
"Bounded Contexts have both unrelated concepts (such as a support ticket only existing in a customer support context) but also share concepts (such as products and customers). Different contexts may have completely different models of common concepts with mechanisms to map between these polysemic concepts for integration" (Fowler, 2019, para. 5).
"James Lewis, technical director at Thoughtworks, has been known to say that “a microservice should be as big as my head [...] Perhaps it would be better to read James’s quote here as “a microservice should be as big as your head" (Newman, 2021, p. 9)
A bounded context is fundamentally about encapsulating a piece of a larger model into a manageable size. The definition of manageable is dependent on the people that inhabit the organization. It becomes unmanageable at the point at which the language the team(s) use(s) to communicate starts breaking down.
Once you internalize this way of thinking you might be surprised to find how much less "micro" your services are. Lots of basic systems do not benefit from maintaining multiple, independently deployed services due to DevOps overhead.
References 👇
2
2
565
