F
Flash Gordon
Malcolm McLean wrote, On 07/10/07 16:28:
I do. It's a major part of my job.
You are wrong.
Yes, you need to pad with a defined character (space is sometimes used
rather than a null). However the reason is NOT to allow tricks like you
describe above. The reason is so that it can be part of a key (not the
entire key) in such a way as to allow easy sorting and searching without
the datebase itself having to have any understanding of how the key is
constructed.
The incorrect reason you suggested for fixed width fields is dead,
however fixed width fields are very much alive and kicking. Oh, I come
across them a lot in the applications we interface with, not just in our
own applications.
By the way, when I checked last BerkeleyDB had some big customers.
Well, its use has certainly declined since file-systems generally don't
work the same way.
I've never worked on a database-intensive program.
I do. It's a major part of my job.
However I suspect it has become obsolete.
You are wrong.
There are advantages in having
short fixed fields; for instance often a compare can be done by casting
to wide integer and performing a single instruction. This only works if
padding is specified as zero.
Yes, you need to pad with a defined character (space is sometimes used
rather than a null). However the reason is NOT to allow tricks like you
describe above. The reason is so that it can be part of a key (not the
entire key) in such a way as to allow easy sorting and searching without
the datebase itself having to have any understanding of how the key is
constructed.
However nowdays everything would be managed by an sql box and that sort
of consideration is getting out of date.
The incorrect reason you suggested for fixed width fields is dead,
however fixed width fields are very much alive and kicking. Oh, I come
across them a lot in the applications we interface with, not just in our
own applications.
By the way, when I checked last BerkeleyDB had some big customers.
So strncpy() has a declining
niche.
Well, its use has certainly declined since file-systems generally don't
work the same way.