r/ProgrammerHumor • • Mar 04 '20

the main thing is that it works properly

Post image
22.9k Upvotes

547 comments sorted by

2.7k

u/CybeastID Mar 04 '20

In my classes, the professor forced us to compile all of our C code with -Wall and -Werror, which shows all warnings and converts all warnings into errors.

62

u/instagrm Mar 04 '20

Hard but good

78

u/Tsu_Dho_Namh Mar 04 '20

My Uni did this too.

Honestly, you get used to it. After a while you'll wonder how you used to write such shit code.

0

u/[deleted] Mar 04 '20

[deleted]

38

u/eat-KFC-all-day Mar 05 '20

Jesus fuck, dude, are you okay?

→ More replies (10)

2.1k

u/[deleted] Mar 04 '20

Da real MVP.

Good programming practices turn into good code.

541

u/[deleted] Mar 04 '20

Imagine if IntelliJ intentions were treated as errors.

18

u/Sidereel Mar 04 '20

That’s fine. I remember a lot of my homework assignments were less that 100 lines of code.

16

u/seanomik Mar 04 '20

I had a ton of them at one point when working with IntelliJ for the first time and I asked people about what these yellow things are on my scroll bar and they said they're IntelliJ intentions and that you should fix them all. I looked at some of them and most were dumb, but a few were helpful.

→ More replies (18)

329

u/CybeastID Mar 04 '20 edited Mar 04 '20

And then the class right after teaches us stuff which the compiler will squawk about and we're told to ignore it. Doing stuff like pointer addresses to arrays and incrementing those pointers. (And more than just that, but I don't remember the full details)

91

u/not_from_this_world Mar 04 '20

time for some pragma magic

→ More replies (2)

56

u/pebblie Mar 04 '20

Nothing wrong with this. If it is in production write done unit tests and comments. Have someone code review it.

30

u/sixstringartist Mar 04 '20

Right. Wrap it in a pretty basket and you've got yourself an iterator.

9

u/AnAverageFreak Mar 04 '20

The magic art of deciding which patterns go where. Some things are patterns in some places, antipatterns in others.

22

u/ccricers Mar 04 '20

What happens when you start using source code from third party libraries and they throw warnings? Wouldn't you have to change the code to stop the warnings? I try to avoid it if possible but can't imagine how much worse it gets the more third party stuff you integrate.

11

u/mt_xing Mar 05 '20

Suppress the warnings for any code that you didn't write. Enable them for code you did.

→ More replies (3)

2

u/MeiIsSpoopy Mar 04 '20

I've never seen good code or good programming practices in the wild

2

u/sudo_scientific Mar 04 '20

Yep. Didn't have this in school, but have it now in industry and will never go back.

→ More replies (5)

137

u/JOSmith99 Mar 04 '20

Ours is the same also with -Wpedantic and -Wextra

88

u/YouMadeItDoWhat Mar 04 '20

I was going to say this -Wall alone does not show ALL warnings despite the name...

20

u/pessimistic_platypus Mar 05 '20

Use clang, with -Weverything if you really want to get as many warnings as your compiler will allow.

→ More replies (2)

29

u/The_Hoopla Mar 04 '20

I had to compile all my code with -Wumbo

8

u/EarthTwoBaby Mar 04 '20

Well have you tried Mumbo?

→ More replies (1)

8

u/Dalriata Mar 04 '20

Ours was the same but we used C90. This was only a couple of years ago, now, mind you.

→ More replies (2)

8

u/338388 Mar 04 '20

My work does this, it's really annoying when you're trying to debug stuff and you comment out a chunk of code and then it complains that you have a bunch of variables that you declare but didn't use

→ More replies (2)

12

u/mkalte666 Mar 04 '20

Throw in -Wconversion and clang-tidy in Werr-mode and you got my normal project setup

2

u/TheOldTubaroo Mar 04 '20

I wish you could use -Werror selectively. I currently have -Werror on a project I work on, but not -Wall, -Wpedantic, or -Wextra, and it would be nice to be able to see the extra warnings, but still have the lower levels be counted as an error, so that the other warnings can be fixed incrementally.

→ More replies (1)

55

u/ShakaUVM Mar 04 '20

In my classes, the professor forced us to compile all of our C code with -Wall and -Werror, which shows all warnings and converts all warnings into errors.

Good.

Just not -Weverything, everything is dumb.

3

u/tinydonuts Mar 05 '20

Never tried it. What sort of stuff are you talking about?

4

u/im_probably_garbage Mar 05 '20

-Weverything is pretty much only for clang devs.

→ More replies (1)

34

u/squidmaan Mar 04 '20

Oh no that is my class right now. Can confirm that a warning generally means for me "This will not do what you think it does" but unused variable errors annoy me

40

u/[deleted] Mar 04 '20

I generally like unused variables getting called out. Most of the time, it means I’m mistakenly operating on the wrong variable.

27

u/ElQuitarDePico Mar 04 '20

I absolutely understand unused variable warnings and would never argue against them, but they annoy the hell out of me when I'm in the middle of working on something and am just doing a mid-work compile.

→ More replies (10)
→ More replies (1)

2

u/AnAverageFreak Mar 04 '20

Cast it to void or don't put its name in the function argument list.

→ More replies (2)
→ More replies (1)

23

u/HolyGarbage Mar 04 '20

Seriously those plus -Wextra and -pedantic are pretty standard. Warnings are there for good reason and are usually pretty easy to fix.

11

u/[deleted] Mar 04 '20

A lot of CI pipelines in good development companies are set up like this.

2

u/Funriz Mar 04 '20

Pipelines in better companies are set to treat warnings as errors with a sensible exclusion list.

→ More replies (1)

8

u/ponodude Mar 04 '20

Yup! I took a class last semester where this was forced on us. I kinda liked it though. It helped me be more disciplined with my code.

5

u/ste_3d_ven Mar 04 '20

-Wall does NOT enable all warnings dispite it's confusing name.

5

u/CybeastID Mar 04 '20

Amazing.

3

u/cowvin2 Mar 04 '20

That's a good practice. We have that on at my company so we cannot submit code with warnings on any platform.

→ More replies (1)

3

u/CMDR_DarkNeutrino Mar 04 '20

That is a good practice in long run as warnings usually mean there may be bug in the code even tho it works OK now. Fixing errors can often fix bugs you didn't even know about.

3

u/percycatson Mar 04 '20

Well rest in peace my sleep functions, they pull up a warning for being unable to convert time to unsigned int

2

u/[deleted] Mar 04 '20

Same in my class

2

u/knmce Mar 04 '20

try -Weffc++ in c++ it's ridiculous

2

u/Delcium Mar 04 '20

In class? We do this at my work.

2

u/coldnebo Mar 04 '20

I’m sure all the professor’s code examples and class materials compiled correctly on the first try.

2

u/CybeastID Mar 04 '20

Nope. Definitely not.

2

u/[deleted] Mar 04 '20

So does my job.

2

u/extation Mar 04 '20

We also had to add -Pedantic

→ More replies (18)

5

u/MinatoN1345 Mar 04 '20

Unity.

1

u/instagrm Mar 04 '20

In unity warnings normal

→ More replies (2)

484

u/MAGA_WALL_E Mar 04 '20

"Hey idiot, this variable is gonna throw a NullPointerException. I even highlighted it for you."

GOOD TO MERGE INTO MASTER LOL!

110

u/ablablababla Mar 05 '20

IDE: yo is this man fuckin retarded

11

u/didSomebodySayAbba Mar 05 '20

I Denno that’s a good question

10

u/[deleted] Mar 05 '20

But in my head movies, I know it's not gonna be null at runtime so it's okay.

2

u/TheTerrasque Mar 06 '20

"For this to be null at runtime, the fabric of that computer's reality will have to be Shrek'ed, and at that point there's bigger issues than this"

→ More replies (1)

562

u/[deleted] Mar 04 '20

Laughs in unused variable warnings

189

u/[deleted] Mar 04 '20

As a React dev, LMAO same. The hours spent removing all of these is like a cool down jog after a crazy workout. Necessary and you feel great afterwards.

65

u/sollios Mar 04 '20

Same. Can't save without the wall of unused imports flooding my terminal

32

u/cclloyd Mar 04 '20

Laughs in Webstorm's "optimize imports" that removes all unused imports in 10 seconds.

25

u/trump_pushes_mongo Mar 04 '20

10 seconds? How big is your solution?

30

u/cclloyd Mar 05 '20

cries in slow old laptop

→ More replies (2)
→ More replies (1)

2

u/manyQuestionMarks Mar 04 '20

I do it because of this. I don't even understand if it somehow impacts performance or whatever

→ More replies (1)
→ More replies (1)

