Bruce EckelSTRONG TYPING VS. STRONG TESTING1

I remember when I was working on VBA at Microsoft we had lengthy debates about static vs. dynamic type checking.

"Static type checking" is when the compiler, at compile time, checks that all your variables are the right type. For example, if you have a function called log() that expects a number, and you call it thus: log("foo"), passing in a string, well, with static type checking, the compiler will say, "Wait a minute! You can't pass a string to that function because it expects a number," and your program won't compile.

This is the opposite of dynamic type checking in which the check is done at runtime. With dynamic type checking, log("foo") would compile fine, but at runtime it would raise an ...

Get THE BEST SOFTWARE WRITING I now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.