I think about types (almost?) every time I write a function.
What type of data does the function expect, and what type of data am I supposed to transform this data to?
For instance, if I calculate the time that has elapsed between two points in time:
- what does my input look like (e.g. two objects that look like XY)
- in what form should I return the difference? Time in seconds (i.e. number), again an object that looks like XY ? ...
I can't imagine saying I would care about types rarely.
Another nice benefit of st langs is that you have to read manuals less often.
IDEs so a way better job showing you the type of every variable (and result of an operation) as well as the options you have at your hand for a given type (including their documentation and example code).
Yes I know dt languages and their tools try to catch up.
> or expect my compiler to do it for me). If the documentation is incorrect then I treat that as a bug, just as if it was a logic bug.
Well, I don't expect that with Dr languages as well, but I am glad that the compiler does this (or in DT languages at least the IDE due to type hints).
I mean, it saves a lot of time (money) later on ... even if you notice it right away the first time you use the code