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.
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.
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.
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'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.
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
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.
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.
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.
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.
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
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).
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.
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.
46
u/Single-Virus4935 15h ago
Am I to golang to understand this?
284
u/FabioTheFox 12h ago
Warnings as errors my beloved
97
u/rajendrarajendra 14h ago
I would never send any code to production with any warnings or errors.
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?
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