Impact of Program Design
| English | Chinese | Pinyin |
|---|---|---|
| modular | 模块化 | mó kuài huà |
Design choices have consequences
- The way you design a program affects everyone who uses or maintains it.
- Clear names, small methods, and sensible classes make code a joy to work with.
- A tangled design makes even small changes risky and slow.
- Design decisions ripple far beyond the moment you make them.
Programs affect people
- Software shapes how people work, learn, communicate, and live.
- A design choice can help users — or exclude, confuse, or harm them.
- Bias in data or logic can produce unfair results at scale.
- Responsible programmers consider who is affected and how.
Maintainability and reuse
- Most code is read and changed far more than it's first written.
- A modular 模块化 design (independent, well-named pieces) is easier to fix and extend.
- Reusable classes save effort across many programs.
- Investing in good structure pays off every time the code is touched.
Testing and correctness
- Good design makes a program easier to test — small methods are easy to check.
- Isolating behavior means a bug is easier to locate and fix.
- Untested, tangled code hides bugs that surface later at a bad time.
- Design for testability, not just for "it runs today."
Good or poor design?
Design choices have real consequences. Sort each outcome.
Design isn't cosmetic — it decides how safely a program can change. A modular, well-named design lets you fix or extend one piece without breaking others; a tangled one makes every edit risky. And software affects real people: an untested or biased design can quietly harm users at scale. Weigh the human impact of your choices.
Two designs for a grading program:
- Tangled: one giant method mixing input, math, and printing — a bug anywhere risks everything.
- Modular: separate
readScores,average,printReport— each testable and reusable. - The modular version is safer to change and easier to trust.
Program design has real impact: modular, well-named code is easier to test, maintain, and reuse, while a tangled design makes every change risky. Software also affects people — an untested or biased design can cause harm at scale, so weigh who is affected by your choices.
A modular design (independent, well-named pieces) is mainly easier to...
Modularity makes changes safer and pieces reusable.
Most code is read and changed far more often than it is first written.
So maintainable design pays off repeatedly.
Bias in a program's data or logic can produce unfair results at scale.
Design choices affect real people — consider who is impacted.
Which design is easier to test?
Small, isolated methods are each easy to check.
Program design is purely cosmetic and doesn't affect how safely code can change.
Design decides how safely a program can be modified.