training —— Applying Functional(函数式编程) Principles in C# 6 (overview)

Applying Functional Principles in C# 6 | Pluralsight

 

c# 函数编程 特性

 

 

 

linq & lambdas & delegates

 

函数编程:is mathematical function (!= class method)

 

 

 one value transforms to another value

 

 

 

 

 

 

 

 

 

 

method signature honesty

 

 

 

 

 

 

 

 why 函数编程?

1. 降低 复杂度 =》开发速度;bug数量;需求响应速度

 

how?

1. signature honesty

2. referential transparency

 

优点:

1. method 隔离 =》method 组合

2. signature =》what will happen after call it =》容易 理解

3. 容易 UT =》check input & output =》黑盒测试,而非 白盒测试

 

 

 

 

 

 

 

总结:

 

posted @ 2022-05-21 22:42  PanPan003  阅读(19)  评论(0编辑  收藏  举报