Use Integer type against Boolean

It is much safer to use Integer type instead of Boolean. As a code compilation point of view, there is no specific gain in using boolean. Also, you get stuck with max 3 values in boolean (true, false, null). But if you use Integer you can increase the steps and there is no restriction on it.

In my personal experience, I have come up with many scenarios where I had to change from Boolean to Integer as a value of the column increased to more than in 3 at a very later stage of a project. And changing then is frustrating and brings coding hell with it.

Hence I strongly suggest using Integer type against Boolean. Let me know your views about the same.

Tagged : /

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: