Table Of Content

Designing things twice (Chapter 11) is a suggestion that hits close to home. This is advice I've been suggesting to people to get better at designing systems, well before I read this book. This post summarizes key takeaways of the book and my take on these principles, drawing from my professional and industry experience.
List of software development philosophies
(it's 180 pages, so it's a quick read.) Each chapter is short and to the point, like the entire book. This doesn't mean "generalised" implementations that support extra features thatyou don't need - it means writing methods that are not overly specialised. Thesweet spot is a somewhat general-purpose approach, which hopefully provides asimpler and deeper interface. "Agile" and similar approaches to software development tend to be focused onsmall, tactical changes. It's easy in this environment to forget about investingin the codebase, especially in startup companies that have a lot of pressure todeliver features.
Abstraction and Encapsulation:
Sharing design ideas upfront and opening a debate using these tools is a great way to build more sturdy architecture. Especially when applying the "design it twice" principle, and writing up alternative designs considered, and the tradeoffs why the other design was not chosen. Still, I wondered just how much I would learn about software design from experience partially distilled from a classroom - even if a Stanford classroom.
Unit tests
The author generally supports writing unit tests, which can catch problems during refactoring; he doesn’t like TDD. When fixing defects that can be tested beforehand, he suggests adopting TDD so that the test may verify that the bug was fixed once the required adjustments have been made. The book also introduces a set of red flags that identify design problems.
The first part of the book focuses on good, modular design practices, while the second part of the book touches on techniques to make the code simple, as well as goes in-depth on commenting best practices. People sometimes ask me if there are other books on design that I would recommend. Unfortunately, I haven't seen very many publications that I like, but one book I do like is The Art of Readable Code by Dustin Boswell and Trevor Foucher. It's written at a lower level than APOSD (more about coding than design), but it is compatible with APOSD in philosophy has a bunch of good ideas.
Cyber advisory identifies a 'trend of systemic weaknesses' in digital configurations - Nextgov/FCW
Cyber advisory identifies a 'trend of systemic weaknesses' in digital configurations.
Posted: Fri, 06 Oct 2023 07:00:00 GMT [source]
Chapter 18 — Code Should be Obvious
This means that the interface of some functionality should be a lot simpler than its implementation. That way, the cost of understanding and using the interface is lower than the benefit of the implemented functionality, thus helping to lower the overall complexity of the system. A module in this sense can be anything from a method or function, to a class or a subsystem. The goal of software design is to reduce the complexity of the system.
Deep modules
It's awell-structured, concise read about managing complexity in software design. An example of a deep module is the Unix/Linux system calls for I/O operations. There are five of them (open, read, write, lseek, close), and the signatures are simple, but they hide an enormous amount of implementation details on how files are stored and accessed on disk. In contrast, an example of a shallow module is the Java I/O classes. In order to open and read from a file, you need to use a FileInputStream, a BufferedInputStream and a ObjectInputStream.
Best of 2023: Documentation as Code: A Game Changer for DevOps Teams? - DevOps.com
Best of 2023: Documentation as Code: A Game Changer for DevOps Teams?.
Posted: Fri, 05 Jan 2024 08:00:00 GMT [source]
There are multiple chapters on code comments; even Chapter 15 has the title “Write The Comments First” (Comments-first development?). He states, “Every class should have an interface comment, every class variable should have a comment, and every method should have an interface comment.” This way of thinking introduces a lot of noise in the code. Such comments need to be constantly synced with the changes in the code.
Event-driven programming makes code less obvious
Stanford University Professor of Computer Science John Ousterhout says it is a decomposition problem. In his book “A Philosophy of Software Design,” he advocates that good software design means fighting complexity and recommends different strategies for dealing with it. The book was initially published in 2018, and its second edition was released in 2021.
Even if you don’t agree with everything it is still a good addition to your library of programming books. I very much recommend the first half of the book - chapters 1-9 and chapter 14 - for all software engineers to read, digest, and consider applying. Concepts like depth of modules, layers adding complexity - or keeping complexity at bay - and information hiding are pragmatic tools to use when designing software. The book offers a fresh take on the concept of abstractions, and nicely complements principles like simplicity, KISS (Keep it Simple, Stupid) and YAGNI (You Ain't Gonna Need It). I have to disagree with the excessive use of code comments, although the author mentions that we should use them only for what is not apparent.
However, the final 70 pages are filled with recommendations about code comments that I find hard to support. Most of the examples the author provides of useful comments could easily be replaced with better named variables and methods. Because of this poor advice, I can’t recommend this book for junior engineers.
These interfaces accumulate to create tremendous complexity at the system level. Small classes also result in a verbose programming style, due to the boilerplate required for each class. People oftenbreak a routine into multiple functions for the purpose of making it "easier" toread, or to avoid some code duplication, or to lower a cyclomatic complexityscore.

I particularly like the way the author challenges conventional thinking within software industry and highlights the inefficiency in this thinking. Despite this, the critical issue in any software project is always how to successfully manage the complexity going forward. In the particular project I am architecting there are a lot of moving parts, integrations and complex workflows that need to be addressed, this can often result in spinning out of control quickly.
There isn't much to say about this, other than thatI intuitively agree. The book is also quite small and light which makes a great read for your daily commutes. The author emphasises the benefits of trying to stay in Technical Credit rather than Technical Debt. John, on the other hand, had the vantage point of having multiple teams solve the same design problem during a semester, with him observing. With each repeat, he was able to both validate and tweak his observations.
John mentions that consistent naming contributes to less complexity - something I wholeheartedly agree with. This approach can be used at different system levels, from the interface selection to the method implementation. For interfaces, we are the one that matches close the operations happening in higher-level software, while for implementations, the goals are simplicity and performance. The two main approaches areto see if you can add the pass-through state onto an object that is alreadyshared between the top and bottom methods, or to make it a globalvariable. Other strategies include masking, where the exception is caught and handled at a lower level, so the caller doesn’t have to, and exception aggregation, reducing the number of exceptions that must be handled. The tactic of defining cases out of existence can also be used on special cases.
No comments:
Post a Comment