Table Of Content
In some examples, the author recommends that some domain concepts are explained in the comments, in case the reader isn’t familiar with them. However, for well-known domain concepts, the reader will almost certainly already be familiar with those concepts. Even if they are not, the comments aren’t the right place to explain them. If the lower index is below zero, or the higher index is beyond the string length, an IndexOutOfBoundsException is thrown. This forces the caller to handle these cases before calling substring.
John Ousterhout Discusses a Philosophy of Software Design - Adafruit Blog
John Ousterhout Discusses a Philosophy of Software Design.
Posted: Wed, 03 Oct 2018 07:00:00 GMT [source]
Agile does not encourage strategic programming

To add to this, we haven't completely identified all of the issues we will confront. In essence, we still have to discover the Unknown Unknowns as we cautiously proceed. There are also a few weaker chapters towards the end of the book, for example Code Should Be Obvious and Software Trends. Code Complete has a lot more to say about names, and does it better. However, I really liked the story of how a too generic variable name (block) caused a bug that took six months to find. In a lot of places, the author uses comments and documentation interchangeably.
Define Errors Out of Existence
We need more resources to remind us not overcomplicate software architecture. It will become complicated enough, module after module, layer after layer. The author argues that if your code throws an exception, you force all callers of that code to know how to handle this exception. Yet, in many cases, callers don’t know what to do about the exception which is thrown. He says we should define our functionality so we never need to throw an exception.
Chapter 19 — Software Trends
While event-driven programming is certainly more complex, due to no clear flow of control, in real-world scenarios, this is a necessity. Both in the case of distributed systems, as well as multi-threaded environments, there is no other option. John's suggestion to add a comment for event handlers doesn't cut it in my book. Instead, monitoring errors, alerting (for backend code) and logging, uploading, and analyzing logs (for client-side applications) is one way to stay on top of the system working correctly at all times. Much of modern programming, from messaging services to frameworks like Fx is moving towards an asynchronous model, where dealing with this complexity is part of the job. A strong stance against exceptions (Chapter 10) was an interesting read.
The book doesn’t focus on a specific programming language or framework but rather presents general software design ideas. "Exception handling is one of the worst sources of complexity in softwaresystems". They can leak abstraction details upwards, making for a more shallowabstraction. Programmers are often taught that they need to handle exceptionalcases, leading for an over-defensive programming style. One pitfall is that complexity in software development is incremental.
"If you reduce the number of methods in an API without reducing its overallcapabilities, then you are probably creating more general-purpose methods." An abstraction is asimplified view of an entity which omits unimportant details, making it easierfor us to think about and manipulate complex things. It is more important for a module to have a simple interface than a simple implementation. That being said, we have to be wary of Classitis a term I have come to appreciate and can relate too, as I have worked on many software systems in the past that actually have this issue.
Deep modules
It's more important for a module to have a simple interface than a simpleimplementation. If you have complexity that is closely related to your module'sfunctionality, you should consider pulling that complexity into the module'simplementation. Ousterhout's most often-used approach to this problem is to introduce a contextobject, which stores the application's global state - anything that wouldotherwise be a pass-through or global variable. They are not an ideal solutionbecause they have a lot of the disadvantages of global variables, but they canreduce the complexity of a method's signature.
Other materials, books, articles, etc.
Ousterhoutdiscusses the different types and causes of complexity, and then varioussoftware design considerations and their relationship to complexity - patterns,antipatterns, questions to ask, etc. While the book does a good job covering architecture concepts when writing code, there are several areas that it does not touch on. Most of these are outside the scope of the software design course itself. The importance of good and simple naming (Chapter 14) mirror my experience on how simple names often mean simple functionality. Complex names - or difficulty to name something - is usually a code or architecture smell.
OnePlus Nord 3 5G Interview: Kinder Liu On The Philosophy Of Nord - Forbes
OnePlus Nord 3 5G Interview: Kinder Liu On The Philosophy Of Nord.
Posted: Tue, 04 Jul 2023 07:00:00 GMT [source]
🔴 Software Design Red Flags
Tradeoffs when combining or separating implementations within modules or interfaces (Chapter 9) is an interesting debate that I don't know of a single best answer. We share this view with John, who also agrees the best solution will be context-dependent. John collects a few rules of thumbs he suggests to use when deciding to combine or separate. Combine when it makes for a simpler interface, to reduce duplication or when implementations share data/information. Software design is a critical aspect of developing reliable and high-performing software applications.
It involves the process of conceptualizing, planning, and defining the structure, architecture, and functionality of a software system. To create software that is not only functional but also maintainable and scalable, developers embrace a philosophy of software design. This philosophy encompasses principles, strategies, and best practices that guide developers in crafting well-designed, robust, and efficient software solutions.

If you're interested in whether to read this book, my recommendation is that you probably should, for a few reasons I list in my conclusion. When you’re performing a code review on a class, smell around for special purpose code mixed with general purpose code. This mixture represents an opportunity to split off the general purpose code into something more reusable. But yours is a great review and a valuable service to the IT community that increasingly finds itself facing Technical Debt to the point of bankruptcy. Like reusing a common class, consistent naming lessens cognitive load by enabling readers to quickly draw assumptions when they see the name in a different context because they have already seen it in one.
You can apply the ideas in this book to minimize the complexity of large software systems so that you can write software more quickly and cheaply. For people who have less experience in software development, the remaining of the book will also be practical. The parts on writing comments before coding, and comments complimenting the code are decent strategies to start with. Those with more experience under their belt my disagree with some of the recommendations.
No comments:
Post a Comment