Eric Evans, "Preface", in Domain-Driven Design: Tackling Complexity in the Heart of Software, xxii.When people learn design techniques, they feel excited by the possibilities. Then the messy realities of a real project descend on them. They can't fit the new design ideas with the technology they must use. Or they don't know when to let go of a particular design aspect in the interest of time and when to dig in their heels and find a clean solution. Developers can and do talk with each other abstractly about the application of design principles, but it is more natural to talk about how real things get done. So, although this is a design book, I'm going to barge right across that artificial boundary into process when I need to. This will help put design principles in context.
Saturday, July 20, 2019
Design versus development process
Sunday, July 14, 2019
Domain-driven design
Eric Evans, "Preface", in Domain-Driven Design: Tackling Complexity in the Heart of Software, xxiii.In recent years there has been a rebellion against elaborate development methodologies that burden projects with useless, static documents and obsessive upfront planning and design. Instead, the Agile processes, such as XP, emphasize the ability to cope with change and uncertainty.
Extreme Programming recognizes the importance of design decisions, but it strongly resists upfront design. Instead, it puts an admirable effort into communication and improving the project's ability to change course rapidly. With that ability to react, developers can use the "simplest thing that could work" at any stage of a project and then continuously refactor, making many small design improvements, ultimately arriving at a design that fits the customer's true needs.
This minimalism has been a much-needed antidote to some of the excesses of design enthusiasts. Projects have been bogged down by cumbersome documents that provided little value. They have suffered from "analysis paralysis" with team members so afraid of an imperfect design that they made no progress at all. Something had to change.
Unfortunately, some of these process ideas can be misinterpreted. Each person has a differente definition of "simplest". Continuous refactoring is a series of small redesigns; developers without solid design principles will produce a code base that is hard to understand or change - the opposite of agility. And although fear of unantecipated requirements often leads to overengineering, the attempt to avoid overengineering can develop into another fear: a fear of doing any deep design thinking at all.
In fact, XP works best for developers with a sharp design sense. The XP process assumes that you can improve a design by refactoring, and that you will do this often and rapidly. But past design choices make refactoring itself either easier or harder. The XP process attempts to increase team communication, but model and design choices clarify or confuse communication.
This book intertwines design and development practice and illustrates how domain-drive design and Agile development reinforce each other. A sophisticated approach to domain modeling within the context of an Agile development process will accelerate development. The interrelationship of process with domain development makes this approach more practical than any treatment of "pure" design in a vacuum.
Sunday, June 30, 2019
All the little things
Sandi Metz's presentation on RailsConf 2014 is one of the best talks on OOP and refactoring that I've ever seen:
Main takeways:
- Refactor under green
- Inheritance is not evil
- Prefer duplication over the wrong abstraction
- "make the change easy (warning: this may be hard) then make the easy change" - Kent Beck
- Make small things (functions, methods, classes, etc.)
- Refactor through complexity
Wednesday, April 10, 2019
Invest in good software abstractions to simplify difficult problems
Edmond Lau, "Manage Complexity through Abstraction", in The Effective Engineer: How to Leverage Your Efforts In Software Engineering to Make a Disproportionate and Meaningful Impact, 113.But like many other aspects of code quality, building an abstraction for a problem comes with tradeoffs. Building a generalized solution takes more time than building one specific to a given problem. To break even, the time saved by the abstraction for future engineers needs to outweigh the time invested. That’s more likely to happen with software the team relies heavily on — such as logging or user authentication libraries — than with peripheral parts of the codebase, so focus more energy on making the core abstractions great.
Friday, October 12, 2018
Prioritize data integrity
Edmond Lau, "Be Skeptical about Data Integrity", in The Effective Engineer:Make sure your data is reliable. The only thing worse than having no data is the illusion of having the right data.
How to Leverage Your Efforts In Software Engineering to Make a Disproportionate
and Meaningful Impact, 78.
Sunday, July 15, 2018
Microservices migration
Increment's issue on cloud computing has an interesting article about cloud migration, containing case studies from different companies. One special thing to notice is that many aspects of the stories resemble things that I've also heard or saw about microservices migration. Given the move various startups are taking in the path of breaking monoliths, it's worth reading the article just changing the word "cloud" by "microservices" and learn from the experiences reported.
Tuesday, June 12, 2018
About blogs and books
The first post I published in this blog was about the importance of reading technical books. It was written in portuguese, but I've always wanted to translate it to English, or at least create an English version. Time has passed and, for various reasons, it hasn't happened, but I think it's not necessary anymore: Phil Caçaldo's post Read The Dinossaurs! already did the job.
I've started to read Phil's blog recently and have enjoyed much of his writings so far. This one, however, captured my attention in a special way, given I'm a passionate for books too. Thanks for that, Phil!
A curious note: I ended my post by mentioning Fred Brooks, whose The Mythical Man Month I had just finished at the time and enjoyed a lot, and Phil's post starts by mentioning exactly the same book. A coincidence that could not have been more appropriate in this case.