What Is Strict Type Checking?

Computer programming languages support a variety of data types that can be assigned to a variable. These data types may be a string of characters, a floating point number or a reference to the computer's display adapter. Improper usage of these data types can cause many problems, and strict type checking helps to avoid these issues.

  1. Function

    • Some data types are similar enough to each other that copying the value of a variable of one type to a variable of a different type will not present any apparent problems. With strict type checking enabled, the compiler or interpreter will not allow you to copy different data types between variables without first casting, or explicitly converting, the data to match the receiving variable's type.

    Benefits

    • Strict type checking can prevent many program or logic errors that are hard to find with simple debugging. By ensuring that the data types are being used properly, the compiler enforces good programming habits that pay off in the long run with more stable applications.

    Considerations

    • While many modern languages have adopted a more loose approach to type checking, strict type checking is still the best possible programming practice where available. If the development package you are working with does not use this feature by default, consider turning it on to help ensure your programs are as stable and easy to debug as possible.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured