3 ms·
>"The biggest merit he says is in software maintenence, and i really disagree with just a lot of this. it's not been my experience; the biggest errors are not c
by flavio81 9y ago
>"The biggest merit he says is in software maintenence, and i really disagree with just a lot of this. it's not been my experience; the biggest errors are not caught by these type systems; you need extensive testing to do real-world effectiveness checking."
I think I fully agree with Rick Hickey on this, and I have mentioned the same before here in HN. The biggest and most serious errors are not caught by the (statically checked) type systems.
I agree that simple type errors that, on a dynamic system without compile-time checks are not caught, will be then caught at runtime and you will say "oh, i need to get back and correct this, damn it". But this is a minor annoyance, that takes small time compared to the bugs i'm mentioning in the previous paragraph; bugs that can take days to be resolved.
- lliamander 9y agoI would say the main point of types is to prevent uninteresting bugs. For me that's a selling point because I don't want to be distracted by those kinds of bugs.
- runT1ME 9y agoWhat kind of errrors do you think are not caught with static typing? Usually people who say this aren't familiar with languages that have type classes...
- flavio81 9y ago>What kind of errrors do you think are not caught with static typing? Citing awj's post above: "Some of the biggest errors are subtle failures in the implementation of business logic." Other examples: - bumping into unkonwn bugs of a library you are calling - implementation of an external (library) function behaving differently than the documentation - various memory leak problems - locking issues - race conditions etc
- runT1ME 9y ago>"Some of the biggest errors are subtle failures in the implementation of business logic Static typing can prevent errors in business logic. >various memory leak problems - locking issues - race conditions All are bugs that static typing has had tremendous success in preventing. Have you any experience in a HM like type system?
- flavio81 9y ago>All are bugs that static typing has had tremendous success in preventing. Please do elaborate, it could be a great post. But If you mean to say that locking issues can be prevented because you can apply STM (software transactional memory) by using suitable Monads, then, well, i can also have STM in a dynamic language, even applying it by wrapping code in an "atomic" context (i.e. see the STMX library for Common Lisp) so the statements contained within are performed atomically (and thus guaranteed to work or either roll-back.) As for memory leaks, Haskell (if that's the HM language you had in mind) automatically manages memory, so I would guess this isn't a problem at all. However, automatic management memory management is orthogonal to "static vs dynamically typed". Thus, i'm curious, and yes, i don't have enough experience with HM-type languages, which should be the way to go if one wants to use static typing...
- tome 9y ago> i can also have STM in a dynamic language How can you roll back failed transactions without explicitly typed effects?
- platz 9y agoClojure tracks and rollbacks the STM-bound variables according the STM rules; it is not intended to prevent you from doing other effects inside those transactions; you are supposed to have an understanding not to do that in the transaction blocks. It helps a bit that most clojure datastructures are immutable/persistant by default.
- tome 9y ago