Every industry is full of technical hills that people plant their flag on. What is yours?

  • Nibodhika@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    5 hours ago

    No it’s not, they’re completely different concepts. In C/C++ lingo Dynamic typing is having every variable be a void * whereas type coercion is implementing conversion functions for your types to allow casting between types, e.g. having a temperature class that can be casted to a double (or from it).

    This is a function with dynamic typing and no type coercion in C/C++:

    int foo(void* param) {
      Temperature* t = (Temperature*) param;
       return t->intValue() + 10;
    }
    

    This is the same function with type coercion and no dynamic typing in C/C++:

    int foo(Temperature& t) {
      return t + 10;
    }
    
    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 hours ago

      I’m making a Star Wars joke based on a typo. I know what type coercion is. The joke is that dynamic typing is corroded and disgusting to me. The Star Wars reference being Anakin saying from his perspective the Jedi were evil.