4 ms·
Yeah, I know I was being dismissive. Sorry. But I feel and understand the pain, too. I know if I have to make a safe function that can operate over any kind of
by scoutt 5y ago
Yeah, I know I was being dismissive. Sorry. But I feel and understand the pain, too. I know if I have to make a safe function that can operate over any kind of data then I would have to accept a void* (or uint8_t*) and a size, and trust the caller, which at the end of the day is what this is all about. A way to fix it would be to have some sort of generic values and a way to interact with them. I get it.
On the other hand, "trusting the caller" is also how the world operates today (like files and sockets) so any improvement is a "nice thing to have" (depending on the degree of complexity it carries).
Like: constructors/destructors sound like a good idea! Fast-forward 20 years and then you have the rule of 3, of 5, etc.
The line of thought is that if Generics increase my firmware size then I wouldn't use them if possible. If I don't use Generics (if possible), then I probably won't need other things. I definitely don't need async. The language is growing to a height and depth I don't really care.
But if you say that there's no escape and there is little to remove and this is the way it is, then I take it for granted. I can only hope there isn't much to add either so I can catch up someday! Perhaps I have to look elsewhere.
- pornel 5y agoBTW, C++ shat the bed for other better-than-C languages, but C++’s complexity and design failures are their own. In Rust you don’t have rule-of-whatever, it won’t let you write a half-assed destructor. There’s one way to initialize a variable.