r/ProgrammerHumor • • Oct 05 '22

Meme Management won't understand

Post image
59.9k Upvotes

720 comments sorted by

956

u/Dewernh Oct 05 '22 edited Oct 05 '22

356

u/harmenator Oct 05 '22 edited Jun 27 '23

[deleted 26-6-2023]

Moving is normal. There's no point in sticking around in a place that's getting worse all the time. I went to Squabbles.io. I hope you have a good time wherever you end up!

116

u/Dewernh Oct 05 '22

Love it 😂

41

u/[deleted] Oct 05 '22

no, its a refrigerator

30

u/gringrant Oct 05 '22

No, this is Patrick!

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

75

u/Keintroufe Oct 05 '22

This is not refactoring, you have added new content.

47

u/fkbjsdjvbsdjfbsdf Oct 05 '22

found the guy who knows how to code review

→ More replies (2)

2

u/OtherPlayers Oct 05 '22

I just want to say I love the fact that you credited the original original creator. Memes could use more of that honesty.

→ More replies (1)

5.5k

u/[deleted] Oct 05 '22

The only thing better than writing code is removing code.

213

u/scholzie Oct 05 '22

The best code you’ve ever written is code you get to delete

→ More replies (14)

90

u/kaji823 Oct 05 '22

I’m getting to retire 3, maybe 4 legacy applications this year and it feels fuckin good.

19

u/vilemeister Oct 05 '22

It doesn't feel quite as good when the application you work on is deemed legacy and therefore you are also deemed legacy and are out the door as soon as you've decommissioned it :(

14

u/kaji823 Oct 05 '22

Yeah that's rough :(

My whole career in data engineering has been basically rebuilding the same warehouse over and over to meet a siloed need. I've done it 5 times in 9 years. 3 of the ones retiring are like 80% the same thing so it feels good.

→ More replies (2)

72

u/NeverQuestionPizza Oct 05 '22

I used to edit essays for fun and profit. It is incredibly entertaining to hack viciously away at someone's long-winded essay and convoluted sentences. I imagine the same holds true for programmers :)

82

u/coldnebo Oct 05 '22

writing is remarkably similar to programming in that the ability to communicate clearly and concisely is underrated.

I remember my english teacher marking up my essays with red ink. And I’d get upset, “but that’s not what I meant, it’s clear to me.” Then my teacher would pick apart my vague connections piece by piece… “well that’s not what you wrote”.

now that I’m studying aviation phraseology, I’m even more impressed with how precise and direct it is at conveying unambiguous information:

“10 miles west at 2000, to land”

from my experience as a student, we have a hard time being that direct or precise. this is closer to what I thought when starting out:

“um, I’m coming in, airport is on my right, permission to land.”

if the controller is in a joking mood, they may respond with:

“your right or my right?”

21

u/NeverQuestionPizza Oct 05 '22

It's a definite challenge - In the theory of communication (No matter which field, there are always standards of communication to be followed) we are told that one particular form of communication must be followed. In programming, all variables must be descriptive , proper indentation, documentation, all that sort of thing. But in reality it's absolutely impossible to maintain that and it requires skill and experience to be able to sift through it and remove what's unnecessary or pare it down.

In essence, we go from 'following the rule' to 'implementing a philosophy' if you'll pardon the airy-fairy comment.

→ More replies (3)
→ More replies (6)

56

u/[deleted] Oct 05 '22

"Perfection isn't attained when there isn't anything left to add, but when there isn't anything left to remove" --Antoine de Saint-Exupéry

39

u/Cosmic_Teapot Oct 05 '22

“Any intelligent fool can make things bigger, more complex. It takes a touch of genius and a lot of courage to move in the opposite direction.” – E.F. Schumacher

→ More replies (5)
→ More replies (4)

68

u/DEVolkan Oct 05 '22

50

u/admirelurk Oct 05 '22

Wow, truly a masterpiece of code. Zero bugs, zero dependencies, works on all platforms. 10/10

34

u/TrickBox_ Oct 05 '22

synthax error

0

u/[deleted] Oct 05 '22

[deleted]

→ More replies (4)

51

u/jso__ Oct 05 '22

Someone inserted this comment above yours so I'm going to submit a pull request.

  • 1 line

  • 1 line Original comment:

< The only thing better than writing code is removing code.


New branch:

> https://www.reddit.com/r/ProgrammerHumor/comments/xw5mc2/management_wont_understand/ir4tzj4/

→ More replies (2)

25

u/DowntownLizard Oct 05 '22

Turning code into one liners for 'readability' is up there. You get a lambda, you get a lambda, everybody gets a lambda!

28

u/AceWanker2 Oct 05 '22

Fuck that, lambdas are fine but Having the same logic in one line does nothing for anyone except for making code harder to read (Not always). But often people sacrifice readability for one linerness

→ More replies (8)
→ More replies (4)

7

u/Comment90 Oct 05 '22

I see this subreddit pop up pretty often and it seems like that are a lot of things better than writing code.

14

u/deukhoofd Oct 05 '22

Writing code is the boring stuff that needs to happen to make things work. The fun part is figuring out how it should make it work. If you can make something work with less code, that's a net win, because it means you need to read and debug less code.

→ More replies (1)

3

u/SowaG Oct 05 '22

And then finding out it was somehow essential

2

u/Balgur Oct 05 '22

We had a monolithic service that had huge amounts of other stuff baked in, and was basically both a service and a library.

We managed to deprecate the service side. A bit later I went back and deleted 17k lines of code. It was glorious.

→ More replies (41)

4.6k

u/Past-Bit4406 Oct 05 '22

Clean code BABY

93

u/BlackPrincessPeach_ Oct 05 '22

IVE REMOVED YOUR REDUNDANT CODE PEASANT. WORSHIP THE CONCISE.

you lost 2 lines of code, congratulations

→ More replies (1)

38

u/Bootygiuliani420 Oct 05 '22

Clean code is 10000 per potential feature

4

u/flyingcircusdog Oct 05 '22

If it can't be done with recursion, you aren't thinking hard enough.

2

u/bata03 Oct 05 '22

Ain't nothing but a peanut!

→ More replies (2)
→ More replies (39)

2.2k

u/hellra1zer666 Oct 05 '22

If you're working at a company that still uses lines of code per hour... leave! That ship is sinking. I thought dinos went extinct.

743

u/jhaand Oct 05 '22

They reinvent all these shit methods every 11 years.

Just listen with attention and keep doing what you like.

192

u/Luxpreliator Oct 05 '22

Don't work in programming but those out of touch metrics for determining a workers value do seem to be cyclical. The funny thing to me is that in my management classes they specifically warned against using singular metrics to determine value.

One of the case studies that stuck with me was during efficency movement of the early 20th century. At a factory the end of the week productivity numbers came in and the workers had like 40-60% as much product made. Factory manager got mad and fired the worst workers and hired new ones. Low productivity continued for months.

The owner was panicking and decided to bring in an efficiency team to try and get the factory back to full capacity. They watched and talked to the workers for a week or two. The workers said they couldn't see well and had to work slower. The reason for that was the manager didn't like spending so much on electricity so he had most of the lights disconnected and caused the whole problem.

Valuing the workers only on their productivity had caused them to let go some of their best workers that didn't have the great night vision but were otherwise valuable.

93

u/SuspecM Oct 05 '22

I blame Silicon valley for its resurgance. Every half a decade a "new" company pops up with "revolutionary" ways to measure productivity, which all the suckers at management eat up. This cycle repeats when the previous management has been replaced in most eligible companies and otherwise useless managers need to pretend to be useful again.

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

254

u/hellra1zer666 Oct 05 '22

Nah, I didn't study business related to IT or anything, but the loc/h metric is a famous and widely used example for a flawed performance metric in IT. You have to be willfully ignorant to continue to use this metric. But I do agree with your statement as to "do as you like". I would specify it to " do what's working for you or your team" but the essence is the same in think.

182

u/ArthurBonesly Oct 05 '22

You have to be willfully ignorant to continue to use this metric.

Anyone who's worked a job has seen how willfully ignorant management can be.

→ More replies (7)

39

u/zeronormalitys Oct 05 '22

Willfully ignorant is believing that any metric is going to be: effective, universal, foolproof, closed to abuse, reflective of actual value.

True of pretty much every performance metric ever invented to automate employee evaluation. An employee can automate task completion in IT and increase their effectiveness, but regardless of how hard management tries, you cannot automate employee evaluation. Places that try will have "amazing" shitty employees that are great at abusing the current metric. They will also fire "terrible" great employees that refuse to jump through stupid hoops rather than produce quality work.

→ More replies (4)
→ More replies (13)

15

u/Unlearned_One Oct 05 '22

I feel like this applies in a lot of industries. I was stuck in customer service for 10 years and never paid any attention to my metrics.

7

u/Lollasaurusrex Oct 05 '22

Performance reviews/evaluations of all kinds typically function on the same cycle routing through different levels of highly detailed and structured to more free form and less involved, and then back again.

→ More replies (2)

122

u/zeth0s Oct 05 '22

Are there companies which does that?

It looks so stupid and useless. Who came up with that?

73

u/hellra1zer666 Oct 05 '22

Widely applied in the 80ties and 90ties. There was no specific company behind it, as far as I know.

79

u/patrick66 Oct 05 '22 edited Oct 05 '22

It was a big thing from IBM and they kinda pushed it on anyone they worked with which was basically everyone. It famously led to some friction between them and Microsoft because Microsoft didn’t adopt KLOC even when working with ibm so their engineering teams had completely separate goals

→ More replies (8)

67

u/----_____---- Oct 05 '22

80ties and 90ties

eightyties and ninetyties

→ More replies (10)

15

u/WelpImaHelp Oct 05 '22

Still a major improvement over what we had to work with in the sixtyties and seventyties.

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

45

u/kgold0 Oct 05 '22

When they do count lines of code do they include remarks and extra spaces?

76

u/zeth0s Oct 05 '22 edited Oct 05 '22

Time to add few hundreds of nested useless if cases to get the bonus. Top level: if 1==0

33

u/Unlearned_One Oct 05 '22

Needs more try catch statements. Extra points for catching exceptions that don't even apply to the method called.

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

32

u/hellra1zer666 Oct 05 '22 edited Oct 05 '22

My old programming teacher said, that this was exactly what they did. Make the code as line heavy as possible.

Edit: I'm talking about code, comments didn't count, or they would have started documenting stuff in the code 😅

→ More replies (37)

19

u/TheBrillo Oct 05 '22

Been doing this for 15 years and never had anyone even mention using this as a metric. This sounds like a rule made by people who have no idea how software works.

Honestly I don't even know what my numbers would be. Very high at the start of a project and nearly 0 at the end? Bug fixes can take hours and more often then not its some "off by one" error or something that would net 0 lines.

This metric also doesn't value documentation in any of its forms....

10

u/hellra1zer666 Oct 05 '22

I'm not surprised that you as a programmer haven't heard of it. This has been abolished for 20 years now. A project manager or management in general however have heard of it, of that, I'm fairly certain. And you are right, that metric was made by people who had to evaluate the work of other people that did something they didn't comprehend in the slightest.

→ More replies (1)

23

u/RashPatch Oct 05 '22

that and clicks per 10mins. Atrocious. Slavery in subtlety.

26

u/Unlearned_One Oct 05 '22

That sounds even easier to manipulate than lines/hour.

12

u/RashPatch Oct 05 '22

yes, but completely unproductive.

12

u/Modsrtrashshuddie Oct 05 '22

Lmao i just click constantly while im reading something on screen, like hundreds of times. I would get promoted so fast at that company.

6

u/svtguy88 Oct 05 '22

Wait, is that a thing? I'm not sure there's an amount of money that would prevent me from noping the fuck out of a gig like that.

→ More replies (1)

6

u/Pr0fil3 Oct 05 '22

Just commit a bit JSON file with data for use with unit testing, easy

→ More replies (1)

3

u/GargantuanCake Oct 05 '22

I doubt they'll ever stop trying to quant all over software engineering even though none of the metrics accurately reflect anything and all of them can be exploited. I actually got shit for having no commits a particular week even though I was tracking down an ugly, weird bug that was happening somewhere in 20,000 lines of undocumented spaghetti.

Of course I wasn't committing anything. That shit takes time.

2

u/Haunting_Swing1547 Oct 05 '22

So COCOMO doesn’t work? You are one of those scrum masters, aren’t you. What do you do exactly?

→ More replies (4)

2

u/boringestnickname Oct 05 '22

The KPI game is played always, given a company of a certain size.

→ More replies (1)

2

u/Kejilko Oct 05 '22

Do you earn more the fewer lines you write? Because depending on the case I can be around a block for days or weeks with how precise and difficult a task is but I can write 800 lines in three hours when it's as easy as talking.

→ More replies (3)
→ More replies (14)

944

u/cob59 Oct 05 '22

When your commit has more red lines than green ones 😌

273

u/SpencerTheBeigest Oct 05 '22

this has the same vibe as:

sudo pacman -syu

...

...

Net upgrade size: -0.2MiB

42

u/ushu3323 Oct 05 '22

archlinux enjoyer B)

