7 ms·
I programmed Java for years before I started using Clojure so I will make that distinction here to answer your questions > During refactoring, do you feel more
by dmichulke 8y ago
I programmed Java for years before I started using Clojure so I will make that distinction here to answer your questions
> During refactoring, do you feel more flexible, or less?
Both. More flexible because in Java you have 5x more code (was worse before lambdas). Less because I sometimes look up the code and don't know (and can't immediately infer) the types anymore. Usually I have a handful of integration tests that show me immediately when there is a problem but I wish there was a way to show the inferred types in my IDE.
The problem is though usually only a big one for the one big state where you have lots of nested maps, vectors, arrays and so on and only if you modify the structure of this state. For smaller things, fixes are fast and easy, even though they still take 10 minutes while they could take 5. I feel it's kind of the price I pay to use Clojure but then again there's probably a reasonable solution to it - Clojure infers the types anyway, so why not show them somehow.
I use clojure.spec partly, often when I need to throw useful error messages (e.g., a user facing REST API). It's a little bit tedious but it's always a good decision in retrospect.
> Do you make use of the Lispy-ness?
Yes and no. on the positive side: I don't ever need to look up the syntax of anything (I still make mistakes in Java switch for example) and using case and multi-methods I can really interpret quickly a DSL in a web server (e.g., binary arithmetic operations on OHLC bar time series) and I wouldn't want to implement that (safely) in another language.
> Do you wish you had static types? If so, have you tried gradual typing like Typed Clojure?
I tried for a brief two days gradual typing and didn't get it. I wish I had static typing exactly when refactoring or debugging.
> I often have the feeling that I'm not smart enough to use Lisp.
Oh, I'd even say the opposite, i.e., I am smarter because I use Lisp.
I know Sapir-Whorf is "deprecated" but I feel I am thinking faster because I am thinking in much less convoluted structures compared to when I programmed in Java.