Re:The case against a C alternative
by jstimpfle on Tuesday August 09, 2022 @08:04PM
(#32406312)
Idiomatic is the wrong word here, because it's certainly not idiomatic to do extra allocations when unneeded. Most APIs let you give the length explicitly if it makes any sense. A not very well-known fact is that even printf format strings let you do printf("%.*s\n", 3, "Hello") which only prints "Hel\n". This is in POSIX C, just not sure when it was standardized.
[ Parent
| on HN ]
There are no comments on this comment yet.