百科问答小站 logo
百科问答小站 font logo



什么是 Type Driven Development ? 第1页

  

user avatar   be5invis 网友的相关建议: 
      

EB 那本书里的吧,一言以概,Test-driven development 用测试约束程序行为,Type-driven 用(复杂的)类型系统约束程序行为,让编译器强迫你按照某种「正确」方式实现出来。

为什么其他语言不这么干呢?因为它们的类型机制没有强到可以描述逻辑。

Type-driven development is a style of programming in which we write types first and use those types to guide the definition of functions. The overall process is to write the necessary data types, and then, for each function, do the following:
- Write the input and output types.
- Define the function, using the structure of the input types to guide the implementation.
- Refine and edit the type and function definition as necessary.



  

相关话题

  在函数的入口处对参数的合法性进行检查是一个值得提倡的好习惯吗? 
  23岁曾放弃编码,现想重新编码,我该如何做? 
  你在 GitHub 上看到过的最有意思的项目是什么? 
  为什么叫.NET?它和C#是什么关系? 
  CSS的样式表 内联外部和内部优先级? 
  float类型的设计是否存在问题? 
  有教抽象能力的书么? 
  过度依赖框架有什么不好? 
  程序员如何应对诸如「给我弄个网站吧」的请求? 
  为什么在计算机科学领域及编程中不使用现代数学建立的符号体系进行操作? 

前一个讨论
为什么 C 语言 sqrt 函数参数不支持 int?
下一个讨论
带着100台iPhone X突如其来穿越回1997年,怎样靠这个(严格限制)发家致富(不要抖机灵)?





© 2025-04-17 - tinynew.org. All Rights Reserved.
© 2025-04-17 - tinynew.org. 保留所有权利