| ▲ | zzo38computer an hour ago | ||||||||||||||||
I agree with most of the criticisms they make. I agree that pointer and length is better than null-terminated strings (although it is difficult in C, and as they mention you will have to use a macro (or some additional functions) to work this in C). Making the C standard library directly against syscalls is also a good idea, although in some cases you might have an implementation that needs to not do this for some reason, generally it is better for the standard library directly against syscalls. FILE object is sometimes useful especially if you have functions such as fopencookie and open_memstream; but it might be useful (although probably not with C) to be able to optimize parts of a program that only use a single implementation of the FILE interface (or a subset of its functions, e.g. that does not use seeking). | |||||||||||||||||
| ▲ | alfiedotwtf 15 minutes ago | parent | next [-] | ||||||||||||||||
Making every C call a system call is not a good idea at all - think about malloc() etc - the OS shouldn’t care about individual allocations and only worry about providing brk() etc. otherwise, performance will die if you’re doing a thousand system calls per second! | |||||||||||||||||
| ▲ | fithisux an hour ago | parent | prev [-] | ||||||||||||||||
Null terminated strings have some merits but they should be a completely different data type like in Freebasic. | |||||||||||||||||
| |||||||||||||||||