4

So, guys, I'm wondering if someone can help me wkth this thing. I'm sorta newish to programming and was searching up different kinds of typing. Basically what I found was:

Strong: Variables are explicitly declared, can only be changed to values of that type

Weak: Variables are implicitly typed, can accept any value of any type.

However, upon searching static and dynamic, it says the same things for dynamic and weak, and for static and strong. Can anyone help me by telling me the dofference between these (if you even understood this post 😅)

Thanks

Comments
  • 0
    Static and dynamic are more popular terms, but they mean the same thing. So, you already understand, my friend!
  • 0
    @iam13islucky oh wow! Ok, thanks! 😀 The reason devrant is as awesome as it is is because of the awesome community, and you are a shining example
  • 3
    @SpencerBeige meh, I'm a terrible person. Glad I could help, though
  • 0
  • 0
    Strong and static typing is not really the same thing.

    static/dynamic refers to how variables are typed. , strong weak refers to how data is operated on.

    i.e, in a static weakly typed language (Like C++) this is legal:
    float x = 5.0f;
    int *a = (int*)&x;
    int b = *a * 2; //b is not 10 here
    (The types of the variables are static but the language doesn't restrict how we use the data)

    Languages like python are generally considered strongly typed despite being dynamic as all type conversions require the explicit creation of a new object (The builtin float type for example handles integer multiplication explicitly in its __mul__ and __rmul__ methods.
Add Comment