10

u/[deleted] Oct 05 '22

This is rich. It's been a good few months of negative net size.

0

u/[deleted] Oct 05 '22

[deleted]

→ More replies (1)

28

u/PassionateRants Oct 05 '22

That hits the spot doesn't it

17

u/rexpup Oct 05 '22

One company I used to work at had hidden achievements in the project management software. One was "Negative World" which you got if your ticket removed more lines than it added

5

u/Far_Calligrapher_215 Oct 06 '22

I delete comments and feel good about myself

1.1k

u/zertboqus Oct 05 '22

This reminds me of that joke:

They asked a junior, a mid and a senior devs what they did throughout the day:

Junior: Ohh, I wrote so much code!

Mid: Ohh, I deleted so much code!

Senior: Ohh, I prevented so much code from being written!

269

u/[deleted] Oct 05 '22

Time to be a 5head junior and just delete all the code to get ahead, business will be so impressed

→ More replies (6)

63

u/tinypieceofmeat Oct 05 '22

I always heard it as "complex solutions to simple problems -> simple solutions to simple problems -> simple solutions to complex problems -> making problems disappear."

10

u/hkzqgfswavvukwsw Oct 05 '22

Preventing problems from appearing

20

u/crash8308 Oct 05 '22

As a senior I always use this line to greenbacks:

