News for hackers. Stuff that matters.
Re:A Rust Shaped Hole by shmerl on Thursday July 17, 2025 @12:45AM (#44589763)
Yeah, and C can get unreadable fast. Obfuscated C contest is a great example: https://www.ioccc.org

But that doesn't mean it's a good idea to use such style for PRs, lol.

Re:A Rust Shaped Hole by Expurple on Thursday July 17, 2025 @02:11AM (#44590215)
That's a really weird example to give. You can write unreadable code in any language if you're determined enough
Re:A Rust Shaped Hole by shmerl on Thursday July 17, 2025 @02:22AM (#44590277)
Well, C has such contest, not every language on the other hand.
Re:A Rust Shaped Hole by staunton on Thursday July 17, 2025 @02:40AM (#44590398)
I'd guess that's mostly because C has been around long enough to be chosen for it and people who are into that kind of thing don't urgently need more than one contest, regardless of language...
Re:A Rust Shaped Hole by peppingdore on Thursday July 17, 2025 @02:14AM (#44590227)
Rust is unreadable by default
Re:A Rust Shaped Hole by shmerl on Thursday July 17, 2025 @02:21AM (#44590267)
Syntax could be less terse and abbreviated, I agree. But it's not unreadable. On the other hand some complain that Rust sometimes is too verbose, so I guess it's some balance.
Re:A Rust Shaped Hole by flohofwoe on Thursday July 17, 2025 @05:18AM (#44591345)
> But it's not unreadable.

That's just because you got used to it ;) (same as with modern C++ really, if you've used C++ long enough you become blind to its problems)

Re:A Rust Shaped Hole by sagacity on Thursday July 17, 2025 @05:44AM (#44591486)
This is completely true.

"Regular" Rust and C++ is fairly readable, but a quick Google for "Higher Kinded Types in Rust" ends up with [0]:

  fn ap<A, B, F: Fn(&A) -> B>(x: &<Self as Plug<F>>::R, arg: &<Self as Plug<A>>::R) -> <Self as Plug<B>>::R
          where Self: Plug<A> + Plug<B> + Plug<F>;
[0] https://hugopeters.me/posts/14/
Re:A Rust Shaped Hole by throwawaymaths on Thursday July 17, 2025 @11:14AM (#44594277)
verbosity is not really the same as nonreadability.

i would say the biggest factor for nonreadability is not being able to chase function calls using simple text search, with as few indirections as possible. proc macros and to a lesser degree traits make that difficult.

Re:A Rust Shaped Hole by shmerl on Thursday July 17, 2025 @11:38AM (#44594529)
Yeah. You can to use LSP to work around it for usage search (which is really helpful), but it's definitely not a human readable case if function name is obscured.