6 ms·
and that is where the problem lies. All code is readable if you spend an hour or two. The point is that it is not lucid. You have to strain to understand such c
by webaholic 8y ago
and that is where the problem lies. All code is readable if you spend an hour or two. The point is that it is not lucid. You have to strain to understand such code. The issue is people thinking this code is acceptable.
- TheDong 8y agoIt's not being presented as acceptable code for maintenance or other long-term usage. It's being presented as a terse explanation of what the bug was and how it was triggered. I didn't spend an hour or two understanding that code, I spent less than a minute because I already know rust. I don't understand your point. The code served its purpose well: for the audience (rust users) it demonstrated the bug (lifetime unsafety in match ergonomics change). If the audience were "people who don't know rust", then of course that code wouldn't be a good demonstration, but that's not who the audience for this post is.
- matthewmacleod 8y agoExpressing complex concepts almost always requires complex expressions of intent! I don’t really know Rust all that well beyond a few toy projects. But if you were familiar with core aspects of the syntax and semantics - lifetimes, generics, tuples and the void type in this case - then it’s not particularly complex. Add to the fact that it’s code you’re not actually going to see in practice and I don’t think it’s so bad!
- pcwalton 8y agoThat code is not "acceptable". It's not supposed to be. It's a compiler test case.
- ketralnis 8y agoWhat is a language that you claim I can't find a similarly difficult sample of?