Developers just write code.

Engineers solve problems with as little code as possible.

“Which one do you want to be?”

This started after I got a job where I was kinda frustrated by the amount of “boilerplate” code that everything required in the project. My lead said “you’re a software engineer. you’re paid to write code.” I hate that line with as much gusto now as when i first heard it.

I love removing entire useless classes that do nothing but obfuscate the logic because someone though they were being clever by creating some abstraction layer atop another abstraction. It’s like a web dev nesting a single div inside another single div inside of another single div with no classes or styling. it’s just useless.

6

u/zertboqus Oct 05 '22

Totally agree with you on that one. One of the things I love doing most is just deleting/refactoring things and afterwards seeing that it's actually possible to achieve the same in a much, much simpler and shorter way.

→ More replies (3)

2

u/mrjackspade Oct 05 '22

As a senior dev I also reject tickets at the source.

540

u/CGPoly36 Oct 05 '22

4,294,967,294 lines of code per hour are quite an accomplishment.

233

u/fish312 Oct 05 '22

So the trick to the perfect solution is to start with a bunch of code that does every single possible thing in the universe.

Then just slowly remove the stuff that you don't want until you achieve desired functionality.

Maybe you can even call it machine learning.

38

u/serious_sarcasm Oct 05 '22

It’s like those equations that make every pixel art that could ever exist.

4

u/OtherPlayers Oct 05 '22

Ah yes, the Perfect Circle approach.

→ More replies (6)

24

u/VitamineBi Oct 05 '22

Thanks, I almost forgot I was in the barren land of humor that is r/ProgrammerHumor.

9

u/[deleted] Oct 05 '22

Here’s your sign.

6

u/Die4Ever Oct 05 '22

switch to 64 bit to greatly increase your productivity!

2

u/kavisiegel Oct 05 '22

Accidentally committed node_modules to a hello world project

347

u/[deleted] Oct 05 '22

Refactoring

72

u/[deleted] Oct 05 '22

[removed] — view removed comment

16

u/hatsuneadc Oct 05 '22

I low key do that only to feel better after stealing it.

→ More replies (3)

5

u/Jjabrahams567 Oct 05 '22

Removing unnecessary parts that you added to the code you stole from stackoverflow

→ More replies (3)

106

u/diamondjim Oct 05 '22

Amateurs. I deleted 2,500 lines of code written by an outsourced contractor last month. Happiest feeling ever.

60

u/Dyledion Oct 05 '22

-15.625 lines/hour. Impressive, actually.

37

u/dim13 Oct 05 '22 edited Oct 05 '22

Me looking at my gh history on one project… (6 years in total).

4,378 commits    5,048,143 ++    16,558,973 --
→ More replies (1)

208

u/EntropicBlackhole Oct 05 '22 edited Oct 06 '22

null lines per undefined, also one of the reports says self harm, why is that lol?

now one says "It's personal and confidential information" lol

Edit 2: "It's involuntary pornography and i appear in it" "this contains personal information"

Lol please stop false reporting to appear on here

41

u/Icemasta Oct 05 '22

It hurt itself in its confusion!

70

u/xiipaoc Oct 05 '22

Refactoring is the best.

Except for some reason my manager never seems to find time in the sprint to rewrite our entire codebase from scratch. I wonder why...

21

u/[deleted] Oct 05 '22

I think it depends. My job is to make lots of small programs. I think we've made 150 programs over the last 3 years. Some programs work perfect and need 0 updates. Some have bugs. Some never get used.

If we refactored all 150 programs... holy crap that would mean lost months. Maybe refactoring our libraries would be a good choice, but we are at the point that we have made almost no updates in a year.

All of this makes me think Programming isnt real engineering. Its subjective, no one knows what is best, its impossible to calculate.

11

u/Playful-Wish-1349 Oct 05 '22

All of this makes me think Programming isnt real engineering. Its subjective, no one knows what is best, its impossible to calculate

Oh Jesus. Wait till you find out how deeply subjective engineering is. There are plenty of incalculable things at every level. I’d say “subjective” captures the feeling, but it’s a specific problem if the more general trouble: “Compromise” is the word I’d use for all forms of engineering, including all forms of software.

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

69

u/TheKiller36_real Oct 05 '22

Reminds me of that one guy at Facebook going: "This PR contains UB" and introducing a non-lazy null terminator

17

u/PM_ME_UR_OBSIDIAN Oct 05 '22

What's a non-lazy null terminator?

27

u/Caayaa Oct 05 '22

Not me

12

u/TheKiller36_real Oct 05 '22

a null terminator is only required at the end of the sequence if you call c_str() (or data() since 17)

