Tomboy, Gnote, and the limits of forks
Tomboy, Gnote, and the limits of forks
Posted May 6, 2009 3:30 UTC (Wed) by shmget (guest, #58347)In reply to: Tomboy, Gnote, and the limits of forks by jordanb
Parent article: Tomboy, Gnote, and the limits of forks
Yes writing a god string library in C is some work, but you have to do that only once.
And no, you do not have to impose silly restriction.
"there's the problems with butchering any string that contains a NULL character."
Every Mixed CCSID that I know of take great care to avoid binary 0 in any port of a character. (pure DBCS usually avoid it too, except UTF-16, but then the 'unit of work' is a int16_t not a int8_t)
So you are left with dealing with 'string' that actually contain the character NULL... and quite frankly that is practically irrelevant.
Furthermore, a good String library will keep track of size -- without using the C zero-terminated convention -- for performance and memory management reason, so even the irrelevant 'problem' of NULL in a string is actually covered as a side effect....
The whole 'memory management is hard' theme is a red herring. Good design is hard, good coding is hard, yes... but memory management is really a question of disciple and habit, and after a while if become second nature.
 
 
           