944
Variable Declaration (programming.dev)
you are viewing a single comment's thread
view the rest of the comments
[-] myxi@feddit.nl 8 points 3 months ago* (last edited 3 months ago)

I turn off LSPs during my train of thoughts. I don't want all red and yellow underline bullshit to disrupt my thoughts. Like, calm the fuck down. I WILL write the correct code eventually; just give me some fucking time.

Well, I use Neovim, so turning off the LSPs or restarting them is sufficiently simple.

When I work on a new project, or on a new feature, I temporarily turn off the LSP, and rely on the compiler to figure out where the code errors. Plain white text gives me the freedom to write whatever the fuck I want without any disruption. Of course, I eventually turn on the LSP again to fix the little issues.

[-] baseless_discourse@mander.xyz 3 points 3 months ago* (last edited 3 months ago)

Many languages allow type hole like _ to indicate to the compiler/lsp that this is an expression you will fill in later.

So that lsp don't put a squiggle on the entire program, only the type hole

[-] myxi@feddit.nl 2 points 3 months ago* (last edited 3 months ago)

I also leave out little syntax errors and only only focus on the rough idea during my train of thoughts. And the variables, aren't really supposed to be implied as private or unused -- I do eventually meaningfully use them. If I have to prefix all my variables with a underscore to avoid the LSP, I might instead just disable the LSP. When I eventually turn the LSP back on, it tells me the actually unused variables and imports that I can now get rid of.

Because of the LSP, I used to write maybe three hundred lines of code per hour, but now I probably average at least five hundred or more.

this post was submitted on 27 Mar 2024
944 points (98.2% liked)

Programmer Humor

18244 readers
1 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS