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



  

相关话题

  Big-endian和Little-endian各有什么利弊? 
  为什么很多人不建议使用驼峰命名法,有什么弊端么? 
  作为程序员,我们应该更关注代码质量还是只需要以完成功能就好了? 
  程序员有流派吗? 
  你遇到过哪些代码优雅的C#项目? 
  普通程序员如何正确学习人工智能方向的知识? 
  为什么多数编程语言的赋值在左边?是有什么历史渊源吗? 
  计算机专业大学生想要在以后有一份好工作,在大学期间应该及时考哪些证书? 
  把BAT的机房炸掉,公司是不是就垮了? 
  传统的try-catch异常处理是否是编程语言发展中的弯路? 

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





© 2025-02-20 - tinynew.org. All Rights Reserved.
© 2025-02-20 - tinynew.org. 保留所有权利