|
Hi HN, I had to put some prototype together in python and I just find it hard to work with it now. Python is something I used to regularly write and then ship code asap, now all the various scenarios where it can fail just runs in my head and I end up implementing multiple strict checks in places and even then I'm just bothered about future changes breaking these things. I'm skeptical and I have to go and write a lot of tests so that thins don't break and some of them are just silly tests like checking value is in the correct domain. I don't mean to particularly bash on python. Since its not Python's fault.
Same goes for JS, I can no longer write plain JS now. I just reach for TS. This is partly due to the fact that I was working on typed code(TS[0] and Java[1]) for last few months. And some of the code in there required correctness guarantees, and it was just easier to reach out for typed language since I get many of the checks for free. However after going there, I find it hard to come back to writing dynamic languages now.
Once I've realized that typed languages allow me to restrict my domain and the guarantee that this function can just bother about this restricted domain. I worry free write my code and the tests. I get some sense of confidence in what I'm building.
This obsession with staticly typed language has been making me unproductive.
And I can't find myself going back to it, even for something like scheme which I love so much I just can't find myself going back to it. # Footnotes
[^0]: Strongly typed TS, no any, and for dynamic values, used to use unknown parse into a known type and then continue with that.
Ye there are some downsides here too, for e.g: I was not able to maintain few guarantees here like : if I take X = XS[0], there is no way for typescript to guarantee that X is a value is that is guaranteed to be contained in XS. [^1]: Yea, Java type system is not the best, I have to use hacks like inheritance to make somethings work, anyway its better than no type system, especially I hate that java allows null which is a major source of annoyance for me and i keep wrapping values in that Optional monad. ========== TLDR: How do you manage to code in dynamic languages after being exposed to static typing. |
Another important factor here is the implementer's ability to troubleshoot. If you don't know how to detect and find a mistyped variable you need to accept that you don't know the language and ask someone who better knows how to run and troubleshoot applications to help you find it. Dynamically typed language interpreters/compilers provide feedback that is sometimes opaque but generally offer clues if you know where to look. It's not the same experience as having a compiler in your IDE that can show you the potential error as you enter it, but dogs are not cats either.