3 ms·
> incorrectly setting or forgetting to set keys in a map or a property or accidentally passing the wrong value to the property When you wrote/write Clojure, di
by filoeleven 6y ago
> incorrectly setting or forgetting to set keys in a map or a property or accidentally passing the wrong value to the property
When you wrote/write Clojure, did you ever use spec? Any insights into how it compares with TS? They seem to give similar guarantees for this aspect, but I haven’t played with spec yet.
- draklor40 6y agoIt is kinda hard to compare both, as the paradigms are quite different (FP vs OO), spec , IMHO, seemed oriented towards validating properties and values in maps, as Hickey mentions in his talk, it is all about manipulating data. Spec is opt-in. unless you are working with code that has already been spec-ed , you will run into the same problem that TS + JS interop has. I found spec a little too intrusive (especially the namespaced keywords) and sometimes I wasn't sure what it was meant for, TBH. In my first company, it was a bunch of cowboy programmer that didn't really care about typing the codebases, too cool to write unit tests and simply wrote enough end-to-end tests cases to solve the problem. I was just starting out and had NO idea on what was good programming practice. In the second firm , we had used schema to type the codebase partially and it worked. But the type checks weren't compile time , but rather during unit tests and when running with type-checking enabled (I think this is the same for spec as well) I think the advantage of TS comes from the static types (+ checking). You get immediate feedback before you can even compile it into javascript.