Rule of Modularity: Write simple parts connected by clean interface
Rule of Clarity: Clarity is better than cleverness
Rule of Composition: Design programs to be connected with other programs.
Rule of the Separation: Separate policy from mechanism; separate interfaces from engines.
Rule of Simpl ...
- 21:40
- 浏览 (414)
- 评论 (0)
Case study
Case 1:
struct A { ...}
void Caller()
{
struct A b=getA(); (1)
...
}
struct A getA()
{
struct A a;
a.xxx=xxx
....
return a;
}
The (1)
getA() really return the address of a, the address in the stack which is destroyed, but now no one is using this st ...
- 21:38
- 浏览 (401)
- 评论 (0)







评论排行榜