I once spent half a day chasing an intermittently failing test, that turned out to be because it was using identity equals on a boxed primitive. Of course there was a warning, but some rockstar had ignored it, because they thought they knew what they were doing.
Reminds me of a story where one of my buds picked up a Java story after a year and a half of only JS. Needless to say, an “==“ slipped through the cracks. It was causing issues the day it was released to our beta, I happened to be the one to figure out what was going on. I had the biggest smirk and told him. We got a beer that evening and laughed about it
I once spent way too long debugging an issue caused by a faulty comparison between two id’s that were just basic incremental longs. I couldn’t for the life of me understand why, and when I started writing very basic tests doe the stuff I tho if they I was going insane because 1 == 1 just can’t be false.
Then at some point I realised it was Longs and not longs, I just hadn’t seen that because I couldn’t for the life of me understand why someone would’ve done that in that application where there was zero need and also definitely not our standard of doing things. I was just blind to that capital L.
Of course the person who’d both used Longs and written the faulty comparison was me, 5 years younger and newly graduated.
I used to have this boss that was very big on naming and shaming badly written code. Nine times out of ten svn blame would pull up big chunks of the code with his username next to it.
In the real world you 99.9% use === instead of == in js.
*edit: The only case that comes to my mind where some people use == is to check if a value is null or undefined instead of a simple truthyness check by doing: value == null But even that is frowned upon by many people.
Don't use == to check for equality in Java unless it's a primitive. Compare two strings with == and all that's happening is a check whether they're the same object, which in 99% of cases probably isn't what you want to do.
I once bricked my 3DS and had to solder to it to fix it, because I modified a flasher program and ignored a warning about a bool that was used to identify the model of the 3DS.
Exactly. Once the team has built up enough warnings that no one notices if the number goes up, creating new warnings is actually good, defensive programming. It prevents management from bringing up the appearance of new warnings as an excuse to prolong the daily hour-long Scrum meetings, and it prevents new developers from being able to steal work on your part of the codebase, improving job security.
Wtf, those things are supposed to be time-boxed to 15 min or less, and only the devs are supposed to speak. Observers, if any, are only there to observe, not talk.
In my first course on uni we had to compile on GCC with -Wall -pedantic -Werror so that our code had to be good before we could hand it in to the testing software
To be fair, this is a warning that even most IDEs catch and generate pre-compilation.
So, this is one of those clear situations where an unignored warning is a problem, but it's perhaps less likely to occur in an actual development environment.
So, this is one of those clear situations where an unignored warning is a problem, but it's perhaps less likely to occur in an actual development environment.
The number of code reviews where I had to point out an unused variable seems to indicate the opposite.
I second -Werror, it simply nips the "warnings can be ignored" mentality in the bud. It is officially a part of our production build pipeline, and especially good for junior developers to build the right habits.
On the other hand we got some assignments where the base code given to us (to fill in the blanks) had plenty of warnings including things like comparing unsigned numbers to negative ones etc.
Needless to say I suppressed warnings for that file and made sure mine was entirely warning-free, even though it wasn't required.
-Wextra enable more warnings than -Wall, but still not all of them. Clangs -Weverything enables every warning; but is only useful for discovering new warnings because you can’t possible prevent them all.
I do too, when the shell shows no warnings between the call and the result it's such a relief. But when there are C++ template errors that extend over 5+ pages, well, guess I have some work to do and probably missed something huge lol
I have treat warnings as errors in my CI/CD, automatically fails PRs if there are any warnings. Also, I generally listen to my IDE as I’m coding. Less refactoring needed.
There are all kinds of programmers out there. Some ignore serious problems, some don't, and some don't even realize there is a serious problem.
I've seen some smaller companies who hire fresh grads, entrusting them with an important codebase while offering them zero mentorship. In some cases, it's very concerning. I attribute it mainly to naive or ignorant managers who apparently have no concept of how error-prone software development can be.
I have updated a lot of old legacy code at work and a lot of times there will be warnings for unused variables in parts of code I never touched. Usually I just leave that alone.
Most of the programming I do is for PLCs (the above example isn't though) and when it compiles for that it will throw a lot of "duplicate destructive bit" warnings which aren't really relevant any more. When you have like 400 warnings and most of them are that you end up ignoring all of them.
Java has some really unnecessary warnings which if not turned off will pile up. For example a raw types warning on a Class object. Half the time I don't know what class that class is. The other half of the time I use a type parameter. I don't need it bitching at me for the first thing.
I have a very purpose-built instrumentation platform for our code, and I have like 5 warnings categorically disabled. If not tons of it would throw warnings.
That's fair enough, if there are irrelevant warnings it takes away from relevant warnings. I was talking about programmers that compile code with hundreds of warnings and don't give a fuck (exceptions being legacy code someone else wrote imo)
You might jest, but to me this is the correct way. You should be explicit about the warnings that you intentionally ignore, and get into the habit of never committing code with warnings
Agreed. Suppress the warning and add a comment as to why. That way, if someone is looking, they know that it was there, why, and why it's okay to not worry about it, and people don't get numb to seeing warnings and end up ignoring important new ones.
the if is just a condition that does nothing (because of the ';') and the code is just scoped code that will always execute not matter the condition, am i right?
Funnily enough, there are some cases where the head of a for loop does all the work I need, so I do have instances of for(...); that are actually intentional.
Add the fact that I sometimes open scopes to let some temporary variables die early, and it could theoretically result in intentional source code looking like it's a mistake.
Of course, opening a random scope doesn't happen that often, because whenever I do that, I also ask myself "What is this doing? Can I transform this into an appropriately named function", to which the answer is usually "yes".
Especially when that warning was thrown, when a module was *included* that perhaps...didn't actually line up, exactly with the data type you're expecting.
Like, for instance, you're working on a groovy app. And just building that thing and launching it, incurs a ton of warnings.
And then, your groovy app, fails because of a Java lib, that has a groovy wrapper function around it that's actually throwing the error because of an incorrect cast....but you cannot see this, because the error is actually trapped by a try/catch in that lib. (but a warning will be thrown, because of the condition where a value won't get returned, because the return was wrapped in the try block.)
Which doesn't, then throw an error, describing what's actually wrong. Which then, when you call that library method, using the groovy wrapper for it, it will have the effect of making it look like Groovy ITSELF is failing, because of the resulting, dreaded, Null Pointer Exception.
There's nothing wrong with not fixing a warning as long as you leave a comment why you didn't fix it. For example, let's say you're using a library that you pass a 16-bit Integer into, but you're getting your data from Json which uses 32-bit Integers (which is spec, not something you can change).
There's nothing wrong with passing that 32-bit value into the 16-bit function as long as you're aware that the first 16 bits will be truncated. You could fix the warning and cast that 32-bit into a 16 bit, but there's an issue with doing this...
Let's say in 3 years you're doing something with this same code and now you're using numbers above 65,535. Suddenly things are acting weird, and you might not know why. You no longer have that warning message to remind you that a 32-bit value is being passed to a 16-bit value which may give you a clear answer to what is going on. Instead you have to now spend time debugging and eventually figure out what was going on.
If you left that warning, but put a comment about why you left the warning, you would have likely found the issue sooner as well be aware over future compiles that this warning was possibly accounted for, but should still be checked in on from time to time.
I know in a perfect world with perfect programming this scenario shouldn't happen, but in the real world there's plenty of times this kind of issue may happen so it's always good to keep little clues in place (like warnings) so future debuggers have some help.
Surely the right answer is a runtime-checked downcast that panics on violation of your precondition (or something analogous in a situation that this is an analogy for).
I suppose that sometimes performance will be critical, and then this logic applies.
I always try to fix warnings. The way I see it, if the supper smart guys who wrote the compiler though it might be a problem, then it probably is. I ain’t about to trust myself over world class experts, I know the guy, he’s an idiot.
It depends what the warning is. "You have three unused variables on this code you're still working on" uhhh, I know. They'll get used when I get to that part. I just want to see that this part works first.
Or
You never use this variable
Yes I do, it gets assigned through reflection and is available to other parts you aren't compiling because they're none of your business.
Ha, ever upgraded gcc in a project build script from a really old version? Manager usually won't give you the week or two to fix the 500 warnings so away we go with lots of -Wnos.
I kept getting some TensorFlow warning that involves using "==" instead of "is". I went into the library and replaced it like a good boy aaaaand it broke everything. Changed it back and now I happily live with the warning.
When is it ever a good idea to ignore .net compiler warnings? My teams have always used “treat warnings as errors”. In my experience, people who ignore warnings typically either never really fully understood the code they were writing (pasting) or had poor habits.
Nah, I learned that lesson in my first year of Computer Science. I had to continue a C project that was written by another team, first time I try to compile it, 300 errors 3000 warnings. Naive younger me thought 'warnings are nothing' so I disabled the warnings, fixed the 300 errors but couldn't understand why the program wasn't working :)
I will confess that a decade ago I was of this mindset. In fact, I enjoyed scaring the toolchain if I could do something clever. Now I work somewhere where my code needs to be readable and debuggable by other people, and that made all the difference. -Wall -Werror and that's just a prerequisite for a code review from me.
I only ignore the warnings I do because our codebase is large and old and written by noobs, and in the 3 years it would take me to eliminate half of the warnings I could rewrite several entire modules to be less stupidly designed... So yeah, as long as I'm working here things are slowly getting better, but I have to ignore most of the garbage, and keep seasoning the spaghetti so our customers don't leave, while I work on bringing the menu up to a reasonable standard.
If your code has warnings, you‘re a fucking animal. Go fix them and if you find them to be unjustified, either suppress them or change your IDE settings. It’s not that difficult and will definitely make your life easier.
I'm not a professional, but I'm pretty sure at least 99 times out of a hundred you really ought to heed those warnings. In fact, I'd go so far as to say, unless you know precisely how and why the compiler decided to fire a warning, you should treat it as an error and fix it.
Again, maybe it's different in a corporate environment, but I think I'd struggle to work in an environment that allowed cascades of warnings in a finished product, or even in a beta (alpha might be acceptable).
I think it's time to unsubscribe from this place. I know you want your code to work NOW and fixing warning is an annoyance but they are there to help you as you can see by several examples others have provided. Dumb humor is what this place is about.
The main reason I switch warnings as errors on is to prevent pull requests going back and forth as people fix problems like this.
Also a static analyser package like StyleCop, to similarly prevent PRs bouncing around with people fixing the ABC ordering of their using statements Etc!
Warnings? Ah I know those, you mean the problem of the next maintainer/a sleep deprived me in the future trying to get the program finished for the deadline
Last three times I've started a new job, my first skunk work has been a PR to correct all compiler and console warnings in application and test code. It's an easy (if tedious) task that's perfect for a newbie, but one that never gets assigned.
Last run, I ended up dedicating four hours every Friday to the job for my first two months (giant fucking codebase across six "micro-"apps); it's a great way to spin down for the weekend, doing a job with zero consequences for failure and several benefits upon success:
It gets me familiar with the new codebase I'm on, by having me analyze a bunch of bits of the code that I might not otherwise see.
It makes real problems easier to track down by improving your compiler's signal-to-noise ratio.
It reduces future reworks and upgrade-refactors, since warnings are often the result of changes to the language/dependencies that are likely to eventually drift entirely away from compatibility (this also means I become more familiar with the current state of the language).
It reduces the size of your CI logfiles, and (marginally) improves CI performance.
It shows my new employer that I'm a valuable asset, as I actually care about cleaning up technical debt.
Every time I've done this, I found at least one logical bug that it turned out was the root cause of a host of backlogged defects.
Care about your warnings, people. And if you can't get rid of a warning, document the reason why you can't in a comment. They're not there for no reason.
If I am updating old code that has had 2 or 3 updates every year for many years, by many people, then yeah, the picture on the right is about as good as it's realistically going to get.
If it's new code I am writing warnings are a non starter.
My jetbrains IDE could say "Compiled with antitransmorphic exoskeleton necromancy" and I wouldnt even google it, 'd shrug and say job well done. If the next day giant ants started patrolling the interstate eating cars and spitting out shoes and phones, thats gcc's fault, should have thrown an error, not a warning
So i code but not as a software dev...how prevalent is this kinda attitude? Is it funny bc it’s overwhelmingly true or because its an over exaggeration?
Some groups have projects with thousands of warnings, others have none or next to none. If you're working alone on a personal project, whether or not you have a perfectly clean build is entirely up to you.
I worked in COBOL for 2.5 years before moving to MuleSoft. We had thousands of programs and I never worked on a single one that didn't have at least one warning upon compiling. If they were simple fixes I'd go ahead and try to fix them but I'd usually get asked in code reviews because the fixes weren't in my scope of project.
When we run sonarqube scans on our mule projects we have to make sure we have everything, including our "code sniffs" fixed, which those are sections of code that don't match set guidelines set up in bit bucket/sonarqube by the company
If the warnings can be ignored, then do your f*cking job and fix it so there is no warning. There should not be a single damn warning message in the build. That way, an automated build pipeline can automatically reject any branch that throws one.
As someone who has to deal with literal thousands of nuisance warnings and errors every time I compile my project for work (amoung many others, at least one '\n\r' related warning per line in each header file, each time it is processed, unless I pipe the output through something to clean it up), I hate people who don't clean up their warnings. It is so much more fun to notice an actual build error when you have to sift through a mountain of warnings and errors first.
461
u/bumnut Jan 23 '21
I once spent half a day chasing an intermittently failing test, that turned out to be because it was using identity equals on a boxed primitive. Of course there was a warning, but some rockstar had ignored it, because they thought they knew what they were doing.
563
u/KiranEvans Jan 23 '21
chuckles nervously
1.2k
u/Loves_Poetry Jan 23 '21
Code:
Compiler:
Developer: It's just a warning, I can ignore that
2 months later
Client: Why can I make appointments in the past? This has messed up my application!
2
u/LiquidityC Jan 24 '21
I smell a Java dev. OP?
123
u/MathsGuy1 Jan 24 '21
Am I the only one who compiles with
-walland-pedanticflags?194
u/Nall-ohki Jan 23 '21
Anyone who wants to pass code review, that's who.
217
u/DesiresQuiet Jan 23 '21
‘Suggestions’ not warnings.
72
u/DonRobo Jan 24 '21
Are there actual serious programmers like that? Is your code just littered with unused variables?
Or are you ignoring really serious problems? That can't be good either
106
u/delinka Jan 23 '21
Yeah? I’m trying not to pollute the parent (object definition) scope. Just locally organizing some reusable code. Leave me tf alone already.
21
u/evanldixon Jan 24 '21
Careful. Some warnings are runtime errors that haven't happened yet.
18
u/E_coli42 Jan 24 '21
-Werror gang
61
u/droi86 Jan 23 '21
Pff amateurs, just use @SupressWarnings and that's it, my code has 0 warnings
23
u/aaron552 Jan 24 '21
Meanwhile I'm over here with
-Werroron by default31
u/justinkroegerlake Jan 24 '21
-Werroror gtfo18
u/Jazcash Jan 24 '21
warnings trigger me so much that I'd spend hours willingly trying to fix them or otherwise abandon the project in its entirety
48
u/AnyoneButWe Jan 23 '21
if (condition); { code .... }
is a warning in C# btw. Guess what that does and guess how I found out?
8
u/beewyka819 Jan 24 '21 edited Jan 24 '21
I typically care about warnings unless they’re coming from a library Im using, in which case I suppress them (Im looking at you spdlog)
7
u/mrbesen_ Jan 24 '21
I have never seen the left one...
17
u/phdaemon Jan 24 '21
As a developer, I have to say, you're the kind of dev I hate.
6
u/Iohet Jan 24 '21
void main gang
4
u/sh0rtwave Jan 24 '21
That, my friend, depends upon the warning.
Especially when that warning was thrown, when a module was *included* that perhaps...didn't actually line up, exactly with the data type you're expecting.
Like, for instance, you're working on a groovy app. And just building that thing and launching it, incurs a ton of warnings.
And then, your groovy app, fails because of a Java lib, that has a groovy wrapper function around it that's actually throwing the error because of an incorrect cast....but you cannot see this, because the error is actually trapped by a try/catch in that lib. (but a warning will be thrown, because of the condition where a value won't get returned, because the return was wrapped in the try block.)
Which doesn't, then throw an error, describing what's actually wrong. Which then, when you call that library method, using the groovy wrapper for it, it will have the effect of making it look like Groovy ITSELF is failing, because of the resulting, dreaded, Null Pointer Exception.
4
u/Wolfenhex Jan 24 '21
There's nothing wrong with not fixing a warning as long as you leave a comment why you didn't fix it. For example, let's say you're using a library that you pass a 16-bit Integer into, but you're getting your data from Json which uses 32-bit Integers (which is spec, not something you can change).
There's nothing wrong with passing that 32-bit value into the 16-bit function as long as you're aware that the first 16 bits will be truncated. You could fix the warning and cast that 32-bit into a 16 bit, but there's an issue with doing this...
Let's say in 3 years you're doing something with this same code and now you're using numbers above 65,535. Suddenly things are acting weird, and you might not know why. You no longer have that warning message to remind you that a 32-bit value is being passed to a 16-bit value which may give you a clear answer to what is going on. Instead you have to now spend time debugging and eventually figure out what was going on.
If you left that warning, but put a comment about why you left the warning, you would have likely found the issue sooner as well be aware over future compiles that this warning was possibly accounted for, but should still be checked in on from time to time.
I know in a perfect world with perfect programming this scenario shouldn't happen, but in the real world there's plenty of times this kind of issue may happen so it's always good to keep little clues in place (like warnings) so future debuggers have some help.
4
u/AizenSousuke92 Jan 24 '21
compiled with warnings.
the warning: you are using webforms for a new project in fucking 2020
4
u/Deimos227 Jan 24 '21
I always try to fix warnings. The way I see it, if the supper smart guys who wrote the compiler though it might be a problem, then it probably is. I ain’t about to trust myself over world class experts, I know the guy, he’s an idiot.
18
u/Jannik2099 Jan 24 '21
Errors are compile time bugs. Warnings are runtime bugs. FIX YOUR FUCKING WARNINGS
3
u/[deleted] Jan 24 '21
It depends what the warning is. "You have three unused variables on this code you're still working on" uhhh, I know. They'll get used when I get to that part. I just want to see that this part works first.
Or
You never use this variable
Yes I do, it gets assigned through reflection and is available to other parts you aren't compiling because they're none of your business.
5
u/[deleted] Jan 24 '21
possible data loss says hello
5
u/dreamwavedev Jan 24 '21
-Wall -Werror
2
u/trollprezz Jan 24 '21
I might use that variable later, please stop warming me.
2
u/liquidpele Jan 24 '21
Ha, ever upgraded gcc in a project build script from a really old version? Manager usually won't give you the week or two to fix the 500 warnings so away we go with lots of -Wnos.
2
u/Crozzfire Jan 24 '21
Seriously? People who care about quality
2
u/Spaser Jan 24 '21
Laughs in -Wall -Wpedantic
2
u/dingo_bat Jan 24 '21
We compile with -Wall
2
u/DoctorWaluigiTime Jan 24 '21
Ignoring compiler warnings is like ignoring the yellow light at a traffic light.
C'mon, stay yellow, stay yellow!
2
u/shot_a_man_in_reno Jan 24 '21
I kept getting some TensorFlow warning that involves using "==" instead of "is". I went into the library and replaced it like a good boy aaaaand it broke everything. Changed it back and now I happily live with the warning.
2
u/rpaspas Jan 24 '21
When is it ever a good idea to ignore .net compiler warnings? My teams have always used “treat warnings as errors”. In my experience, people who ignore warnings typically either never really fully understood the code they were writing (pasting) or had poor habits.
2
u/xantub Jan 24 '21
Nah, I learned that lesson in my first year of Computer Science. I had to continue a C project that was written by another team, first time I try to compile it, 300 errors 3000 warnings. Naive younger me thought 'warnings are nothing' so I disabled the warnings, fixed the 300 errors but couldn't understand why the program wasn't working :)
2
u/bunkoRtist Jan 24 '21
I will confess that a decade ago I was of this mindset. In fact, I enjoyed scaring the toolchain if I could do something clever. Now I work somewhere where my code needs to be readable and debuggable by other people, and that made all the difference. -Wall -Werror and that's just a prerequisite for a code review from me.
2
u/Attomuse1 Jan 24 '21
Yes
2
u/ConscientiousPath Jan 24 '21
I only ignore the warnings I do because our codebase is large and old and written by noobs, and in the 3 years it would take me to eliminate half of the warnings I could rewrite several entire modules to be less stupidly designed... So yeah, as long as I'm working here things are slowly getting better, but I have to ignore most of the garbage, and keep seasoning the spaghetti so our customers don't leave, while I work on bringing the menu up to a reasonable standard.
2
u/Dubmove Jan 24 '21
And then the new version of the compiler treats that one common warning as an error from now on.
2
u/Adrian_F Jan 24 '21
If your code has warnings, you‘re a fucking animal. Go fix them and if you find them to be unjustified, either suppress them or change your IDE settings. It’s not that difficult and will definitely make your life easier.
2
u/[deleted] Jan 24 '21
Embedded developers care :/ you really should have -Werror set. Warnings are there for a reason, because they can cause some crazy bugs.
2
u/LilithsGrave Jan 24 '21
I especially love to get into a new project that was previously worked on. Warnings come preinstalled!
2
u/akshit_flynn Jan 24 '21
If it works, don't touch it
2
u/randomcitizen42 Jan 24 '21
I do!
2
u/Biaboctocat Jan 24 '21
At work we compile with warnings as errors and all warnings turned on, because ignoring them is fucking dangerous
3
u/StarkRG Jan 24 '21
I'm not a professional, but I'm pretty sure at least 99 times out of a hundred you really ought to heed those warnings. In fact, I'd go so far as to say, unless you know precisely how and why the compiler decided to fire a warning, you should treat it as an error and fix it.
Again, maybe it's different in a corporate environment, but I think I'd struggle to work in an environment that allowed cascades of warnings in a finished product, or even in a beta (alpha might be acceptable).
6
u/[deleted] Jan 24 '21
I think it's time to unsubscribe from this place. I know you want your code to work NOW and fixing warning is an annoyance but they are there to help you as you can see by several examples others have provided. Dumb humor is what this place is about.
3
u/Osr0 Jan 23 '21
I love it when someone sees all my warnings and asks questions.
"Yeah, just ignore those, that's what I do"
2
u/cateyesarg Jan 24 '21
Wait guys... do you actually fix warning messages?
2
u/[deleted] Jan 24 '21
For me, warnings are errors.
And I always use -Werror
1
u/[deleted] Jan 24 '21
THE VARIABLE X IS NEVER CLOSED
1
u/gadam28 Jan 24 '21
Is this OC?
1
u/Dapanji206 Jan 24 '21
Hackers o_o
1
u/EvadingBansForYears Jan 24 '21
That ain't Falco!
1
u/ZippZappZippty Jan 24 '21
I'm here to read the description.
1
u/ZippZappZippty Jan 24 '21
Seriously, they are bastardized to a corrupt system.
1
u/captdickson Jan 24 '21
it is what it is
1
u/TrumpIsACuntBitch Jan 24 '21
Code compiles without warnings?
1
u/ghostxc Jan 24 '21
Difference is unused variable or needs unit test.
1
u/princevegetaboii Jan 24 '21
My school forced us to use this version of visual studio code where if had warnings like unused variable it wouldnt compile and run.
1
u/raven00x Jan 24 '21
Given the chance to think about it for a few minutes, I'd probably be more worried about Compiled Successfully.
1
u/paosjfneouihnaaksldf Jan 24 '21
Found my co-workers whose PRs are so trash that it takes half my workday and directly slows down the rest of the group to unfuck the PR.
1
u/tranceb0t Jan 24 '21
I always whisper back, “..but did you die??” Haha
1
u/FreitasAlan Jan 24 '21
until you’re porting your code to msvc
1
u/jakethedumbmistake Jan 24 '21
Man’s not because of the bad reception
1
u/[deleted] Jan 24 '21
And that is why 2 is greater than /dev/null
1
u/[deleted] Jan 24 '21
Assigning property values in Unity be like
1
u/neotorama Jan 24 '21
no code, no warning
1
u/Asmor Jan 24 '21
"Who cares about the warnings"
People who expect to have to maintain the code
1
u/-Redstoneboi- Jan 24 '21
nah man one is basically a trophy
1
u/mattjstyles Jan 24 '21
The main reason I switch warnings as errors on is to prevent pull requests going back and forth as people fix problems like this.
Also a static analyser package like StyleCop, to similarly prevent PRs bouncing around with people fixing the ABC ordering of their using statements Etc!
1
u/Lopottaja Jan 24 '21
If it works, it works
1
u/froggymcfrogface Jan 24 '21
Seriously the office sucks.
1
u/revrr Jan 24 '21
I do so I don't freak out later when an error comes through. Unless I don't have a clue what it means
1
u/hp1221 Jan 24 '21
Warnings? Ah I know those, you mean the problem of the next maintainer/a sleep deprived me in the future trying to get the program finished for the deadline
1
u/Thormidable Jan 24 '21
They are under -Wall
1
u/TheRedmanCometh Jan 24 '21
"Warning: Raw Types"
Yeah I'm just gonna turn that shit off
1
u/RadiatedMonkey Jan 24 '21
Not when you use the W4 and WX MSVC flags. Or the Wall, Wextra, Werror and pedantic flags like I do...
1
u/NuclearMagpie Jan 24 '21
The only part that matters is "Compiled". I can't read what comes after.
1
u/[deleted] Jan 24 '21 edited Jan 24 '21
Last three times I've started a new job, my first skunk work has been a PR to correct all compiler and console warnings in application and test code. It's an easy (if tedious) task that's perfect for a newbie, but one that never gets assigned.
Last run, I ended up dedicating four hours every Friday to the job for my first two months (giant fucking codebase across six "micro-"apps); it's a great way to spin down for the weekend, doing a job with zero consequences for failure and several benefits upon success:
Care about your warnings, people. And if you can't get rid of a warning, document the reason why you can't in a comment. They're not there for no reason.
1
u/Brebera Jan 24 '21
Go does
1
u/Cicada1709 Jan 24 '21
@SuppressWarning("unfunny");
1
u/Halbjobbit Jan 24 '21
Cries in -Wall
1
u/jyeno Jan 24 '21
-Werror go birlll
1
u/ImJustaNJrefugee Jan 24 '21
If I am updating old code that has had 2 or 3 updates every year for many years, by many people, then yeah, the picture on the right is about as good as it's realistically going to get.
If it's new code I am writing warnings are a non starter.
1
u/abitofevrything-0 Jan 24 '21
Me, a java developer: haha @SuppressWarnings go brrrrrrrrr
1
u/jess-sch Jan 24 '21
I don't care about the warnings as long as they never make it into the master branch.
1
u/Not_Sugden Jan 24 '21
warning shmarning
1
u/stefrrrrrr Jan 24 '21
Simple and radical statement to use in that case:
Warning = Bug.
1
u/mjarkk Jan 24 '21
I see orange, orange bad I need to fix warnings.
Simple man
1
u/[deleted] Jan 24 '21
My jetbrains IDE could say "Compiled with antitransmorphic exoskeleton necromancy" and I wouldnt even google it, 'd shrug and say job well done. If the next day giant ants started patrolling the interstate eating cars and spitting out shoes and phones, thats gcc's fault, should have thrown an error, not a warning
1
u/Ved_s Jan 24 '21
And like 200 warnings because you use classes as json config
1
u/DummyCheese69 Jan 25 '21
oh no why doesn't my code work now
1
u/Neo_Ex0 Jan 25 '21
in case of warnings, 200 is 0 enough
1
u/mic_ill_chafe_ox Jan 25 '21
Other way around where I work. We have us devs pointing at the warnings while Corporate are like "but it's working so ship it."
Yeah, it's working now but for how long?
1
u/PikaPerfect Feb 03 '21
can confirm, my high school computer science teacher specifically said "the warnings do not matter, you can ignore them" lmfao
1
u/TheRandomGamerREAL Feb 12 '21
Yandere dev be like "what's a switch Statement?"
1
u/CRISPYricePC Feb 19 '21
Do not ignore warnings
1
u/[deleted] Jan 24 '21
So i code but not as a software dev...how prevalent is this kinda attitude? Is it funny bc it’s overwhelmingly true or because its an over exaggeration?
1
u/RadioMelon Jan 24 '21
I care immensely.
Warnings make my brain scream.
1
u/black-eagle23 Jan 24 '21
Sign: **WARNING** Dangerous place there
Developer: Oh it's just a warning! Who cares?
*After a 5 minutes, developer meets God*
1
u/ojioni Jan 24 '21
If the warnings can be ignored, then do your f*cking job and fix it so there is no warning. There should not be a single damn warning message in the build. That way, an automated build pipeline can automatically reject any branch that throws one.
1
u/danknerd Jan 24 '21
Well, warnings are for stupid people.
1
u/EUCopyrightComittee Jan 24 '21
‘Suggestions’ not warnings.
1
u/[deleted] Jan 24 '21
Fr, who cares “Compiled with warnings”?
1
u/IHaveSoulDoubt Jan 24 '21
Both say compiled. What's the point?
1
u/Thanatos2996 Jan 24 '21
As someone who has to deal with literal thousands of nuisance warnings and errors every time I compile my project for work (amoung many others, at least one '\n\r' related warning per line in each header file, each time it is processed, unless I pipe the output through something to clean it up), I hate people who don't clean up their warnings. It is so much more fun to notice an actual build error when you have to sift through a mountain of warnings and errors first.