you could in theory set it lazily when c_str() is called (data[size()] = 0; return data;). Setting it every time the string is updated in any form is non-lazy then

0

u/[deleted] Oct 05 '22

[deleted]

30

u/[deleted] Oct 05 '22

Not much whats ub with you?

196

u/OhLookASquirrel Oct 05 '22

You're not done coding when there's nothing left to add. You're done when there's nothing left to take away.

24

u/i_have_chosen_a_name Oct 05 '22

You're done when there's nothing left to take away

How about your job?

12

u/OhLookASquirrel Oct 05 '22

Still counts

4

u/ccAbstraction Oct 05 '22

How about your wife and kids?

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

102

u/Panigg Oct 05 '22

This is true not only with code.

I'm a game designer and let me tell you, the less text you have on a card or the fewer mechanics are in the game, the better the game becomes.

57

u/lockwolf Oct 05 '22

That’s one reason I’ll have respect for massive open world games like GTA. It’s a bunch of small mechanics that have to all work together at the same time smoothly or else it’s not gonna work and nobody’s gonna play it

45

u/Bloody_Insane Oct 05 '22

While not easy at all, it's easier than you may think. This goes for all development. As long as you build a robust system with clear inputs and outputs, integrating with other systems becomes easier.

For example building a system where things catch fire. As long as the rules for fire spreading are properly defined, you can add any kind of condition that will trigger a fire (like a laser, torch, magnifying glass, etc), and the fire takes care of itself.

This way you should be able to add any number of things that deal with fire in different ways and it should work immediately.

20

u/KKlear Oct 05 '22

Reminds me of when they were developing Far Cry 2. They made a complex and realistic fire propagation system and then found out that if you set fire to anything, the whole map will burn down most of the time, so they had to explicitly limit it.

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

8

u/[deleted] Oct 05 '22

Meh, I felt like AC Black Flag was great despite having tons of mechanics. Meanwhile BOTW was repetitive AF. That said, I think BOTW was pretty lazy with there ~3 enemy types with different skins.

Might just be an Effort thing. Nintendo knew people were going to buy BOTW regardless. Black Flag had to earn it after AC3.

7

u/Bryguy3k Oct 05 '22

Through the process of elimination I’ve determined that you DO NOT work for Capital Games.

12

u/Panigg Oct 05 '22

Haha, correct. I work in the only style of company that still allows for creative, fun, innovative games: A private company with not shareholders! :D

2

u/Cahootie Oct 05 '22

And then there's It Takes Two, which managed to create a glorious game while including every single mechanic.

2

u/ThirdMover Oct 05 '22

looks at my Paradox Games library

You sure?

→ More replies (3)

50

u/Pepito_Pepito Oct 05 '22

You type at 100 wpm, right? So why is this feature taking so long to finish?

34

u/PrizeArticle1 Oct 05 '22

This comment just caused my heart rate to speed up and hand tighten to a fist.

→ More replies (1)

84

u/lewiswulski1 Oct 05 '22

Who can do 45 lines in an hour?? I think I'd overdose if I did that much

74

u/JelloCute848 Oct 05 '22

Now you gotta figure out if you're on the left or right side of the curve.

12

u/AnAncientMonk Oct 05 '22

{

does this count as a line?

→ More replies (1)

36

u/Bloody_Insane Oct 05 '22

They didn't say they were GOOD lines. It might be a 45 line string length function.

Ninja edit: Now that I think about it. The C standard implementation for strlen is a very long function. So maybe 45 lines isn't bad

17

u/ThockiestBoard Oct 05 '22

the openbsd implementation is

size_t
strlen(const char *str)
{
    const char *s;

    for (s = str; *s; ++s)
        ;
    return (s - str);
}

idk if it could be any shorter, formatting aside

→ More replies (1)

6

u/hanzzz123 Oct 05 '22

I don't think anyone caught your joke

4

u/Kristof257 Oct 05 '22

You expect IT people to get jokes?

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

14

u/Ksevio Oct 05 '22

Just write some Java - each variable needs a getter and setter which with comments and spacing will be 20 lines of code and best of all the IDE can even write that for you!

→ More replies (4)

110

u/dethnight Oct 05 '22

Manager: "Why does it say here you have written -4322 lines of code this month?"

Dev: "I completely refactored the payment and the admin system. It will be so much easier to maintain and add features in the future now!"

Manager: "YOU IDIOT! Our future depended on a feature delivery which you completely ignored. We are out of money!"

Dev: "Damn I feel for you guys. Anyway I got an offer for 40% more TC so I'm gonna head out. Good luck!"

16

u/Roflkopt3r Oct 05 '22

I'm definitely on the dev's side here.

In most cases the delivery of new features fails because the codebase is an unmaintainable nightmare, so your most experience devs are spending 90% of their time bugfixing and none of the new hires sticks around for more than a year because there is no way for them to become productive.

→ More replies (1)

34

u/ArchWaverley Oct 05 '22

Me: +12 lines per hour but they're all comments

136

u/dagbrown Oct 05 '22

I once spent more than a month wracking my brain over a problem that was killing a system in a subtle way that I couldn't puzzle out no matter how I tried.

Eventually I figured it out. It was like a revelation, a vision from God. The problem was completely solved, and the solution was beautiful!

I deleted a comma.

A month of work, one character deleted, one long-standing bug resolved. I was so proud.

34

u/Dezibel_ Oct 05 '22

Similar thing happened to me while learning kernel development while I was making a simple kernel shell to interact with the system.

The bug was that whenever you typed a command into the shell, it would work fine the first time, but not after.

Turns out my massive brain fucked up a switch statement, and had the function which cleared the variable storing the entered text run at the wrong time.

The execution worked like this:

Enter command -> entered text gets saved into var -> hit enter > run the command based on entered text > clear variable -> print newline on display

I can't remember where exactly the bug was, because jesus christ that codebase was spaghetti, but effectively a undisplayable value (something from the keyboard driver that wasn't text I think) got added to the cmd variable, and because it didn't get cleared at the end of execution like it should, it stuck around until the next time and the command couldn't be read.

