Comments (1)
抱歉,迟到的回复:
首先作者在第二章, “函数输出” 这一小节,结束时 曾抛出一个思考:
提示: 在这里我十分建议你花一点时间来思考:是否需要避免函数有可重构的多个输出?或许将这个函数分为两个或更多个更小的单用途函数。有时会需要这么做,有时可能不需要,但你应该至少考虑一下。
这里,关于函数输入我向你抛一个思考:
是否需要避免函数有多个输入参数?或许将这个函数分为两个或更多个更小的单参数函数。有时会需要这么做,有时可能不需要,但你应该至少考虑一下。
先认真考虑五分钟,然后表达我的看法:
思考中〜〜〜
思考中〜〜〜
思考中〜〜〜
思考中〜〜〜
思考中〜〜〜
思考中〜〜〜
说说我的看法:
看法1。 理想情况下应该永远进行严格柯里化
看法2。 不排除有业务逻辑是需要一组相关输入的,这时候松散柯里化是有恰当的,合理的,而严格柯里化则会显得冗余。但我们还是可以变相转化为严格柯里化(把多参,使用数组或者对象的形式变成单参)
看法3。 如果你要重构一个已有的多参数方法,而这个方法已经被广泛使用了。为了向下兼容,松散柯里化是你唯一的出路。(你要严格柯里化,成千上万的调用方会追杀你)
from functional-light-js.
Related Issues (20)
- Functional-Light-JS/ch2.md HOT 3
- Functional-Light-JS/ch3.md HOT 3
- Functional-Light-JS/ch4.md HOT 3
- Functional-Light-JS/ch5.md HOT 2
- Functional-Light-JS/ch6.md HOT 2
- Functional-Light-JS/ch7.md HOT 2
- Functional-Light-JS/ch8.md HOT 2
- Functional-Light-JS/ch9.md HOT 2
- Functional-Light-JS/ch10.md HOT 5
- Functional-Light-JS/ch11.md HOT 2
- Functional-Light-JS/foreword.md HOT 2
- Functional-Light-JS/preface.md HOT 2
- Functional-Light-JS/toc.md HOT 2
- Functional-Light-JS/apA.md HOT 2
- 这翻译的真心不走心, 有条件的建议读原文 HOT 1
- [Translation Error]Chapter 1 HOT 1
- Functional-Light-JS/apB.md HOT 2
- Functional-Light-JS/apC.md HOT 2
- Functional-Light-JS/ch1.md HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functional-light-js.