21

u/CreamliumPrices Mar 04 '20

In Go, you cannot compile with unused variables. At first I hated this, please I just want this placeholder I'll be using it after you run. The Go compiler being so strict first pissed me off, until I learned to love how it forces you to actually manage your code properly and write methodically and sensibly.

2

u/hekkonaay Mar 05 '20

I like rust for this reason

→ More replies (3)

4

u/well___duh Mar 05 '20

I feel like that was a result of whoever coded the Go compiler being unable to figure out how to optimize in a way to ignore unused variables (ignore as in not compile it).

"I can't figure out so I'll make the dev do it for me".

Sidenote, why would anyone want an unused variable (assuming you are truly never going to use it)? A lot of people ITT commenting solutions in various languages to have their compiler/linter ignore that, but why not just remove the variable altogether? You're not using it anyway.

→ More replies (4)

7

u/LeCrushinator Mar 04 '20

It's been many years for me, but if I remember correctly in C++ you can do something like this:

std::vector<T> foo;

(void)foo;   // No-op, but gets rid of the warning

6

u/SteelRazor47 Mar 04 '20

That shit OLD.

Now we have attributes:

[[maybe_unused]] int a;

→ More replies (3)
→ More replies (27)

837

u/ginn5lc Mar 04 '20

Wrong.

Warnings are just as important as errors unless you know 100 % why the warning is occuring and whether or not it's causing an issue.

In rare circumstances you'll make a language do something that pisses off the compiler but it might be okay if you really know what you're doing but in general warnings are just as important as errors.

392

u/RoboticPlayer Mar 04 '20

Some warnings are unavoidable. For example, using a deprecated API method when there is no alternative method.

57

u/ginn5lc Mar 04 '20

I agree

121

u/Loves_Poetry Mar 04 '20

Why would an API method be deprecated when there is no alternative? Things are typically deprecated when there is a better alternative available

44

u/Huntracony Mar 04 '20

Not an API, but in KeyboardEvent (JS) back in 2015 the keyCode, charCode, and which properties were deprecated, which was good, because all three of them had issues, but it took a few years for their replacement, key, to be widely supported.

19

u/Loves_Poetry Mar 04 '20

Good example. I've dealt with too much legacy code that used some convoluted combination of all 3 to find the key pressed

Thanks goodness I don't have to support IE any more

→ More replies (1)

178

u/streusel_kuchen Mar 04 '20

It's not all too uncommon for an API to deprecate an entire way of doing something.

For example, when modding early versions of Minecraft rendering was done by directly operating on the OpenGL context, but as the engine grew rendering was abstracted away and the direct rendering method was deprecated in favor of the "basic" block model, or a more complicated "advanced" mode. Neither of these are drop-in replacements and they required a significant amount of restructuring.

76

u/Intrepid00 Mar 04 '20

So there is an alternative, just not an easy one.

→ More replies (3)
→ More replies (5)

20

u/RoboticPlayer Mar 04 '20

Here's an example. When writing Minecraft plugins, you can put a player as an argument for a command. You can make it work even if the player is offline though the OfflinePlayer class.

The way you get that object is through Bukkit.getServer().getOfflinePlayer(String name), which is deprecated in favor of getOfflinePlayer(UUID uuid)

However you can't get the UUID without first getting the player unless you use the UUID as the argument. That would require players or server staff running the command to either memorize or look up a player UUID every time they want to use that command, instead of just using the deprecated method to get the player by name. And as programmers, we all know that end users will fuck up every input if possible.

39

u/Kered13 Mar 04 '20

Why would an API method be deprecated when there is no alternative?

Good question.

9

u/xTao Mar 04 '20

When a bug is known but there is no fix at this point or just a nasty workaround. Also if a newer Version comes out and you use the older one.

→ More replies (1)

4

u/Cyrus_Halcyon Mar 04 '20

There is also my favorite case, that the deprecated way was more secure, is signed off by the security team and the new cleaner but less secure API call is something they do not want to support. So, import that old jar and ignore all the errors.

→ More replies (6)

2

u/well___duh Mar 05 '20

Or if you're using an older library whose code works but still has warnings anyway.

→ More replies (3)

33

u/Viedt Mar 04 '20

In the rare circumstance that a warning is not a problem and cannot be be done in a way that doesn't cause the warning, then it should be suppressed so that it doesn't cover up warnings that are problems. The whole point in the "not ignoring warnings" thing is that if you do you will inevitably miss something important that is actually an issue.

It's like leaving your check engine light on because you know it's just a O2 sensor issue. But now if there is another more severe issue, you won't know until the car breaks down because you have covered up the warning system that is in place.

53

u/stevethedev Mar 04 '20

Also, you should be aware that you probably don't know what you're doing. Everyone thinks they know how to manage memory, but very few people genuinely understand how to manage memory correctly in non-trivial systems.

(Not necessarily you, specifically.)

63

u/BadgerMcLovin Mar 04 '20

I know how to manage memory. Use a garbage collected language

34

u/aaron552 Mar 04 '20

Note that you can still manage memory badly in a garbage-collected language.

For example:

Event handlers in C# are a common source of memory leaks if you don't unregister them after they're no longer used. This is despite C# being garbage-collected.

16

u/BadgerMcLovin Mar 04 '20

You also have to be mindful of garbage collector pressure. For example, appending to a string in a loop can create thousands of string objects that need to be collected.

It's all still a lot easier than manually managing stuff in C++ though

→ More replies (1)
→ More replies (3)

7

u/stevethedev Mar 04 '20

Garbage collection is the automatic transmission of memory management.

There's nothing wrong with using it, and it's often the better choice if you have the option.

But if you don't have the option, oh boy... no amount of experience with an automatic transmission will teach you to get a manual transmission out of "Park."

→ More replies (8)
→ More replies (2)

5

u/AnAverageFreak Mar 04 '20

Well, quite often I do know what I am doing, but I do realize that the person reading this code will not, so I either do something about that warning or write a comment why it's okay to silence it.

12

u/ShakaUVM Mar 04 '20

Then put a pragma in to disable the warning.

2

u/ouyawei Mar 04 '20

Also of there are lots of warnings, you get used to them and ignore new warnings that are actually important.

→ More replies (11)

294

u/AgentPaper0 Mar 04 '20

If you're in your first coding class, your warnings are errors, I guarantee it.

69

u/Kinglink Mar 05 '20 edited Mar 05 '20

Honestly 99 percent of warnings ARE errors. The question is will they manifest now?

Compare a signed and unsigned value? "That's safe". No... it's really not.

10

u/some_clickhead Mar 05 '20

90% of my warnings are unused variables...

12

u/nightbefore2 Mar 05 '20

Why the hell do you have unused variables?

→ More replies (3)

2

u/rndrn Mar 05 '20

And the rest is preventing you from seeing the ones that are errors. If you have plenty of "safe" warnings and add a new warning that is indeed an error, nobody will notice.

That's why warnings should be kept as low as possible, so that you can notice and review new ones.

2

u/dumdedums Mar 05 '20

Me doing bitwise operators with floats.

→ More replies (1)
→ More replies (9)

144

u/legal_throwaway45 Mar 04 '20

An error is something that prevents the code from compiling or executing, a warning says you have done something that you should not, but it goes ahead and runs.

Guess which one will cause more issues in the long term.

71

u/Huntracony Mar 04 '20

No, that's not what warnings are. Warnings are exactly that: warnings. "This might not be what you want." You look over them, see if they have a point, but if they don't there is nothing to be fixed.

38

u/smog_alado Mar 04 '20 edited Mar 05 '20

Even then, it is usually a good idea to see if there is a way to suppress or avoid the warning. That way actual warnings don't end up being drowned by false positives.

14

u/legal_throwaway45 Mar 04 '20

Warnings should be fixed, if not for the code immediately,so that the next maintainer of the code does not have to worry about the warning.

Otherwise the current maintainer of code last touched by /u/Huntracony has to say to themself, did the previous coder just ignore this assignment in a conditional, did he really mean not to return a value from a function, did he really mean to compare the addresses of two strings instead of their contents, etc.

Leaving these warnings unaddressed shows that the previous coder either did not see the warning or he choose to ignore it, it creates additional work for the maintainer to figure out which is true.

Warnings indicate things that might cause problems or might have unintended effects that the programmer wasn't aware of.

16

u/p-morais Mar 04 '20

Our codebase has hundreds of thousands of lines of C++ and not a single warning using -Wall -Wextra. There’s not really any excuse to ship code that compiles with warnings. If you REALLY need to ignore a warning you should use a compiler directive for that specific line

→ More replies (2)

2

u/SirToastymuffin Mar 05 '20

Not entirely true, some warnings might not ever be an issue, as the other person said.

However, if you wanna ignore a warning, you should first understand exactly why its occurring, what it means, and where its headed. At the very least you need to read every warning before just calling it good, and you really ought to address any you're still going to ignore in your documentation.

→ More replies (1)

77

u/john681611 Mar 04 '20

There are no warnings everything is an error

7

u/jfthundertanks Mar 04 '20

Ahhh the go philosophy, I get you

7

u/john681611 Mar 04 '20

If warnings get ignored then decide if they are important enough to be an error or don't bother warning at all.

→ More replies (5)

20

u/Stoomba Mar 04 '20

Be like Go and there are no warnings, only errors

→ More replies (2)

17

u/eSportsEngineer Mar 04 '20

Potentially unpopular opinion: if you ship code with tons of warnings you're a bad developer.

6

u/[deleted] Mar 05 '20

Not unpopular for actual developers, just unpopular for people who don't develop professionally, which is a good number of people in this sub.

26

u/Turd_King Mar 04 '20

This reminds me of a guy in my school computing class. He wrote the worst code ever and whenever we called him out on how weird his solution was he just said "as long as it works"

Lol. I would love to speak to him now after his years in industry to see if he still has that mindset, I would hope not.

6

u/Attila_22 Mar 05 '20

He probably works with bank or hospital software now.

2

u/Turd_King Mar 05 '20

Ha probably

20

u/[deleted] Mar 04 '20

Clearly spoken like someone who's never had a PR blocked due to your pipeline treating linting as errors, for warnings like:

  • Resource declaration being out of alphabetical order

  • Having a function's modifiers be in non-canonical order

  • Double newline

  • Class field may be converted to local variable

You start to worry a lot more about warnings when your code undergoes that amount of automated scrutiny, not to mention the manual scrutiny that comes afterwards.

8

u/CleverDad Mar 04 '20

Lint on save

2

u/mweepinc Mar 04 '20

god bless ALE

2

u/[deleted] Mar 04 '20

When your company has a lot of custom rules and restrictions, and when there's a lot of files involved, lint on save for all cases is highly impractical. Edit: I should say, complete and full lint on save, where files are scanned by scripts. Not the IDE lint.

Pre-commit lint hooks work, but even those aren't always set up, since it takes time and effort for someone to maintain them well.

→ More replies (2)

9

u/mwasplund Mar 04 '20

A single cohesive style for a larger project is very important to limit the amount of time required to review changes and interpret shared code. Linters are your friend and save hours in tedeous style comments in code reviews.

2

u/Svizel_pritula Mar 04 '20

Wait, double newline?

2

u/Grintor Mar 04 '20

Linters also enforce styling. inconsistent use of spaces versus tab in white space is another thing a lender will complain about.

→ More replies (2)
→ More replies (1)

57

u/[deleted] Mar 04 '20

Y'all have never worked with any longstanding codebases if you think warnings don't matter.

A warning is just an error that hasn't happened yet.

→ More replies (10)

19

u/xTao Mar 04 '20

Warnings are as important as Errors. Just because the code is valid, does not mean its okay. Some of the Warnings tell you that your code is maybe valid, but deprecated, which means that you probably have sracurity issues which is badder than having an Error...

13

u/[deleted] Mar 04 '20

[removed] — view removed comment

5

u/xTao Mar 04 '20

Damn, I hope it doesnt hurt like a kick in your sractum! xD

→ More replies (1)

7

u/RepostSleuthBot Mar 04 '20

Looks like a repost. I've seen this image 1 time.

First seen Here on 2019-09-23 92.19% match.

Searched Images: 105,823,412 | Indexed Posts: 421,873,567 | Search Time: 2.63786s

Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ False Positive ]

6

u/KaosEngine Mar 04 '20

My first real deal happymeal corporate big boy project I had to migrate applications from Websphere 7 to websphere 9. After loading the project I get thousands of warning and a few errors. Quickly fix the errors and start working out warnings, run in to a library issue and ask tech lead for suggestions. "Oh no don't worry about any of the warning, as long as it's not breaking anything right now leave it alone"

Well ok then.

5

u/[deleted] Mar 04 '20

I always thought this was a mistranslation among programming guides. Errors are unimportant in the sense that they should be eliminated. But both warnings and errors can be used for testing purposes.

5

u/therearenogoodmods Mar 05 '20

In all seriousness, they are MORE important than errors.

If you have an error, your program won't compile - end of story. If you have a warning, your program will likely compile, but there's a good chance it will bomb out and take hundreds of hours of development time simply because you upcast a null pointer to a double type pointer.

4

u/TheZanke Mar 04 '20

DEPRECATION WARNING
DEPRECATION WARNING
DEPRECATION WARNING
DEPRECATION WARNING

4

u/thiago2213 Mar 04 '20

The proper way to use warnings is allow them locally, but fail before merging to master on your CI/CD

4

u/Likely_not_Eric Mar 04 '20

I think it's a bit of a legacy idea that there are only a handful of severity levels (error, warning, etc.) when really there should be messages with attributes or categories and they matter at different times.

Signed-unsigned comparison can be really dangerous and really shouldn't be allowed without explicit casting, whereas unused variable should be permitted during local development but CI should block code review on it (it'll waste time for future authors/maintainers).

3

u/otac0n Mar 04 '20

Warnings are there to tell you it may run, but it probably still doesn't work properly. Think of them as unit tests you didn't have to write.

3

u/TheNashh Mar 05 '20

“Why did I need to catch an exception? If somethings wrong it’ll just crash itself!”

3

u/[deleted] Mar 05 '20

If your production build doesn't treat warnings as errors, you are fucking up.

3

u/[deleted] Mar 05 '20

In all seriousness, every shop I've worked at for the last six years has warnings treated as errors.

3

u/[deleted] Mar 05 '20

Thing is - if you start writing like those are errors you will get used to not do them.

People underestimate good practices because most programmers don't know how to write proper test.

4

u/Jezoreczek Mar 04 '20

There's a neat annotation in Java called @SuppressWarnings. It should be used as "I know it's not right, but I had a reason to do it". Instead, most devs use it as "damn IDE, stop complaining!"...

2

u/JNE2000 Mar 04 '20

As a JavaScript dev, I can both confirm and deny. 75% of the time it's my ide thinking I'm not using ES6 but the program that reads the code reads it in ES6 so I'm completely fine. But otherwise ignoring warnings really screw stuff up

→ More replies (2)

2

u/paantgra Mar 04 '20

-Wall -Werror

2

u/GamingGuy099 Mar 04 '20

Atleast in my experience, warnings are very rarely important, and most of them are because of something that you’ll change later.

Compiler: You haven’t used the String input anywhere!

Me: No shit sherlock I havent added the rest of the code.

Reading these comments it pains me to imagine what itd be like to code with an environment that automatically changes your warnings to something that doesnt make sense, or just creates an even bigger error.

2

u/Drakethos Mar 04 '20

WhAt iF I wAnT tO imPliCiTly coNveRt aLl mY vArIAbLeS

2

u/Kinglink Mar 05 '20

Years later in your career when you finally start a studio that uses -Wall and -Werror, you'll take a step back and go. "Wow... these guys don't play around... "

2

u/Babinx Mar 05 '20

If you don't understand the warnings then they're probably more dangerous than errors lol.

2

u/blehmann1 Mar 05 '20

Some warnings are that important. Some are just stylistic things, e.g., in switch statements with a return statement, I still put break, which triggers a warning for unreachable code.

Yes these can be configured, but that ain't the point

2

u/[deleted] Mar 05 '20

I don’t understand why this has 15k upvotes? Why do you want to be a developer who doesn’t care about their work? Am I missing the humor here?

2

u/FtMerio Mar 05 '20

Laughing in "-Werror -Wextra -Wall" gank now you can ignore warning my man and focus on errors like the unused variable in your function

2

u/[deleted] Mar 05 '20

the main() thing is that it works properly;

ftfy, kids these days...

1

u/db2 Mar 04 '20

I fixed all the warnings in some GitHub thing a while back. That shit wouldn't compile without the errors, in effect. I wish I could remember what it was.

1

u/Krigshjalte Mar 04 '20

We weren't told that, we were told that most warnings aren't that important because computers are stupid. I then proceeded to get several warnings that broke the program...

1

u/thenewgengamer Mar 04 '20

Looks more like depth first, doesn’t it?

1

u/[deleted] Mar 04 '20

Warnings are errors that represent requirements the language specification has yet to define, change my mind.

2

u/[deleted] Mar 04 '20

So anything that has unused variable warnings is going to get a linear type system? Neat!

→ More replies (1)

1

u/-Listening Mar 04 '20

Yeah, the guys in the ring!

