Earlier quoted context omitted.
Sure you can, that is what Abstract Data Types architecture design is all about. Naturally, when one creates struts and accesses the fields directly there is no way out of a bad design.
That's a pipe dream. There are a handful of successful abstractions, like streams or associative containers, or strings for that matter. Even those quickly get too abstract for serious use, and you need to actually expose what's really happening to make sensible choices, because there are vastly different kinds of streams or containers (or even strings), because, well, those are abstractions. Other more far reaching…
Stop using strncpy already (2013)
81–83 of 83 posts
Re: Stop using strncpy already (2013)
#82Earlier quoted context omitted.
Of course, but everyone wants to overdo the complexity of the time worn solution. OMG you need to null terminate the string after all the _other_ gymnastics..gee C sure does suck! Why don't we use rust|go|c++ ad-nauseam. bzero(buf,sz); / memset nazis here / strncpy(buf,src,sz - 1);
It doesn't make sense to have to null-terminate the string by hand (maybe) after doing a "safe" STRING copy. Which means it's easy to forget to do and that's a dangerous wart in the design. Really, stop using C. To quote Hayao Miyazaki, C was a mistake.
Re: Stop using strncpy already (2013)
#83Earlier quoted context omitted.
It doesn't make sense to have to null-terminate the string by hand (maybe) after doing a "safe" STRING copy. Which means it's easy to forget to do and that's a dangerous wart in the design. Really, stop using C. To quote Hayao Miyazaki, C was a mistake.
Teach your grandmother to suck eggs and resign the thought police please.