← Back to context

Comment by maxk42

1 year ago

That's exactly the problem: You don't know the code. You're relying on autocomplete to tell you what the signature of the function you're looking for is.

I rely less on documentation because I've got it all memorized due to not relying on autocomplete.

Surely you didn't memorize the entire 3rd party ecosystem of a programming language?

  • I memorize everything I work with. Knowing my tools makes me a better developer.

I mean, maybe? But if you hover over the function you just completed, the same LSP will also show you the documentation.

This is how I personally use it for discovery, anyway. The other day I was writing some Rust code and needed to remove a prefix from a &str. I tried a few common names after ‘.’ to see what would autocomplete, before finding that Rust calls this idea “trim_start_matches”. I then wanted to know what happens if the prefix wasn’t present, so I just hovered my mouse over it to read. Now, if I was writing Rust a lot, I would end up memorizing this anyway. I’ve never not written Python without a similar tool involved, yet I have a pretty close to encyclopedic knowledge of the standard library.

I feel similarly about go-to-definition. I often use it the first time I’m exploring code, or when I am debugging through some call stack, but I also always do read where I actually end up, and do form a mental map of the codebase. I’m not sure I buy either the contention in this thread that these “crutches” make developers uniformly worse, or that removing them would make all poor developers suddenly more disciplined