22 ms·
I once had a Vec<Vec<Vec<Vec<u8>>>> in some Rust code that I wrote. Obviously this was completely untenable; even I couldn't reason about what was going on as I
by db48x 4y ago
I once had a Vec<Vec<Vec<Vec<u8>>>> in some Rust code that I wrote. Obviously this was completely untenable; even I couldn't reason about what was going on as I was writing the code. The solution, of course, was to name the parts. The innermost Vec<u8> became a PathComponent, and of course the next Vec out is a whole Path, split up into components, and so on.
I think this kind of thing happens in any language, and the fix is always better naming. It's a shame that C doesn't come with a nice name for the char*. It would make all C code slightly easier to read, and the net benefit for humanity would be huge.