Comments (2)
不是很认可添加这个语法糖。原来的代码看起来多些,但挺清晰的。
基础模块,我觉得我们可以遵循 Go 语言的最小心智负担原则,包括
- 最小特性
- 最小惊异
- 最小犯错机会
最小特性原则指的是:如果一个功能不对解决任何问题有显著价值,那么就不提供。
如果我们能达成一致认可上面的原则的话,那么 modify 就没必要提供。还有一个原因是,modify 是个很好很常见的方法名,很容易被实例上的方法覆盖掉。YUI 有提供 modifyAttr 方法,但功能不一样。Backbone 则没有提供,保持功能的精简。
from base.
好,要使用可以自己添加
—
Sent from Mailbox for iPhone
On Wed, Aug 7, 2013 at 9:49 AM, lifesinger [email protected]
wrote:
不是很认可添加这个语法糖。原来的代码看起来多些,但挺清晰的。
基础模块,我觉得我们可以遵循 Go 语言的最小心智负担原则,包括
- 最小特性
- 最小惊异
- 最小犯错机会
最小特性原则指的是:如果一个功能不对解决任何问题有显著价值,那么就不提供。如果我们能达成一致认可上面的原则的话,那么 modify 就没必要提供。还有一个原因是,modify 是个很好很常见的方法名,很容易被实例上的方法覆盖掉。YUI 有提供 modifyAttr 方法,但功能不一样。Backbone 则没有提供,保持功能的精简。
Reply to this email directly or view it on GitHub:
#29 (comment)
from base.
Related Issues (20)
- 关于set的扩展 HOT 6
- 简化 initAttrs 参数
- 谈谈 parseEventsFromAttrs HOT 29
- after回调中建议传入被切入方法的参数 HOT 2
- Attribute性能问题 HOT 6
- attribute做了非兼容修改照成validator中onItemValidate等事件失效 HOT 3
- attr copy bug in ie HOT 1
- 通过 json 的描述来实例化 HOT 1
- return false 不能阻止原函数执行 HOT 1
- attribute代码严重bug HOT 4
- attribute的继承问题 HOT 2
- 初始化性能优化思路及简单结果 HOT 3
- 遍历继承链构建默认attrs的时机讨论
- base 首页的例子抄自 class,容易引起误解 HOT 5
- 增加 karma 支持
- 在attribute的第一个sample,有initialize方法时 ,_onChangeColor不会被调动。 HOT 4
- initAttrs初始化问题,mergeInheritedAttrs HOT 2
- Attribute 同时设置setter和readOnly,初始化会报错,但是只写readOnly却是可以的 HOT 3
- aspect 不能添加命名空间 HOT 2
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 base.