This is why I believe we're going to need better tools for reading and exploring codebases

"Writing code is easy. Once you have a solution in mind, and have mastered the syntax of your favorite programming language, writing code is easy. Having an LLM write entire functions for you? Even easier. But the hard part isn’t the writing. It’s the reading. It’s the time it takes to load the mental model of the system into your head. That’s where all the cost really is."

https://idiallo.com/blog/writing-code-is-easy-reading-is-hard

Writing Code Is Easy. Reading It Isn’t.

Writing code is easy. Once you have a solution in mind, and have mastered the syntax of your favorite programming language, writing code is easy. Having an LLM write entire functions for you? Even eas

Ibrahim Diallo Blog

@sue

Some years ago, I started to use Rust for my personal projects. One thing upsets me all the time. The readability of other peoples code.

'cargo fmt' is used in most cases to format the code in a standard way. But this squeezes nearly everything into one line. A nightmare for myself, needing to parse the whole line. I often give up halfway and ignore the tail.

Another annoyance is the use of fancy keywords/methods.
For results, there are methods like .is_ok_and() or .unwrap_or_else(). These seem to be useful to write short code, which should be easier to read. But it isn't.
Every keyword needs to be parsed itself because there are subtle differences between each.

@sue

I use only 'match' structures for that. They look somehow ugly. But parts of the inner structure are actually visible without even reading a single word.

And if they really look ugly, it is a sure sign to tear them apart and split into more functions. Just from the structure.
It doesn't hide anything.

My next strategy for readable code is to only put one thing into a single line (with a couple exception).

instead this:
if a.pos.x > b.pos.y {do_stuff(var1,var2);};

I do this:
if
a
.pos
.x
>
b
.pos
.y
{
do_stuff(
var1,
var2,
);
};

Horrible for many others. Extremely helpful for myself.

@sue

I work with the code. I want to edit parts of it, copy paste parts of it, comment out parts of it. I will read it tens or hundreds of times and will edit it a couple of times in the next few years. I don't want to spend any time, stumbling over the same fancy keywords again and again.

It is more work in writing, which isn't much at all. And you need a good mouse wheel to scroll and knowledge of the comfort functions of your IDE.

In general, I exchanged convenience for a better fit to my mental model.

@sue

I had experiences, where people said aggressively, they will never help other projects, when the code is not formatted with the standard tool.
I can live with not getting any help. But being dictated how to write my personal code was a little bit much.

I don't want to have this compressed code. I could spit out hundreds lines of code a day, don't even need an AI for it. But I would never be able to read it again.

My projects are a craft.
AI doesn't know, what that is.

And AI can't help me reading my code. Because reducing something to basic vectors removes the important details.