4 ms·
Yes. 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. //
by tylerjwilk00 7y ago
Yes. 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.