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.
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
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.
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.
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
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.
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
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.
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
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.
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.
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.
41
u/Single-Virus4935 12h ago
Am I to golang to understand this?
17
u/thighmaster69 6h 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.
189
u/FabioTheFox 9h ago
Warnings as errors my beloved
70
u/rajendrarajendra 11h ago
I would never send any code to production with any warnings or errors.
13
u/scratchfan321 8h ago
But it runs at maximum speed with no apparent bugs (it deleted the drivers for the mouse cursor)
8
u/generally_unsuitable 6h ago
You guys let shit compile with warnings?
7
u/Buyer_North 9h ago
holy self report...
2
u/stupled 12h ago
You disable warnings /w0
1
u/Aba4Gamer 1h ago
But is it possible to compile the code if it has errors?