Sunday, March 31, 2024

Book Review: A Philosophy of Software Design

a philosophy of software design

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.

Why I recommend this book

This book discusses how to decompose complex software systems into modules that can be implemented relatively independently. The discussion first begins with a fundamental problem in software design, managing complexity. It then discusses philosophical issues about how to approach the software design process, and it presents a collection of design principles to apply during software design. The benefit of using the interface rather than the implementation directly is not very big, so it doesn’t help in reducing the complexity of the system. It is interesting that this is the complete opposite of the advice in for example Clean Code. There the mantra is to use many small classes and methods, rather than a few bigger ones.

Chapter 12 — Why Write Comments? The Four Excuses

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.

Chapter 15 — Write The Comments First

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.

This increases the interface complexity of a module,without increasing the total functionality of the system. It can indicate thatthere is confusion over the division of responsibility between modules orclasses. While all of the above is sensible, personally still prefer single-purpose interfaces, even if that might leave some implementation separately, that could technically be combined. In the case of microservices, an important guiding principle is to avoid separating services while they use/modify the same data source.

a philosophy of software design

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.

Classes should be deep, and interfaces simple

Q&A: Technology Expert and UVA Grad Gary McGraw Talks Cybersecurity - UVA Today

Q&A: Technology Expert and UVA Grad Gary McGraw Talks Cybersecurity.

Posted: Tue, 21 Mar 2017 07:00:00 GMT [source]

This isbecause handler functions aren't invoked directly - it depends on which handlerswere registered at runtime. The first example that jumps to mind personally is Django - the class hierarchyalways seemed to add more complexity than it solved in a lot of cases. Ingeneral I think it's very easy for the complexity of inheritance to outweigh theutility. Decorators are often shallow pass-through methods that add a lot of boilerplatewithout adding much new functionality.

Chris Richardson on Design-Time Coupling in Microservices - InfoQ.com

Chris Richardson on Design-Time Coupling in Microservices.

Posted: Mon, 21 Jun 2021 07:00:00 GMT [source]

A Literature-Informed Model for Code Style Principles to Support Teachers of Text-Based Programming

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.

The author makes a solid case against classitis – the compulsion (particularly in the Java community) to split everything into a new class.

This is a list of approaches, styles, methodologies, and philosophies in software development and engineering. It also contains programming paradigms, software development methodologies, software development processes, and single practices, principles, and laws. A pass-through method is one that does little except invoke another method witha similar signature.

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.

(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.

No comments:

Post a Comment

27 Best Curly Hair Products From Shampoos And Masks To Hair Towels

Table Of Content Amika Defining Cream Best clean and shine shampoo for curly hair rahua Aloe Vera Hair Gel Best Vegan: amika Plus Size Perfe...