Something
public text v1 · immutable Gute API vs. Schlechte API
Schlecht:
int i;
char buf[100];
sprintf(buf,"the number is %d",i);
Gut:
stralloc s={0};
stralloc_copys(&s,"the number is ");
stralloc_catuint(&s,i);
Gute API vs. Schlechte API
Schlecht:
int i;
char buf[100];
sprintf(buf,"the number is %d",i);
Gut:
stralloc s={0};
stralloc_copys(&s,"the number is ");
stralloc_catuint(&s,i);