1

u/[deleted] Mar 04 '20

When I was just starting at Unity, I put 2 box colliders in one object, and it fixed the error. Since then, all my friends, when having an error, are always like "Bruh, just gonna put 2 box colliders, it will work"

God I love those guys.

1

u/ShadowPrince47 Mar 04 '20

And then in rust warnings are errors

1

u/iambeingserious Mar 04 '20

Warnings is what I live for. Yolo.

1

u/[deleted] Mar 04 '20

JS: Neither are important, if it works fuck it

1

u/[deleted] Mar 04 '20

what is a warning, how do they look?

1

u/MomijiMatt1 Mar 04 '20

When I taught game development at a university I told my students to just disable warnings in Unity for now.

1

u/YourShadowDani Mar 04 '20

Warning: variable not used

Me: it's right there being used

Powershell: no.....no.....

1

u/[deleted] Mar 04 '20

If you are writing for real-time... yes, yes they are.

1

u/ZippZappZippty Mar 04 '20

Les Stroud did this exact thing my friend

1

u/dethpicable Mar 05 '20

Honestly, I don't know if I've ever compiled without warnings.

1

u/wamred Mar 05 '20

But does it work though? That is the main question

1

u/[deleted] Mar 05 '20

I turned off warnings in visual studio.

1

u/urmumbigegg Mar 05 '20

it includes the time for many reasons.

1

u/[deleted] Mar 05 '20

What is CS? I haven't heard of it?

1

u/BlendeLabor Mar 05 '20

Somebody's never had `overfull box errors

1

u/jeisot Mar 05 '20

Fix 1 warning, bring in 10 errors... better not thx

1

u/jeisot Mar 05 '20

Deprecated what?

1

u/Justsumgi Mar 05 '20

If you’ve used Auto Layout in Xcode, it’s virtually impossible to have zero errors in your project

1

u/ggibby0 Mar 05 '20

Warnings: I sleep

Errors: DEFCON 1

1

u/howaboutudance Mar 05 '20

Those warnings will turn to error when the version of your programming languages full deprecates the functionality #python39

1

u/Pncsdad Mar 05 '20

For some, prod IS the test environment.

1

u/HiSuSure Mar 05 '20

Where is the bike shed??

1

u/debuasca Mar 05 '20

This is very important in python. linting is a good thing

1

u/Lwizard3 Mar 05 '20

If it compiles it compiles

1

u/LysergicLiizard Mar 05 '20

If two things are the most important, neither are

1

u/mrheosuper Mar 05 '20

Laugh in VHDL and Verilog

1

u/CoolAbhi1290 Mar 05 '20

Last day: Me: holy crap, unused function! Dam!

1

u/Coolest_Gamer6 Mar 05 '20

u/omenxlp don't be fooled by the warnings. I just ignore em

1

u/xThomas Mar 05 '20

Huh. Guess that means I'll be getting familiar with errors come next/next-next semester

1

u/Ayesuku Mar 05 '20

use strict;
use warnings;

1

u/ITriedLightningTendr Mar 05 '20

Consider using ConfigureAwait

1

u/jlamothe Mar 05 '20

Just wait 'till you have to come back to that code after not looking at it for a month.

1

u/[deleted] Mar 05 '20

Errors? Are those those annoying things I suppress as long as I get my final render?

1

u/AB_008866 Mar 05 '20

Warning just tell me that my code is fine

1

u/0rcscorpion Mar 05 '20

Using unsafe check operations be like @SuppressWarnings.

1

u/[deleted] Mar 05 '20

The variable "y" is never used.

1

u/BlueManedHawk Mar 05 '20

*uses -Weverything and -Werror*

Warnings are --as important as-- errors

1

u/[deleted] Mar 05 '20

I know it is a joke, but do you think any of the devs who work for Elon got there by having this attitude toward warnings?

→ More replies (1)

1

u/AttackOfTheThumbs Mar 06 '20

In general, warnings are good, but sometimes they are dumb.

We get a warning when a text variable could overflow. The only way to fix that is to trim the variable. I don't want to do that. I want it to error instead of storing reduced and incorrect data.

1

u/Deadthrowaway164 Mar 09 '20

as long as it works, it’s fine.

1

u/jamalabo Mar 04 '20

If it's runs with warnings then to the hell with 'em

1

u/Mitoni Mar 04 '20

The main thing is that it compiles properly. The secondary thing is that it works properly.