Data type checks

Here we are with another basic and powerful check, a check on the data type. This kind of check is performed to get assurance that all relevant data type constraints are met. What is a data type constraint? Imagine you are working on an algorithm that sums data related with some of the other attributes of your table. Do you think that having that attribute in a character type could result in a problem for your algorithm? It would indeed, it would actually cause your code to raise an error and all the processes would come to an unpleasant end. You may be thinking that since this problem would be caught by the code itself, it should not be considered that insidious. This is true, but you should always consider placing some kind of check on these constraints within your code and a proper way to handle it (for instance casting data from character to numerical if a character type is found), to avoid causing your code to stop. This will hold especially true in a production environment, where a code stop could imply serious consequences.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset