百科问答小站 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.



  

相关话题

  git是Linus一个人开发出来的吗? 
  计算机领域有哪些经典的典故或笑话? 
  怎样评价《数码宝贝》第一部中的泉光子郎的编程水平? 
  靠写代码能买得起一辆奥迪A8吗(中国)? 
  使用命令行形式的程序的时候,能不能把需要输入的命令们提前编制好,再自动执行呢? 
  如何反驳「程序员离开电脑就是废物」这个观点? 
  如何用代码画出一只齿轮? 
  国内的老程序员最后都去哪儿了? 
  编程最基本的术语「bug」该怎么翻译? 
  如何成为 @RednaxelaFX 一样的大牛? 

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





© 2024-09-19 - tinynew.org. All Rights Reserved.
© 2024-09-19 - tinynew.org. 保留所有权利