2 ms·
While this goes in the right direction, it still feel like wrapping yourself in bubble wrap for safety The true ergonomic solution are slices. Because you don'
by raverbashing 2y ago
While this goes in the right direction, it still feel like wrapping yourself in bubble wrap for safety
The true ergonomic solution are slices. Because you don't need boundary checks if you're iterating using the slice count
This is definitely a helpful functionality, but it still keeps to C mentality
- flohofwoe 2y agoIf the main goal is hardening existing code bases then this Clang proposal is the right approach IMHO. I think integrating slices "properly" would touch quite a few other areas of the language, which require opinionated design decision by the committee. And committees aren't exactly known for coming up with sensible language design decisions (and looking at C++, I'm fine with the C committee being very conservative). Basically, if I want an actually "better C" for new code, I use Zig. But C is still a valid option for low-level libraries that need to work everywhere (and of course for tapping into the existing library ecosystem).
- raverbashing 2y ago> If the main goal is hardening existing code bases then this Clang proposal is the right approach IMHO. Yup, on this I agree. And I've seen efforts in adding this to existing code
- pjmlp 2y agoTo note that committee refused Dennis Ritchie proposal for slices, without ever doing a counterproposal, then again I hope this new principles have a change of mindset in that regard.