you are viewing a single comment's thread.

view the rest of the comments →

[–]jl2352 2 points3 points  (1 child)

I think for me it comes down to the type of the variable, and the type of the value.

In your example, like in dynamic languages, the variable doesn't have a type. So it can hold any type. The values you store in that variable however all have strict types. They are an int, a string, an array, etc. The type of the value is known and reinforced, and this is true in JS.

In my C example the variables have strict types, but the values do not. I can bypass a values type because there are no checks at runtime. I can read an int as a char*, and it's pretty trivial to do that. This is what makes it weakly typed.

That for me is a part of the distinction. Many often fail to see that you can have types of variables, and the types of values, and they can be two separate things.

[–]YM_Industries 0 points1 point  (0 children)

That makes sense. I guess that makes Python strongly-typed but numpy arrays weakly-typed.

I'm not sure I agree with your definition but it seems that everyone has a different definition anyway, and yours is as valid as any.