r/ProgrammerHumor • • 15h ago

Meme checkBuildSettings

Post image
2.6k Upvotes

58 comments sorted by

28

u/thighmaster69 9h ago

I think the point of this meme is that it's suspicious if it compiles the first time without errors vs. without warnings. It just seems too good to be true that you didn't trip any warnings at all on your first prototype.

25

u/CaseyG 8h ago

If it compiled the first time without errors, I've done something right.

If it compiled the first time without warnings, I've done nothing at all.

7

u/TotoShampoin 7h ago

Ok but for real tbh

If you don't trust it when it compiles correctly with no warning on first try, that's a skill issue in self esteem

4

u/pint_o_paint 5h ago

never heard someone refer to low self esteem as a skill issue, looks funny though

1

u/2eanimation 6h ago

I use all of the warning flags(well, most of them anyways). It happened before, but I’d still be impressed if it doesn’t give me at least an implicit type conversion warning or something.

46

u/Single-Virus4935 15h ago

Am I to golang to understand this?

61

u/CaseyG 14h ago

-31

u/Single-Virus4935 14h ago

Am I to golang to understand? I have more "yeah it works in first try" than problems. Even logic wise.

But I guess most of it is rooted in the excellent JetBrains IDE which just shows every problem in realtime. With VScode I indeed have more errors but it is same with all languages.

22

u/CaseyG 14h ago

Does golang encourage you to take everything literally?

-19

u/Single-Virus4935 14h ago

Yes, it doesn't allow for much ambiquity. You take everything word by word. They even promise that.

26

u/CaseyG 14h ago

Okay, I've given you three jokes here, and I don't think you've gotten any of them, so I'm giving up. Have an awesome day!

-22

u/Single-Virus4935 14h ago edited 13h ago

I understood them but they arent funny as I cannot relate to them.

-1

u/NoobNoob_ 2h ago

I see. So any marvel movie is bad cause I can't relate to being a superhero. Any crime movie is bad cause I can't relate to being a criminal. Any x is bad cause I can't relate to being x.

17

u/FabioTheFox 12h ago

The glaze is real, jetslop IDEs are horrible for most things and are just a pre configured version of IntelliJ sold to you at different prices

Its ridiculous of you to claim that the heavy lifting is being done by Jetbrains when the Golang toolchain (the same one vscode and any other editor uses btw) is doing all the magic

0

u/NoobNoob_ 1h ago edited 1h ago

I've used vscode, zed, vs, eclipse, and jetbrains. My company paid for them so I don't really care about their pricing model (which is actually not bad, considering you can keep using the version (year) you paid for forever).

Jetbrains made me write code faster than the others, and actually have a lot of great features.

It was so good, that in my last company everyone was using vs when I arrived, and by the time I left over half were using Rider.

You can say what you want, but they are way better.

Edit: a post below this one I had this. Guess it'll go downhill from here.

10

u/HRApprovedUsername 13h ago

*too

6

u/funkdefied 12h ago

Careful now. He’s a golang dev. Don’t want to hurt the poor fellow. 

284

u/FabioTheFox 12h ago

Warnings as errors my beloved

76

u/nfsp-g35 11h ago

On the CI pipeline for pull requests. Your WIP branch can have all the build warnings you want, but main is having none of your shenanigans. 

36

u/FabioTheFox 11h ago

No not even on the other branches, my CI fails when the program has warnings regardless of what branch you're on, never letting warnings touch the dev branch in the first place is the only way

17

u/nfsp-g35 11h ago

I guess it depends on your source control strategy. If it were me and I was using using gitflow (assumption since you said dev branch) then protect the dev, test, stage, prod, main or whichever branches actually represent an environment... but I personally don't like to force too strict of rules on every branch or even run CI if there's no PR/MR, it burns lots of build minutes, generates noise, and can run counter to commit/push early and often. That said, I'd still prefer your approach to the wild-west, no rules nonsense that I've seen waaay too much in the industry. 

10

u/FabioTheFox 11h ago

Oh yeah totally, my wording might have been a bit off I was talking about PRs to any of the main branches (the ones you mentioned)

People can do whatever they want on their own feature branch but when it's time to push the code into one of them then they gotta pass all the checks first

1

u/LinAGKar 2h ago

That's sorta what we did at my job. If you have warnings, it will still successfully build and run the tests, but a check at the end of the CI pipeline will fail the pipeline if you have introduced warnings. And as long as the pipeline is failing, you can't merge. But yeah, that does mean we get a pipeline failure message even if we haven't created an MR yet.

15

u/generally_unsuitable 9h ago

Nah. Ignoring warnings creates notification fatigue. Clean your builds until they're silent

14

u/PrincessRTFM 3h ago

For years, my argument has been that if the warning is correct then it should be fixed, and if it isn't then it should be explicitly suppressed at that location. I don't give a fuck that it's "just a warning", warnings exist for a damn reason. Either the compiler is right and that code isn't doing what I expected, or I know better and I should save myself and any future maintainers effort by adding a suppression and explanation. The only reason I don't set all warnings to be errors is because some of them trigger while I'm still writing my code and I want to be able to test in stages.

4

u/Prawn1908 1h ago

