Re:C Strings and my slow descent to madness
by userbinator on Thursday April 06, 2023 @09:31AM
(#35468081)
Well-written C tends to minimise string usage in general, preferring to convert to another format as soon as possible. Allocating, copying, and passing around strings in large quantities is not a good idea for efficiency, but of course some people coming from other HLLs seem to try to do it anyway, which causes many other problems.
[ Parent
| on HN ]
Re:C Strings and my slow descent to madness
by bell-cot on Thursday April 06, 2023 @11:20AM
(#35469553)
THIS.
And programming, engineering, and life in general have so, SO many other situations where "X is not very good at doing Y". Yet (my experience) guys seem extremely resistant to the common-sense strategy of "then try to minimize how much Y you do with X".
Re:C Strings and my slow descent to madness
by agumonkey on Thursday April 06, 2023 @05:57PM
(#35475089)
to the point I often wonder if strings should exist.. buffers -> symbols | structs.
> preferring to convert to another format as soon as possible.
Like what?
Re:C Strings and my slow descent to madness
by userbinator on Thursday April 06, 2023 @10:39PM
(#35477353)
A structure of binary fields.