3 ms·
Annotations/ hints you can use optionally to convey extra metadata are a very different thing compared to types you have to use else nothing will really work.
by kaliszad 5y ago
Annotations/ hints you can use optionally to convey extra metadata are a very different thing compared to types you have to use else nothing will really work.
There were some optional type systems for Clojure but I cannot say how successful they are or were. I think the critical parts, e.g. APIs or code boundaries are specced out and that seems to be the recommended solution.
Btw. just that people are adding something doesn't mean that it is good or helping in general. It is great, Python has the optional type annotations precisely because they are optional - you can use them when you think you are better off doing the extra work.
- Zababa 5y ago> Annotations/ hints you can use optionally to convey extra metadata are a very different thing compared to types you have to use else nothing will really work. I don't really agree. In Python for example, it's about making the implicit explicit. It's to make sure you don't use a function that only works on floats with ints. If you don't, you'll have a runtime exception, and it can be good idea to catch these errors at type checking time. You're already using types in dynamic languages, but they are implicit. Static typing makes the implicit explicit, and helps avoiding errors. If your type system is limited, it can make some things annoying that are easier in a dynamic language, I don't deny it. > There were some optional type systems for Clojure but I cannot say how successful they are or were. I think the critical parts, e.g. APIs or code boundaries are specced out and that seems to be the recommended solution. As I said before, I can understand that it's less necessary in Clojure than in Python or Ruby, because of things like immutability. > Btw. just that people are adding something doesn't mean that it is good or helping in general. It means precisely that though, if they're adding it it's because it brings value. Sure, your 50 line script probably doesn't need them, but your 10k app could benefit from them.