News for hackers. Stuff that matters.
Re:Ask HN: What Is Readable Code? by jim-jim-jim on Sunday September 25, 2022 @08:09PM (#32977850)
> I feel like this word is borderline synonymous with “I like this thing”.

Yeah.

"Readable" code for me doesn't waste vertical real estate. If it's off the screen, it's out of my head. This doesn't mean writing 200 char lines; I usually limit myself to 80. It means picking better languages, or at the very least not enforcing obnoxious linting like

    f(
      x,
      y,
      z
    );
the moment a line goes over a limit.
Re:Ask HN: What Is Readable Code? by smoldesu on Sunday September 25, 2022 @08:14PM (#32977892)
Agreed, the example you posted is one of the main reasons I feel weird using Go. If there were better semantics in place, I feel like Go could really balance legibility and ergonomics to their advantage. As it stands though, I actually feel like Rust and C++ are more readable than Go. It uses more brainpower to understand what's going on, but the way those languages maximize each line's potential is really nice. Coming from Java and Python, it was like dusting off Tolkien after years of J.K. Rowling.