"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
― Linus Torvalds
Discussion: https://news.ycombinator.com/item?id=4560334
// 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.After you optimize the data structures and have established relationships, worry about the code.