A static type system also requires continuous attention. The question is, does it free attention faster than it consumes it?
A static type system also requires continuous attention. The question is, does it free attention faster than it consumes it?
I'm not sure what you mean by this, or how it constitutes an increase over the demands of a runtime or weak type system.
> how it constitutes an increase over the demands of a runtime or weak type system
It's the difference between "I understand X", and "I have to figure out how to describe X in my language". And the difference between "my understanding changed", and "I have to figure out all of the places in my program where I need to update the code because of my new understanding".
I would not call that "continuous attention", because most of the time you're simply writing down a decision you've already made, and would have had to make even in a dynamic language.
In contrast, I think "continuous attention" is having to remember the current kinds of data being held in different variables in a long data-flow.
> And if your needs for that variable or class or function change, you need to explain to the compiler the differences.
Yes, but that's because the compiler is remembering your "checklist" for you. In a dynamic language you'd need to make all the same decisions, but you'd have to waste more brainpower (or introduce more bugs) by trying to manage it all yourself.
I'll be honest, I've never wasted much brainpower trying to remember the difference between covariant and contravariant, or whether I want Try[Future[String]] or Future[Try[String]], or anything like that, when working in a dynamic language. You just don't do shit like that.
Part of my job is maintaining a PHP/JS codebase that's 10+ years old, and I wish I had days where it was all about covariance, rather than the stupid stuff.