What is strong-typing versus weak-typing? Which is preferred? Why?

Q

What is strong-typing versus weak-typing? Which is preferred? Why?

✍: Guest

A

Strong type is checking the types of variables as soon as possible, usually at compile time. While weak typing is delaying checking the types of the system as late as possible, usually to run-time. Which is preferred depends on what you want. For scripts & quick stuff you’ll usually want weak typing, because you want to write as much less code as possible. In big programs, strong typing can reduce errors at compile time.

2014-02-17, 1815👍, 0💬