On 2015/12/03 3:04 AM, Scott Hess wrote:
> I discourage this kind of usage because it means that in some distant
> future when someone has to make things work with a different database
> engine, they have to grind through and check every weirdo VARCHAR(73) and
> MEDIUMBIGINT declaration someone put in, because none of them have ever
> been tested with range enforcement enabled.  So where someone meant
> "VARCHAR(256)" but actually typed "VARCHAR(6)", will your code suddenly
> start throwing clean errors which immediately suggest where to look, or
> will it just muddle through corrupting your data?  There can certainly be
> subtle issues in any type, but my experience is that when you're trying to
> decode someone's code, it's easiest when the code says what is actually
> happening, not what it wishes were happening!

I posit that a column declared as:
col VARCHAR(32) NOT NULL
says a whole lot more about what is actually happening than:
col TEXT NOT NULL

And sure, I agree a mistyped word can be hard to decode by a future 
programmer, but that is a statistical probability in any case.


> Of course, if you are _currently_ writing cross-platform code, absolutely
> write the cross-platform code!  And I will agree that the above position
> has some issues when faced with things such as INT being 32 bits//.... etc.

I *ALWAYS* write cross-platform code as far as SQL is concerned. I even 
think in this day and age every programmer should, or is there a case 
for the opposite?

Reply via email to