r/ProgrammerHumor • • 1d ago

Meme checkBuildSettings

Post image
3.4k Upvotes

80 comments sorted by

37

u/thighmaster69 18h 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.

37

u/CaseyG 17h 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.

9

u/TotoShampoin 16h 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

7

u/pint_o_paint 14h ago

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

2

u/2eanimation 15h 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.

1

u/rock_and_rolo 6h ago

This is why I compile frequently while coding. It may waste some time, but I'd rather get a warning after adding 20 lines than after adding 200 lines.

For context, I'm an old editor & command line sort. Things flow differently in an IDE.

47

u/Single-Virus4935 1d ago

Am I to golang to understand this?

67

u/CaseyG 23h ago

-34

u/Single-Virus4935 23h 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.

27

u/CaseyG 23h ago

Does golang encourage you to take everything literally?

-21

u/Single-Virus4935 23h ago

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

28

u/CaseyG 23h 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!

-24

u/Single-Virus4935 23h ago edited 22h ago

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

-1

u/NoobNoob_ 10h 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.

16

u/FabioTheFox 21h 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_ 10h ago edited 10h 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.

11

u/HRApprovedUsername 22h ago

*too

8

u/funkdefied 21h ago

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

8

u/willow-kitty 7h ago

Zero errors, sure.

Zero warnings too - you really should be treating warnings as errors anyway.

I made the bottom-face when I got a compile exception once though. It was in an old version of Visual Studio, using .NET 2.0, and during the build process it would actually start counting up compile errors, then the error count would start going down, and usually it would end at zero and succeed.

But every now and then something would go wrong, and you'd get "Object reference not set to an instance of an object" in the compile error window with no file and line number, I'm guessing because csc itself crashed out.

2

u/CaseyG 6h ago

It resolved so many errors during the linking process that it went negative and overflowed.

2

u/Aba4Gamer 13h ago

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

1

u/CaseyG 5h ago

Of course!

It's not possible to run code if it has compile-time errors, but you can certainly compile it.

2

u/YakubReddit 10h ago

This meme gives me vibes of "missing semicolon" jokes

1

u/CaseyG 6h ago

"I forgot a */"

396

u/FabioTheFox 21h ago

Warnings as errors my beloved

107

u/nfsp-g35 20h 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. 

49

u/FabioTheFox 20h 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

27

u/nfsp-g35 20h 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. 

14

u/FabioTheFox 20h 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

4

u/LinAGKar 11h 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.

22

u/generally_unsuitable 18h ago

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

19

u/PrincessRTFM 12h 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.

8

u/Prawn1908 10h ago

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

12

u/PrincessRTFM 9h 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.

4

u/raunchyfartbomb 10h 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.

9

u/Prawn1908 10h ago edited 9h 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.

6

u/generally_unsuitable 8h ago

Exactly. You turn them off explicitly because 278 stylistic warnings will hide one real warning that causes issues.

16

u/ThaBroccoliDood 20h 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 11h 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- 16h ago edited 12h 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 12h 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

3

u/TiF4H3- 12h ago

Thanks!

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

2

u/pint_o_paint 13h 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 15h ago

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

4

u/RandallOfLegend 10h 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 10h ago

Absolute nonsense

1

u/RandallOfLegend 7h ago

Yes, but did you know that what you're doing could result in a null reference?

1

u/FabioTheFox 7h ago

Well how about we put a ? Or ! after it to acknowledge it and act accordingly

1

u/RandallOfLegend 6h ago

Used to work in older .net, where that wasn't a feature. Working on embedded systems that couldn't get updated beyond .net 4.6.2 led to some interesting challenges. They still release software to that version today.

1

u/FillingUpTheDatabase 10h ago

I prefer errors as warnings

1

u/rock_and_rolo 7h ago

My favorite codebase had Werror turned on. It was very comforting.

I find building open source stuff to be a little stressful, because I don't know whether any of the hundreds of warnings are important.

-1

u/Maximilian_Tyan 17h ago

100+ unused variables/function arguments, our beloved

-1

u/mothzilla 8h ago

pls dont

2

u/FabioTheFox 8h ago

It's a must for any non trivial codebase, ignoring warnings will just lead to everything going to shit

-1

u/mothzilla 8h ago

Yes maybe. But you need a different "pipeline" for warnings. I've seen people do what you're describing and it just results in better imagination in fucking things up.

135

u/rajendrarajendra 23h ago

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

103

u/BillNyepher 17h 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.

22

u/Don_Equis 11h ago

40 years without going to production is a new record.

5

u/lacb1 9h ago

40 years? Rockstar in shambles.

1

u/generally_unsuitable 6h ago

And worth every minute of the effort.

1

u/eaglesnyanks756 2h ago

Ragebait detected

19

u/scratchfan321 20h ago

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

17

u/generally_unsuitable 18h ago

You guys let shit compile with warnings?

7

u/evasive_dendrite 12h 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/eaglesnyanks756 2h ago

Ragebait detected.

1

u/metaglot 15h ago

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

5

u/Garmega 13h ago

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

1

u/nhermosilla14 1h ago

Noobs? Oh, you should meet some of my "senior" colleagues.

9

u/Buyer_North 21h ago

holy self report...

3

u/PQP_The_Dev 6h ago

its difficult to compile an entire codebase without warnings if there are thousands of them (and most if not all are caused by an appropriate usage of language features)

2

u/Majik_Sheff 11h ago

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

2

u/Ange1ofD4rkness 6h ago

Mine is always my tests were bug free. Especially when it's a more complicated solution and it's error free, I am paranoid

2

u/astraxsol 3h ago

AGI at its peak 📈

2

u/eaglesnyanks756 2h ago

ITT: bots who have never shipped a production app telling us to address every warning before deploying

2

u/stupled 1d ago

You disable warnings /w0

1

u/cheezballs 6h ago

Aw you sweet summer child. Warnings are errors