Exactly. Warnings either get corrected or locally suppressed with a comment right above the #pragma explaining exactly why it's safe.

1

u/PrincessRTFM 49m ago

my favourite is the way rust does it: #[expect(whatever)] will emit a warning if no warning of category whatever is emitted. if you refactor things and that warning is no longer relevant, you need to remove the suppression, and using expect instead of allow is perfect for that.

2

u/raunchyfartbomb 1h ago

Oh, you used a ternary instead of an if? That’s warning because for some reason the new visual studio doesn’t like it.

Your using “new X()” instead of “new()”? Gtfo

Your extension methods for IServiceProvider don’t exist within a project named “System”? (IDE0130)

Some warnings are noise.

3

u/Prawn1908 1h ago edited 1h ago

Nothing pisses me off more than those stylistic warnings. I have my own style that makes sense to me and my coworkers and we follow strictly, and we're not going to go refactor our whole codebase every time Micro$lop adds new syntactic sugar to C#. I hate languages that try to impose their own style on me, and integrating that into the compiler at the same level as real warnings about potential dangers is offensive.

However, those warnings get suppressed, not ignored.

13

u/ThaBroccoliDood 11h ago

NGL Rust gets it right on this one. Unused variables or unnecessary mutability, sure, give a warning. But anything else really ought to be an error. C/C++ are way too lenient on what you can ignore when it knows it’s wrong

2

u/beyluta 2h ago

Clang-Tidy rules for C and C++ can help with some of these headaches. But the setup is tedious and some flags only work on C++ but not on C or vice versa (for some unknown reason).

3

u/TiF4H3- 7h ago edited 3h ago

And even better, it's entierly customizable using directives within the code itself!
It evencan be set for the whole project, or for a specific module.

If you are still prototyping, you can add a little

#![allow(unused)]

and change it into a deny/forbid on the production build.

On the other end, a

#![forbid(unsafe)]

is a wonderful guarantee for your codebase.

There also a lot of very specific lints you can turn on, relating to endianness, and a bunch of more domain-specific things.

Quick edit:

More specifically, there's the whole restriction lint group, which is allow per default.

It has a lot of things related to enforcing some uncommon coding guidelines (like no else if without an else).

And there's also the whole pedantic lint group, also allow per default.

It's instead lints that are technically good, but more among the realm of micro optimizations and pedantic bullshit than the realm of actually important errors (like using an unstable sort to sort primitives, as it's slightly faster than a stable one).
But they can be very useful in contexts where these actually matter.

3

u/PrincessRTFM 3h ago

point of detail: it's #![...] not !#[...]

also, inline code doesn't get syntax highlighting so the leading rs for the language just gets rendered directly

2

u/TiF4H3- 3h ago

Thanks!

I always mess up the #! and never remember which is correct, lol.

2

u/pint_o_paint 4h ago

I hate that for a second I suspected your post to be an AI-copypasta; only because at first glance I saw proper formatting and an upbeat/enthusiastic intro ("And even better, it's entierly customizable[...]!").

I love proper formatting and enthusiastic posts, darn it.

-2

u/tiajuanat 6h ago

Rust has some really cool lints, and if you're working with agents you may as well activate all of them

2

u/RandallOfLegend 1h ago

If warnings were a problem they should have been an error from the start. Or just not have warnings at all.

1

u/FabioTheFox 1h ago

Absolute nonsense

1

u/FillingUpTheDatabase 1h ago

I prefer errors as warnings

•

u/mothzilla 1m ago

pls dont

-1

u/Maximilian_Tyan 8h ago

100+ unused variables/function arguments, our beloved

97

u/rajendrarajendra 14h ago

I would never send any code to production with any warnings or errors.

64

u/BillNyepher 8h ago

Look at my flair. Now back at me. The codebase I work on is 40 years old. Getting rid of every warning would be a ridiculously arduous process.

10

u/Don_Equis 2h ago

40 years without going to production is a new record.

2

u/lacb1 10m ago

40 years? Rockstar in shambles.

17

u/scratchfan321 11h ago

But it runs at maximum speed with no apparent bugs (it deleted the drivers for the mouse cursor)

13

u/generally_unsuitable 9h ago

You guys let shit compile with warnings?

2

u/evasive_dendrite 3h ago

It's really infuriating. And then I have to spend hours cleaning it all up because surprise suprise, it's a buggy mess. Escpecially when they just ignore deprecation warnings and then still update all the dependencies like an absolute neanderthal.

1

u/metaglot 6h ago

I think noobs tend to disregard everything thats is no hindrance to compilation. The experienced know those warnings are there for a reason.

3

u/Garmega 4h ago

Except for Xcode. Xcode will give you a warning SOMETIMES because it felt like it

9

u/Buyer_North 12h ago

holy self report...

2

u/stupled 15h ago

You disable warnings /w0

1

u/Aba4Gamer 4h ago

But is it possible to compile the code if it has errors?

1

u/Majik_Sheff 2h ago

Let's do that again, just to be sure it wasn't a fluke...  Annnd we've got this compiled.

1

u/YakubReddit 1h ago

This meme gives me vibes of "missing semicolon" jokes