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



  

相关话题

  如何用一句话说明什么是面向对象思想? 
  在校生为了面试,有必要强行记住一些复杂算法如红黑树、KMP等的实现吗? 
  请问大家一开始是怎么学编程的? 
  C++ 中,如果指针换了被指向的东西,那被指向的原来的东西(是被 new 出来的)所占的内存会立刻被释放吗? 
  为什么大学C语言课不用linux的gcc编译器上,而是用vs呢? 
  变量名用中文的优缺点? 
  为什么大部分码农做不了软件架构师? 
  不懂就问:Linux、安卓和鸿蒙到底是什么关系? 
  微信红包的随机算法是怎样实现的? 
  如何看待12月07日美团外卖软件崩溃一事? 

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





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