4 ms·
There is an experimental phase where you really don’t know. Hygiene indicates you should codify the types after you’ve sorted out the real constraints.
by jfoutz 8y ago
There is an experimental phase where you really don’t know. Hygiene indicates you should codify the types after you’ve sorted out the real constraints.
- Waterluvian 8y agoGot me thinking. Are there tools out there that solidify "auto"s into their types? Type inference is fast but what if I want to eventually lock it down and prevent accidental changes in type by adding a decimal or whatnot.
- skybrian 8y agoAn IDE could do it, but the risk for local variables seems smaller compared to the confusion when someone accidentally changes the input or output of a function.
- SatvikBeri 8y agoThe Jetbrains IDEs let you do this pretty easily, at least for Python and Scala (and presumably for Java & Typescript.)
- Smaug123 8y agoIn my mind, this is a bit of an "experimentation smell". It means you're experimenting backwards because you are uncertain of the domain in which you are operating. It's something I've learned to notice as a symptom that I'm flailing around in confusion, and that I need to step back and understand the problem better. Clarify the domain so that you know the types of everything up front, and your work is more than halved.
- adrianN 8y agoI find that writing some code is often the best way to clarify the domain and figure out the types.
- gameswithgo 8y ago>Clarify the domain Could typing out code be a good way to clarify the domain for some people, and/or some of the time?
- wtetzner 8y agoExcept that in my experience you never really understand the problem or domain until you try to build the software. "Write one to throw away" and all that.