83 points

But are you gonna return something for this method??? You said you’d return an integer, yet there is no return statement!

permalink
report
reply
41 points
*

and it had better be an integer! it had better be an integer, motherfucker!!

permalink
report
parent
reply
17 points
*

Well yea… If you write “return <object of some other type>” that is actually wrong, as opposed to just not having gotten around to filling it in yet

permalink
report
parent
reply
11 points

permalink
report
parent
reply
16 points

This is why I always write my methods from bottom to top. This way I’ve always got a return statement and I use my variables before they are even declared.

permalink
report
parent
reply
4 points

For a second there I thought you might be serious

permalink
report
parent
reply
2 points

I do actually use variables before I declare them most of the time. IDEs make it so easy to then generate the declaration with the correct type.

permalink
report
parent
reply
1 point

Ah an avid dreambird user I see

permalink
report
parent
reply
1 point

Spotted the INTERCAL programmer.

permalink
report
parent
reply
65 points

IDE is one thing, Go refuses to compile. Like calm down, I’m going to use it in a second. Just let me test the basics of my new method before I start using this variable.

Or every time you add or remove a printf it refuses to compile until you remove that unused import. Please just fuck off.

permalink
report
reply
16 points

Yeah I think it’s trauma due to C/C++'s awful warning system, where you need a gazillion warnings for all the flaws in the language but because there are a gazillion of them and some are quite noisy and false positives prone, it’s extremely common to ignore them. Even worse, even the deadly no-brainer ones (e.g. not returning something from a function that says it will) tend to be off by default, which means it is common to release code that triggers some warnings.

Finally C/C++ doesn’t have a good packaging story so you’ll pretty much always see warnings from third party code in your compilations, leading you to ignore warnings even more.

Based on that, it’s very easy to see why the Go people said “no warnings!”. An unused variable should definitely be at least a warning so they have no choice but to make it an error.

I think Rust has proven that it was the wrong decision though. When you have proper packaging support (as Go does), it’s trivial to suppress warnings in third party code, and so people don’t ignore warnings. Also it’s a modern language so you don’t need to warn for the mistakes the language made (like case fall through, octal literals) because hopefully you didn’t make any (or at least as many).

permalink
report
parent
reply
12 points
*

VSCode with Go language support: removes unused variable on save “Fixed that compilation bug for ya, boss”

permalink
report
parent
reply
4 points

Like actually deletes them from the working copy? Or just removes them in the code sent to the compiler but they still appear in the editor?

permalink
report
parent
reply
17 points

Yeah IIRC it deletes them, which is as mad as you would expect. Maybe they’ve fixed that since I used it last which was some years ago.

permalink
report
parent
reply
36 points

Compiler/interpreter: Can’t find variable farfignewton.

Earlier:

Me: Declare variables near, far

IDE: Oh! You mean farfignewton right? I found that in some completely unrelated library you didn’t write. Allow me complete that for you while you’re not paying attention.

permalink
report
reply
15 points

And people wonder why I stick to Vim.

permalink
report
parent
reply
12 points

I mean, if you want something dumb you can use any text editor.

permalink
report
parent
reply
5 points

Yes, compared to the annoyances of “smart” IDEs, I do want something dumb.

permalink
report
parent
reply
2 points

One thing most text editors can do is print. I was shocked the other day when I couldn’t print a readme from vscode when someone asked for hard copy.

permalink
report
parent
reply
4 points

using lsp in vim has pretty much the same problem especially with java

permalink
report
parent
reply
13 points

near, far

The obvious autocomplete is , wherever you are

permalink
report
parent
reply
3 points

This is why I fear activating any AI features in the IDE.

permalink
report
parent
reply
4 points
*

I try my best to make my IDEs follow the principal that I should be able to type without looking at the screen, but apparently IDEs are really invested in return accepting completions to the point it’s often not configurable even when every other key is.

permalink
report
parent
reply
4 points
*

thank you for flooding my memory with a bunch of silly 90s car commercials

permalink
report
parent
reply
4 points

Visual Studio: PROPERTY DOESN’T EXIST ON TYPE!! NOTHING EXISTS ANYMORE!!! REALITY HAS COLLAPSED!

Me: What? I haven’t even touched that class, let me check.

Visual Studio: Oops, nevermind, héhé 🙃

permalink
report
parent
reply
2 points

I swear to god this didnt used to be a problem few years ago. However im having that bug constantly now…

permalink
report
parent
reply
1 point

Yeah, I also feel like it’s fairly recent.

permalink
report
parent
reply
2 points

Then it automatically imports the library for you too lol

permalink
report
parent
reply
9 points

Me: <starts a heredoc>

jetbrains: This heredoc goes on FOREVER!

Me: I’m going to close it…

jetbrains: <dies>

permalink
report
reply
6 points

I start writing the implementation and get the “variable not defined” error and then let the ide add the declaration. It’s less keys to press and misspell.

permalink
report
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 3.4K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments