Hacker News new | past | comments | ask | show | jobs | submit login

If Wikipedia is to be believed: "Dynamic typing typically allows duck typing, which enables easier code reuse."

I would expect to see more code reuse in Python than in any statically typed language.




It's a true statement if you qualify it properly.

It wins you more code reusability with less code written to accomplish aforementioned reusability.

I always run into silly inheritance chains, type coercion or adapter fns/methods to handle reusing code for unlike-types, rather than relying on a common base of functionality regardless of where it was derived from (function API, inheritance, mixin, etc).

Best way I've seen this done is in Clojure. Good mix of the best of both worlds in terms of static and dynamic typing, multimethods, protocols, essentially structurally typed arguments, etc.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: