News for hackers. Stuff that matters.
Re:From Go to Rust: The Two Types of Readable Code by adamgordonbell on Wednesday February 14, 2024 @10:54AM (#39371340)
Thanks for sharing this! I wrote it.

Here's the idea: Code readability is highly subjective. What looks like gibberish to some is crystal clear to others.

But is readability more than just familiarity?

I think so and I think their is more than one type of readability. Newcomer Readability and Experienced Readability. And sometimes, they clash.

Which one should programming languages prioritize? Newcomer Readability helps adoption and is closely related to familiarity. But Experienced Readability is all about expressiveness.

Re:From Go to Rust: The Two Types of Readable Code by OkayPhysicist on Wednesday February 14, 2024 @06:45PM (#39377193)
"Time to reading fluency" is a pretty useful concept for language comparison. Framing it that way reveals an interesting fact: There's more than one way to make your language more readable. One way is by sacrificing information density, giving up Experienced readability in order to optimize for newcomer readability. Go is the posterchild for this approach.

The alternative is to provide better educational tools to increase the speed someone can reach a higher level of fluency. Elixir does a pretty good job of this, by providing a lot of very easily consumed guidance in their documentation (Their language guide [1] is IMO the gold standard for introductions to a language).

[1] https://hexdocs.pm/elixir/introduction.html

Re:From Go to Rust: The Two Types of Readable Code by adamgordonbell on Thursday February 15, 2024 @01:07PM (#39386062)
This is a solid point that I didn't think of. Time to reading fluency. Love it.
Re:From Go to Rust: The Two Types of Readable Code by tharne on Thursday February 15, 2024 @09:15AM (#39382942)
> Here's the idea: Code readability is highly subjective

It really isn't. There may be things about it that are subjective, but readability is a fairly straightforward concept to most people.

It's okay to make something less readable, if the tradeoff you get for that is worth it. Sometimes it is, but most of the time it isn't.