Vlad's Roam Garden

Powered by 🌱Roam Garden

level of abstraction

This is an "Orphan" page. Its core content has not been shared: what you see below is a loose collection of pages and page snippets that mention this page, as well as snippets of this page that were quoted elsewhere.

Referenced in

Clean Code: A Handbook of Agile Software Craftsmanship

DSLs, when used effectively, raise the abstraction level above code idioms and design patterns. They allow the developer to reveal the intent of the code at the appropriate level of abstraction.

when you develop software you invent a language

Each class and each function add a concept to your language. Every time you create one - either from primitive statements or from other concepts you've already defined - you make your language more expressive. You rise it's level of abstraction.

Clean Code: A Handbook of Agile Software Craftsmanship

The percentFull function is at the wrong level of abstraction. Although there are many implementations of Stack where the concept of fullness is reasonable, there are other implementations that simply could not know how full they are. So the function would be better placed in a derivative interface such as BoundedStack.

Respecting level of abstraction

[[good code/names should be consistent with the level of abstraction they are used in]]