I didn't even consider that there could have been an undisplayable bit of data in that variable since in that function I was just dealing with text (or so I thought)!

It was such an easy fix and it took me so fucking long to find it.

→ More replies (2)

6

u/mobit80 Oct 05 '22

We had some duplicate id JavaScript error sitting around for a good 6 months until one morning a guy who has been around a year longer than me thought to remove a div tag from a page, instantly vanished

8

u/Memelord_00 Oct 05 '22

Damn, can you give more context, sounds interesting

19

u/dagbrown Oct 05 '22

Not without violating NDAs, not really.

→ More replies (3)

2

u/[deleted] Oct 05 '22

I was implementing Azure AD auth in a web app i was working on. Seemed to work great locally but when i deployed it to test i had weird bugs, like i couldn't log back in after logging out and even my colleague couldn't log in after i logged out, stuff like that.

About 2 weeks later i found an obscure article written by some Microsoft guy talking about my exact issue and how it was due to a bug in Katana which is the library used by the library i was using. It didn't work with the specific cookie manager used in the application.

I changed one line of code to use a different cookie manager and then it worked.

2

u/moojuiceaddict Oct 05 '22

My best/worst has been fixing a bug in a system shortly after the guy who build it left. Simple API that requests data from a third party suddenly breaks. Third party had scheduled down time the weekend before but they said nothing had changed in the code. Took me a week to find out that changing two characters from upper to lower case in a configuration file fixed it.

My best guess is that they changed something to a case sensitive system somewhere.

→ More replies (1)

59

u/MokausiLietuviu Oct 05 '22

In my first industrial control job, I was given a task that amounted to an 8 character code change. Didn't get finished for my entire 3 years working for that company.

Sometimes it's just like that

26

u/emonra Oct 05 '22

I need to hear more about this

40

u/MokausiLietuviu Oct 05 '22

The issue in question was a bug in a scada screen where the value was an average of various other percentage values, calculated within the screen, and then shoved into an integer rather than an analogue value. This meant that the displayed average was rounded and always had a displayed decimal component of .00%. My job was to change "INTEGER" to "ANALOGUE" in the scada code which would have resolved it.

But that scada screen was considered one of the most critical for the plant, had a few other components hanging off of it and therefore an exploration of the full potential side and/or adverse effect was required. And a non-adverse side effect was identified, so a full test exploration and safety case was needed before this work could be performed. It was my job to do that alongside the customer.

And I didn't get that done in 3 years. Might never get done. And I use it as an example of how line code counts in industrial control systems mean didly squat

10

u/liquidpele Oct 05 '22

Ha, shit like this is why a past company I worked for didn't do new versions, everything was a service pack update that literally replaced the entire program. Our govt customers had to jump through hell for a new version, but service packs were allowed anytime ;)

→ More replies (2)

5

u/DoNotBotherMeplz Oct 05 '22

Please elaborate

19

u/pictures_at_last Oct 05 '22

Bill Atkinson, ... the main user interface designer ... thought that lines of code was a silly measure of software productivity. He thought his goal was to write as small and fast a program as possible, and that the lines of code metric only encouraged writing sloppy, bloated, broken code.

... it was time to fill out the management form for the first time. When he got to the lines of code part, he thought about it for a second, and then wrote in the number: -2000.

Apple folklore

3

u/zeth0s Oct 05 '22

The writer can replace "he thought" with "he knew". Line of code metric encourage bad software practices, writing less readable code, anti patterns, and discourages code reuse and good software design...

It makes no sense

2

u/pemungkah Oct 06 '22

I’m surprised I had to scroll this far to find this one. Atkinson was an incredible programmer.

15

