2 ms·
> Not char/byte C strings. You might be thinking of wchar_t strings. No I’m talking about the classic byte arrays C pretends are strings. If the receiver you a
by WastingMyTime89 4y ago
> Not char/byte C strings. You might be thinking of wchar_t strings.
No I’m talking about the classic byte arrays C pretends are strings. If the receiver you are talking to is not expecting a chain of bytes where each byte is a character and one special value means the chain is over, well, you will have to transform what you are sending to what your receiver is expecting.
- kazinator 4y agoIf somebody's expecting something other than a C string then we unsurprisingly have gratuitous complications. If everyone agrees on the C string though, it just interoperates as-is. Code compiled for some 16-bit microcontroller can just shove the C string into its transmit buffer, and on the other end, code compiled for 64 bit big-endian Power PC receiver just uses it as-is.
- timbit42 4y agoC is the biggest mistake in the software industry since the beginning of software. The people that worship C only do so because they haven't seen the better paths the software industry could have chosen.
- kazinator 4y agoE.g. Donald Knuth hadn't seen better paths. "I think C has a lot of features that are very important. The way C handles pointers, for example, was a brilliant innovation; it solved a lot of problems that we had before in data structuring and made the programs look good afterwards. C isn't the perfect language, no language is, but I think it has a lot of virtues, and you can avoid the parts you don't like. I do like C as a language, especially because it blends in with the operating system (if you're using UNIX, for example). All through my life, I've always used the programming language that blended best with the debugging system and operating system that I'm using. If I had a better debugger for language X, and if X went well with the operating system, I would be using that." Dec 7, 1993, Computer Literacy Bookshops Interview.
- asveikau 4y agoThis is ridiculous hyperbole. Nobody "worships" C and people who have positive experiences with C often have exposure to higher level languages. You can find strengths or upsides in C and still acknowledge faults, and still acknowledge merits elsewhere.