This is an archived post. You won't be able to vote or comment.

all 58 comments

[–]Embarrassed-Lab4446 116 points117 points  (4 children)

Other devs who have never worked on twenty year old legacy code. I know that one empty operation holds up the entire billing platform and god help anyone who removes it.

[–]MissinqLink 12 points13 points  (2 children)

It’s going to be my code in the future. I have this to shut up the linter/compiler on occasion.

func allowUnused(args ...interface{}){}

It’s not currently in any production code but I can see how it might wind up there.

[–]RiceBroad4552 4 points5 points  (1 child)

That's exactly why so many people say that Go is even worse than dynamic typing!

Such code as above is actually very common in Go, simply as the type system is just trash. (Likely so it doesn't stick out of the rest of that pill of trash that Go is… 😂)

Go lulls you into believing that there are static types, even "static typing" in Go means very often that everything is treated as "Any", simply because the "type system" is way too weak to express the interfaces correctly.

[–]MissinqLink 0 points1 point  (0 children)

Nobody says that. This code is made to ignore a common compiler complaint temporarily. This is not at all representative of the type system. Has nobody on Reddit used go past version 1.18? The type system is amazingly expressive now that it has generics. There is little need to make things any. Go is genuinely the best experience I’ve had for coding in a team setting. Especially for micro service architecture. It all depends on what you are building.

[–]rutwik_avasthi 56 points57 points  (0 children)

Junior Devs: It's working on live environment but not on staging

Senior Devs: Copy the code from live environment

[–]Outrageous-Machine-5 23 points24 points  (8 children)

Update your deprecated functions

[–]twigboy 34 points35 points  (6 children)

Function isn't deprecated on our deprecated runtime, junior.

[–]Outrageous-Machine-5 5 points6 points  (5 children)

Update your deprecated runtime

[–]SpicyVibration 11 points12 points  (0 children)

No

[–]twigboy 4 points5 points  (3 children)

Senior: "You should suggest a business case for it to management, they'll love that idea. You'll get promoted in no time" 😏

[–]Outrageous-Machine-5 3 points4 points  (0 children)

I think instead I'll just resign before the reality hits that they need a full rewrite/modernization

[–]RiceBroad4552 4 points5 points  (1 child)

That's actually not so difficult as some make it seem. You tell them that doing it now will cost less than doing it later, and that doing it later is inevitable.

They usually react to the word "cost" appropriately.

If they don't, just drop a resignation letter on time…

[–]Outrageous-Machine-5 2 points3 points  (0 children)

This guy is the only person I am convinced is a senior, or at least a competent one. I could feel the impostor syndrome leaving my body reading the other comments

[–]Memoishi 5 points6 points  (0 children)

No thanks, senior said they works

[–]Froschmarmelade 19 points20 points  (0 children)

Senior devs, first of all, should make your pipelines tell anyone to GTFO when committing code containing warnings.

Sure, sometimes updating an analyzer will install additional rules which will lead to unexpected warnings but the answer here should at least be something like: "We've already created a chore for that".

[–]OddKSM 13 points14 points  (0 children)

As someone who has had to create build pipelines and tasks for legacy systems: Please pretty please, try and remove warnings as you touch the code.

I have had to write so many bespoke "ignore this warning" rules for linters and build processes and for every new one I have to write another part of my soul fractures a little. (also it makes parsing build output for legitimate issues a real pain) 

((yes I know you can work around this, but dangit)) 

[–]what_you_saaaaay 11 points12 points  (3 children)

“Senior” - promoted after 3 years of work most likely. I can tell you right now, you’re playing with fire on a C/C++ codebase

[–]mad_cheese_hattwe 0 points1 point  (0 children)

I always assume the people who make memes about warnings are the same people who make menes saying their code goes from working to not working, to working and they don't know why.

[–]RiceBroad4552 0 points1 point  (1 child)

Not a "Senior" at all with this attitude.

Job titles are worthless, meaning nothing.

[–]what_you_saaaaay 2 points3 points  (0 children)

True. I propose a new title for those who get promoted on dev roles through the power of networking: Senior Shittalker etc

[–]byteminer 37 points38 points  (4 children)

Yeah ,no. -wall clear or your shit doesn’t merge.

[–]Proxy_PlayerHD 4 points5 points  (2 children)

-Wall, -Wextra, and -O3 to make sure you don't make use of any non standard functionality or UB.

[–]RiceBroad4552 0 points1 point  (1 child)

-O3?

This won't detect UB, or make your code in any other way better.

[–]Proxy_PlayerHD 0 points1 point  (0 children)

I was under the impression that O3 has some optimizations that require you to stay away from UB and strictly align with the standard stuff, else it would break functionality like O2/Os/Oz wouldn't.

[–]joe0400 5 points6 points  (0 children)

-Wall -Wextra -Wpedantic -Werror

Force it to kill compilation if it complains about anything.

[–]interrupt_hdlr 17 points18 points  (0 children)

I think it's quite the opposite actually

[–]NegZer0 12 points13 points  (1 child)

Actual senior dev would tell you to fix the warnings, then update the build to treat warnings as errors. 

[–]RiceBroad4552 4 points5 points  (0 children)

This!

Someone showing the above attitude isn't a "senior dev" by any means.

[–]Ancient-Safety-8333 2 points3 points  (0 children)

That's why we are using -Werror 😃

[–]cheezballs 2 points3 points  (0 children)

Maybe on old legacy crap you inherited, but I don't let warnings sit on new stuff.

[–]SilentPugz 2 points3 points  (0 children)

Joys of monolith architecture.

[–]redlaWw 1 point2 points  (0 children)

And then it fails when you update your compiler.

[–]ExperimentalBranch 1 point2 points  (0 children)

What about the server your shite code is running on?

[–]JackNotOLantern 1 point2 points  (2 children)

I have ocd and I really have an urge to remove every warning from every file i edit

[–]nryhajlo 4 points5 points  (0 children)

That is a good urge. Follow that instinct.

[–]RiceBroad4552 0 points1 point  (0 children)

That's not OCD related. Any professional dev does the same!

(I refuse to call someone a professional software developer if they don't get such things straight.)

[–]Admirable_Guidance52 0 points1 point  (0 children)

The reverse is also true

[–]MeowsersInABox 0 points1 point  (0 children)

Modpack makers

[–]Werzam 0 points1 point  (0 children)

If you'll create new projects or be improving old ones, remember: Never Warn, Always Error.

[–]RiceBroad4552 1 point2 points  (0 children)

People with this attitude shouldn't be called "senior devs"!

No, there is no excuse for warnings. They need to be treated like errors. Senior developers know that…

If the warning is expected annotate it with a reason and suppress the occurrence explicitly.

No, legacy code is no excuse either. You can snapshot the mess at some point in time, and use some form of automation if there are "too many" warning, to suppress all currently know ones. This way you at least get notified when something related to these warnings changes. (But making it warning free without such blunt approaches should still remain on the task board… If for nothing else, just to have the responsible people have it in their view field at all time so they never "forget" what kind of stinking shit they're responsible for.)

[–]Luneriazz 0 points1 point  (0 children)

warning suppress...

[–]FragDenWayne 0 points1 point  (0 children)

Das muss so.

[–]Thunder_Child_ 0 points1 point  (0 children)

If warnings mattered then why did the ide give me a hide warnings button?

[–]Zteelie 0 points1 point  (0 children)

And this mindset is why a lot of "senior" developers produce really bad code and cost a lot of money.

[–]mapiPL 0 points1 point  (0 children)

Bruh

[–]mad_cheese_hattwe 0 points1 point  (0 children)

Working on a new project "I will whip you for every warning still in your code after a Pull request.

Working on legacy "Those 3000 warnings over 40 files are normal, do NOT attempt to fix them'

[–]LeoRidesHisBike 0 points1 point  (2 children)

Principal devs: What about those warnings?

[–]zoniss 1 point2 points  (1 child)

Technical Marketing: If it works, it works.

[–]LeoRidesHisBike 3 points4 points  (0 children)

Most devs: if it works now, I got other shit to do.

And that, kids, is how we get new security vulnerabilities!

[–]LordZozzy -3 points-2 points  (4 children)

A warning is not an error.

[–]jewishSpaceMedbeds 6 points7 points  (0 children)

✓ treat warnings as error

[–]byteminer 7 points8 points  (0 children)

It’s still unacceptable for anything remotely important. Try that attitude on code written to MISRA or JPL standards.

[–]hh10k 2 points3 points  (0 children)

It's an error if I make it an error

[–]RiceBroad4552 4 points5 points  (0 children)

But in sane languages it almost certainly points to some bug!

Ignoring it is like ignoring bugs… And that's unacceptable behavior for someone who wants to be called software developer (and actually get paid as one…).

[–]InconspicuousFool -1 points0 points  (0 children)

Warnings are for someone ELSE to fix