u/OneLostOstrich Oct 05 '22

I remember 20 years ago one software contract with a major educational software publishing company that I worked on ended going to an Indian company because their sales team promised "x number of lines per minute". They came back to me because the resulting product was shit. My response was, "You should have known better, going from the team who turned your product around, delivering it on time and under budget, to someone who promised fictitious savings over an useless criteria. It's your own damn fault for the situation you put yourself in. You're going to have to live with it, because I'm not going to touch it."

44

u/[deleted] Oct 05 '22

My record is -3000 lines per hour. Just delete or mock out lines of code that you don't understand, repeat until the tests break. There's a ton of code in our code base of which nobody knows what it does. Turns out that it doesn't do anything, but nobody dared to delete it.

68

u/[deleted] Oct 05 '22

There go all your edge case fixes

30

u/Unlearned_One Oct 05 '22

If the edge cases were important someone should have written tests for them.

15

u/[deleted] Oct 05 '22

Or at the very least written some legible explanation in the commit message. Now it's just undocumented garbage that nobody seems to care about, so the trashbin is where it belongs.

The line of thinking 'this doesn't seem to do anything but I'll leave it here just in case' is what got us this mess in the first place.

→ More replies (2)

2

u/fefect123 Oct 05 '22

Ah yes I also read 3000 lines per hour. Definitely.

5

u/El_Giganto Oct 05 '22

There's so many lines you can safely skip because you understand them without even really looking at them. Setting a variable. A constructor. The lines that are just there for making the code look nice.

Still, I wouldn't delete anything I don't understand. I've seen useless code before, sometimes I see code that I don't really understand, but I've never seen that many lines of code that seemingly doesn't even do anything.

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

18

u/[deleted] Oct 05 '22

Just getting rid of duplicate entries in a JSON "DataBase".

What you don't work with compressed JSON's that expand to over 100,000 lines of text?

Then again compression means it's not even -1 lines of code... right?

6

u/Delicious_Being_2922 Oct 05 '22

Remove the comments ..

5

u/gmano Oct 05 '22

I hate code, and I want as little of it as possible in our product.

– Jack Diederich.

5

u/andrewsmd87 Oct 05 '22

IDK, I once saved one of our clients around 3 million dollars by adding two lines of code

9

u/Bryguy3k Oct 05 '22

This is pretty normal in embedded when you get vendor code. Vendors like to wrap auto coded drivers with autocoded interfaces.

There was one job where I was -60k loc because I refactored the drivers for an RTOS and removed two layers of autocoded wrappers (NXP’s MQX). Literally had the exact same functionality with 1/3rd the code.

4

u/Wicam Oct 05 '22

i removed 250 source files a few months ago, was very happy

4

u/ChocolateBunny Oct 05 '22

My manager prides himself on how much code he's deleted. And he enforces "fixit" days where we spend the day just cleaning up code and is very cognizant of code health overall. #bestboss

→ More replies (1)

10

u/[deleted] Oct 05 '22

-2 lines per hour = one month - no project :)

21

u/Wicam Oct 05 '22

assuming 37 hours per week, 74 lines per week. assuming 4 weeks a month, thats 296 lines a month.

the linux kernel has 17 million lines of code, so it would take 57432 months.

you 360 months in 30 years, so it would take 1914 developers 30 years to delete the linux kernel at that rate.

i think we are all good ;)

6

u/LargeKeyboard Oct 05 '22

This guy maths

6

u/Bloody_Insane Oct 05 '22

the linux kernel has

A fuck ton of code. Most projects won't reach anywhere close to that

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

3

u/dlq84 Oct 05 '22

Noooo, don't delete value!

3

u/Cley_Faye Oct 05 '22

2 additions, 567 deletions. No feature change, but feels so good.

3

u/Non-Sequitur_Gimli Oct 05 '22

What about removing a library?

3

u/Lazybone820 Oct 05 '22

Where did you get my team's group picture from?

3

u/[deleted] Oct 05 '22

Just added a new feature to a program. Took me about 3 days. Most of the time was spent

Understanding the code

Finding the critical information

Then the actual code update? like 2 hours max, most of that time was thinking about the best place to put it in the code to achieve the result we wanted without it causing future bugs.

3

u/TheRentCollectr Oct 05 '22

That guy isn't galaxy brain he's just trapped rewriting garbage code. Likely his own code from a few weeks ago

3

u/sudo_rm_rf_star Oct 06 '22

-2 loc for a legacy codebase is probably the best thing you can contribute

3

u/nrlulz Oct 06 '22

code is liability

2

u/[deleted] Oct 05 '22

I recall a story about IBM (or some big IT company) was paying programmers by lines of code. I don't know if it is an urban myth, but I wouldn't be surprised if it was true.

3

u/PrizeArticle1 Oct 05 '22

For loop to 1000? Now it's 1000 lines of code.

2

