31

Am I the only one who, when working with dynamically typed languages, never uses dynamic features? Like, I never change a variable type, and make sure functions will only return one data type?
I just think dynamic types leads to so many bugs

Comments
  • 0
    Very true.
    There are sone very interesting things you can do with a dynamic lang, like decorators, and bound methods. or even base type method binding. Not everything is object types...
  • 2
    I have never, ever, needed to change a variable type.
  • 0
    @magicMirror you can definitely use decorators in statically typed languages. Not sure what method binding is though.
  • 0
    @beegC0de
    Imagine adding methods to classes, or to instances dynamically. even overriding base methods, at runtime... https://ianlewis.org/en/...
    kotlin has that feature for Java, btw.
  • 0
    @magicMirror ohh I see. What's the benefit of using this over decorators?
  • 0
    @beegC0de benefit? I have no idea. the idea here is to add a function to an object as a callback.
    I used it when I offloaded some work to a python thread, and wanted to use a callback.
Add Comment