Software should be designed and built as a cooperating set of modules. Each module should have a well-defined API boundary, which can (and should) change as needed, but a boundary is always present.
Software design is a way to force oneself to think through the entire problem, and it is really worth thinking through before writing code.
Software architecture will degrade over time, there is no way around it.
Naming (variables, methods, functions, etc.) and coding style should be consistent, since good naming and formatting provides a lot of information. Failing to follow expected coding conventions should be considered a significant offense.
Make upgrade decisions carefully. Consider carefully minor updates to major releases.
In designing a library, respect namespace. Do not make engineers put in an effort to memorize reserved words, constants, etc. just to get your library working without naming collisions.
Make functionality shared if they appear more than once. Write a test suite for general purpose routines. If the code is difficult to write, write and maintain it separately so that other code cannot corrupt it.
Use encapsulation and layering, even if it seems unnecessary. Life will be easier down the road.
Think stability over increased concurrency.
If one is thinking of writing special purpose code to handle something, step back and see if things can be simpler.
If one doesn't have the time to make a change right now, then one won't find the chance later.
"...Every piece of code should do a small number of things and there should be a high-level design encouraging programmers to build functionality out of smaller chunks of functionality, and so on..." (from Berkeley DB article)
Every bug is important.
"...Our goal as architects and programmers is to use the tools at our disposal: design, problem decomposition, review, testing, naming and style conventions, and other good habits, to constrain programming problems to problems we can solve...." (from Berkeley DB article)
Wednesday, April 4, 2012
14 Design Lessons Learned from Berkeley DB
The original article can be found here, but I wanted to put together a summary list of the design lessons in the article for later reference for myself.
Labels:
software engineering
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment