3 ms·
It's nice to start out typeless during problem domain discovery and proof of concept phase then quickly introduce types when you better understand the problem.
by tylerjwilk00 7y ago
It's nice to start out typeless during problem domain discovery and proof of concept phase then quickly introduce types when you better understand the problem. This change will help that phase transition with enforcement right in the runtime as opposed to simple doc block annotations.
- ssijak 7y agoTypes are much better utilised in/while modeling domain.
- tylerjwilk00 7y agoCare to explain why types are better during domain modeling? Do you think it affects velocity? No benefits to loose types during discovery?
- k__ 7y agoIdiomatic dynamicly typed code looks rather different from idiomatic statically typed code. Dynamic is like only using untagged unions and primitives.
- tylerjwilk00 7y agoSo little meaning in that comment. Paraphrasing: 1. Dynamic and Static lang code look different 2. Dynamic lang code can use variables of undeclared type Neither statement adequately answers the parent comment.
- peterkelly 7y ago"Bad programmers worry about the code. Good programmers worry about data structures and their relationships." ― Linus Torvalds Discussion: https://news.ycombinator.com/item?id=4560334 https://news.ycombinator.com/item?id=4560334
- Supermancho 7y agoThis is misused a bit, since the derivative collary is: After you optimize the data structures and have established relationships, worry about the code.
- tylerjwilk00 7y agoYes. We want to spend as little time as possible on code so we can quickly find the data structure that best solves the problem we have yet to understand. // I know nothing. Not sure what types would work best... public function method($data) // I know more public function method($data array) // More public function method($data array|false) // Even more public function method($data array|false) : int // Ah. Okay. I understand the problem domain and have proper data structures to solve it public function method($data array|false) : int|float Notice the type system never got in our way. We organically grew into the type system as our understanding of the data evolved.