u/HailToTheThief225 Oct 05 '22

Lol if that was the case I'm sure as hell ain't coding DRY. You bet I'm gonna have the most convoluted if/else statements checking for every possible case

2

u/hangfromthisone Oct 05 '22

Hey I made this comment yesterday.

Cool.

2

u/magicmulder Oct 05 '22

As long as it’s not from

  if($a>0) {
    $foo = new Bar();
    $baz = new Shiz($a);
    $foo->doSomething($baz);
  }

to

  ($a>0)?((new Bar())->doSomething(new Shiz($a))):continue;

“MINUS THREE LINES!”

2

u/SHOTbyGUN Oct 05 '22

Security by obscurity. How can someone exploit my code if I don't understand it even myself?

→ More replies (1)

2

u/iamasatellite Oct 05 '22

Story from the early days of Apple about negative lines of code

https://www.folklore.org/StoryView.py?story=Negative_2000_Lines_Of_Code.txt

2

u/frogking Oct 05 '22

“Lines of code” is a really, really bad metric for employee efficiency.

2

u/here_for_a_fun_ride Oct 05 '22

Add one on the far left side with -105 lines for that guy who accidently deletes half the code.

2

u/eurosat7 Oct 05 '22

We have a huge and partly aged codebase in our main project and we celebrate whenever we can delete bigger chunks of old and bloated code. We add features and often shrink it at the same time.

2

u/Blackbeard6689 Oct 05 '22 edited Oct 05 '22

I'd it's readable, fewer lines of code is better.

But if its one of those "I got this done in 2 lines by using super obscure syntax and hard to decipher code" things then that just makes it worse.

2

u/RileGuy Oct 05 '22

As many have said it is feels better to temple then add. Just got done with a project at my company where the previous version of this app was 6000+ lines and I trimmed it down to about 800

2

u/spen Oct 05 '22

In my experience, it's the low range IQ devss that are actually writing the most code, more than the midrange. You can write code faster if you don't have any internal inhibitor, kind of like Dunning-Kruger.

2

u/[deleted] Oct 05 '22

Missing the final 0.000001%, removing 45 lines per hour.

2

u/not-my-best-wank Oct 05 '22

It's called optimization.

2

u/KazkaFaron Oct 05 '22

i wish somone would pay me for anything 😎

2

u/AndroidWall4680 Oct 05 '22

Me walking into the server room with a sledgehammer: 5000 iq

2

u/Ashamed_Ad_2738 Oct 05 '22

This is irrelevant to this post kinda, but I feel like typing it out anyway. A long time ago (probably a couple years at this point when I was only like 8 months into my career), I found a ScrollableResults that wasn't closed deep in one of our general cleanup processes. This was like a really strange, long running bug that basically was just causing the cleanup to die. (Memory leaks, yay). So we made a task to search the code base for all these ScrollableResults and make sure they were closed. The Sr Dev congratulated me, and I felt great. Shortly after that, I became a team lead (which at my company is both tech lead and regular ol manager basically), and now I hardly write code and memory leaks out of my head 24/7. Moral of the story is, just cause you're good at coding/troubleshooting bugs early in your career, doesn't necessarily mean you should take a management promotion. I'd take troubleshooting that memory leak over this shit any day. At least I had a goal to reach. Now I have other people's goals to reach all the time, and I'm reviewing code, coding, reviewing customer requirements, making sure the team is time tracking, trying to implement scrum in my team, and slowly dying inside with each passing day. I'm fine, though. It's all fine.

2

u/BitPoet Oct 05 '22

Personal record: 1 month, -3000 lines. +1 line.

Took a long time to pick that fucker apart.

Turns out it was memcpy.

There were so many #ifdefs, weird conditionals, temporary variables, etc. I got into it because there was a bug in there, somewhere. I was new on the project and all the greybeards were vaguely terrified of it.

There wasn't really a code review, it passed all the tests they could find, and no one wanted an explanation.

2

u/[deleted] Oct 05 '22

Step one: Create code

Step two: Make redundant code to fall back on if code fails

Step three: remove original code because fallback works better then original code.

Galaxy brain

2

u/[deleted] Oct 05 '22

I will approve your PR but that doesn't mean I won't refactor and optimise it later.

2

u/chicksOut Oct 05 '22

The real big brain is knowing that lines of code per hour is a meaningless metric

2

u/[deleted] Oct 05 '22

The four general categories of skill level:

  1. Unconscious incompetence

  2. Conscious incompetence

  3. Conscious competence

  4. Unconscious competence

Everyone starts out blissfully unaware of how little they know.

Discovering that deficiency is often uncomfortable, and the struggle to prove oneself is strenuous and can feel like a Sisyphean ordeal.

But through experience and practice, one can pick up on the patterns of cause and effect, and begin to account for the mistakes they used to make before they happen again.

Eventually, it's as natural as walking, or even breathing.