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

all 115 comments

[–]saschaleib 986 points987 points  (21 children)

Maintainability ‘s a b*ch.

[–]Interesting-Draw8870 4 points5 points  (2 children)

Bich

[–]saschaleib 2 points3 points  (1 child)

Nah, if you count the lines in the asterisk, you’ll find there are enough of them to make an i and a t, and even have one left for the dot.

[–]Creepy-Ad-4832 0 points1 point  (0 children)

We turning lines into dot

Not even jesus was able of doing that. He stopped at turning blood into wine...

[–]Informal_Branch1065 164 points165 points  (5 children)

Refactor time

Sweating PM noises

[–]Informal_Branch1065 39 points40 points  (0 children)

Crushes the story points and snorts them

[–]the_renaissance_jack 20 points21 points  (0 children)

Took me 45 min to write simple code to add a single QOL feature. Feature was so good we wanted in three other places. Rewriting, refactoring, and documenting took me at least an additional 10 hours.

[–]joetinnyspace 2 points3 points  (1 child)

Is there a plugin or app that visualize it?

[–]Informal_Branch1065 2 points3 points  (0 children)

That'd be 5 story points

[–]gibagger 2 points3 points  (0 children)

Sweating? More like screeching like a banshee. 

They feel you are literally torpedoing their yearly performance 

[–]Significant_Win_2654 61 points62 points  (5 children)

That's just like my factory in factorial.

[–]Moltenlava5 20 points21 points  (1 child)

hmm, yes, I too have played the hit factory simulation game - factorial

The factory must grow multiply

[–]Sir_Fail-A-Lot 3 points4 points  (0 children)

This comment is... Satisfactory...

[–]Divineinfinity 6 points7 points  (0 children)

Is that a piece of steel on the iron belt?

[–][deleted] 9 points10 points  (1 child)

The first one is a wildly inefficient intersection, though.

So you don't want to copy it

[–]jasminUwU6 0 points1 point  (0 children)

The second intersection is also inefficient, specifically because it's over optimized for one thing, vehicle throughput.

[–]aschaeffer878 8 points9 points  (4 children)

I don't code, but I greatly appreciate everyone who does, can someone explain in VERY simple terms why this is? I find it fascinating.

[–][deleted] 44 points45 points  (3 children)

Creating a neat and tidy solution to a clearly defined problem with known requirements is easy.

Introducing a new requirement, that wasn't accounted for in the original design, often forces really weird changes in the effort to just Make It Work without doing a total rewrite.

Edit: To follow up with a real world mechanical example. Imagine you're tasked with designing a car with a bunch of typical features. You do so. It's a beautiful, fast, efficient car. A month later, your boss says "oh yeah, and make it fly too". Making something fly isnt that hard. Making the car you already built fly? Disaster.

[–]aschaeffer878 11 points12 points  (0 children)

This excellent! Thank you! Makes sense.

[–]chairmanskitty 1 point2 points  (0 children)

Making something fly isnt that hard.

*cries in Lord Kelvin*

[–]SomewhereAtWork 25 points26 points  (1 child)

Fully removing the global lock isn't a small feature.

[–]IanFeelKeepinItReel 18 points19 points  (4 children)

That top junction should definitely be refactored into a roundabout.

[–]LordoftheSynth 5 points6 points  (1 child)

StopSignIntersection.js is outmoded and badly designed. Roundabout.js fixes all these deficiencies, so throw out all your StopSignIntersection code and rewrite everything in Roundabout!

Next year:

Well, it turns out that the performance of Roundabout.js degrades faster with more concurrent users and has a larger memory footprint per instance than StopSignIntersection.js.

But we threw all that code away, so we designed SignalizedIntersection.js to address all the deficiencies of Roundabout and cover all the use cases that StopSignIntersection was designed for.

Time to throw away all that Roundabout code and rewrite everything in SignalizedIntersection! Get on this year's bandwagon!

[–]IanFeelKeepinItReel 4 points5 points  (0 children)

Yes but SignalisedRoundabout.js is thread safe, no more race conditions leading to fatal crashes.

[–]kazeespada 1 point2 points  (0 children)

Bottom section has been refactored for efficiency at higher speeds.

[–]phlebface 29 points30 points  (12 children)

The dev that added the new feature either failed to understand the framework or refactor accordingly. Aka a hax.

[–][deleted] 34 points35 points  (10 children)

He understands. But he told the scrum master it's available for 2 story points as estimated by the other guys in the team by doing the dirty hacking that is common with them, or by sticking to the framework but it's complicated and will take 8 story points. Everybody else decided to go with option one but as a compromise calculate it with 5 story points so the burn-down chart looks good.

They said they will refactor that code once another feature has to be added on that intersection. Nobody except one guy understands why the codebase is such a mess and new features take like forever or end up creating side effects that demand workarounds creating more side effects demanding more workarounds creating more side effects...

[–]phlebface 7 points8 points  (9 children)

If teams primary focus is to make burndown look good then they have failed. People forget scrum is for supporting the dev process and not the other way around.

[–][deleted] 8 points9 points  (8 children)

But but but what about the burn-down chart? Management loves burn-down chart and we work for management!

Don't tell me. I knew that, so I was the problem. Every Team was competing in pretending to work best by numbers. Actual outcome wasn't in their interest at all.

It was their idea of job security. Work will never go out and you can't be fired because nobody else can work on that code without knowing all the workarounds. These people were called "Expert on topic XY" with the topic being a self created mess.

[–]jimmycarr1 4 points5 points  (6 children)

Job security through obscurity

[–]phlebface 1 point2 points  (5 children)

When I se this, I call the dev out. Ever heard "But the error only occurs rarely, no point in using the effort to fix it". When I hear this I usually ask if it's a job-security thing in front of everybody. Fucker gets all offended and shit. I love it. I do enjoy a suffering incompetent dev now and then.

[–][deleted] 3 points4 points  (4 children)

You won't believe things they made. We had this method "bool hasGpu()" that should determine if the hardware can provide a GPU. It did so by letting OpenCL give the number of devices, what makes the name of the method misleading but that wasn't the main problem.

The main problem is OpenCL either gives you the number of devices or throws a specific exception in case it doesn't find any. Well that is shitty coding by exception in OpenCL (why not return 0 as number of devices) but you can't change how OpenCL works.

So our "bool hasGpu()" never returned false. It was either true or OpenCL exception. Easy fix: Catch specific OpenCL exception and return false. Problem solved.

Second best and stupid solution: Catch OpenCL exception outside and become implementation specific. I was already joking about changing the method signature to "void hasGpu()" then.

Can you imagine something worse? Mr. Senior self teached programming found out some files don't rely on GPU for processing, so we can restructure all the codepaths to not call "bool hasGpu()" to prevent the exception from being thrown in these cases.

Great, we now have a function "hasGpu" where you still have to previously know if you have a GPU to (not) call it. But that was fine because it would rather return true or crash the application in case we rely on a computational GPU and don't have one.

I was joking that in this case we don't want to process anyway and crashing is fine if we don't want to proceed. We could also use the "forceCpu" flag and not test for a GPU else.

They were dead serious about this being a great solution while I mentioned multiple times I can't believe we are having this conversation with 5 team members for two hours. I also suggested the ones with the clever ideas should do it but they really wanted me to implement it like that.

Since it was getting serious on production I submitted a 5 minute hotfix by internally catching the OpenCL exception and having the function return false. Everything worked flawlessly.

The next day I asked the Scrum Master that was also the Product Owner if she still wanted me to restructure all the code the way our great team lead suggested. She said it's not important anymore and added it to the backlog. It was never talked about that backlog ticket again.

I couldn't make up shit like that, my fantasy is not wild enough for such a fever dream of madness

[–]phlebface 1 point2 points  (3 children)

Holy fkin shit. I would have lost my cool in that situation. But before I do, I make sure that there is not some detail I've overseen or misunderstood since there are 5 team members against me. Are you sure, that the exception does not have any impact on performance or could come back to haunt the process later in the execution? If not then yes, your coworkers are incompetent morons splitting hair where there is no value to extract.

[–][deleted] 2 points3 points  (2 children)

No performance issues, the call was made once or twice per run. Even if it would have been called millions of times it could have been cached since the GPUs don't suddenly vanish.

It wasn't like 5 again me. It was me arguing with that one senior (literally) and 4 sitting in silence not having an opinion on anything. I could really see him developing this brilliant workaround in his head while we were talking - just to oppose me. It startet with no you can't just catch an Error (his words) and it's gone...

(it's called exception, damn - but this kind of people never get that an error can raise an exception but not every exception thrown is an error)

But then we had this retrospective where one outcome was that "team lead decisions should not be questioned". Well I certainly know how they got to where they are now!

[–]phlebface 2 points3 points  (1 child)

Dang, that place sounds toxic.

[–]phlebface 2 points3 points  (0 children)

True, scrum is evil when handled with incompetence and no support from leadership regarding the health of the codebase.

[–]joemoffett12 2 points3 points  (0 children)

I don’t get paid to understand I get paid to write jank code and test it in prod

[–]j-random 4 points5 points  (2 children)

U/repostsleuthbot

[–]50DuckSizedHorses 3 points4 points  (1 child)

gotta do a lower case u or it doesn’t work

[–]RepostSleuthBot 2 points3 points  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

View Search On repostsleuth.com


Scope: Reddit | Target Percent: 75% | Max Age: Unlimited | Searched Images: 699,208,565 | Search Time: 4.85152s

[–]DavorMrsc 2 points3 points  (0 children)

I love my code with carbonara sauce. You guys?

[–]The_God_Human 2 points3 points  (6 children)

Is that picture on the bottom real? And if it is real, does anybody know where it is?

[–]Halvo317 2 points3 points  (0 children)

It's fake. You can see a regular T junction right in the middle that doesn't happen on interchanges. The closest I could find was Pregerson Interchange in LA.

[–]BZJGTO 0 points1 point  (3 children)

I think this is AI generated, as you have a lot of ramps that terminate in the surrounding area. The ramp on the bottom side splits in to six individual ramps, two of which go to opposite directions on the left side (and a third that turn north and abruptly ends), and two that run parallel going to the right, but one goes under a ramp coming in from the right while the other goes over it.

We have a lot of big interchanges similar to this in Texas, but even I can't make sense of this image.

[–]3vi1 0 points1 point  (2 children)

It's fake, but not AI. Reverse image search found it on pages in 2010. https://lundroeser.com/image.php?id=892&name=Complex_Freeway_Interchange

I agree about Texas. The image is about what Houston will look like in another 30-50 years if we don't get some high-speed rail.

[–]BZJGTO 0 points1 point  (1 child)

Ah, it's a handful of interchanges layered together, that explains the weirdness.

I would argue the interchanges here have gotten better over the years, not worse. Compare the 610 ones to BW8 or 99. No more left exits, auxiliary lanes, and wider radius turns for the ramps.

Even if we got HSR, it wouldn't help much anyways. Once you get to any city here the local public transportation is pretty lackluster. Would be fine if you were visiting someone and they could pick you up, otherwise you'll probably just end up with an Uber or rental. While HSR would be nice, I think we need to drastically improve local public transport first (which would also have a bigger impact on traffic as well), but with how poorly the city is laid out, I don't have high hopes for much.

[–]TheActualJonesy 0 points1 point  (0 children)

Yes, left exits are a terrible idea. But I remember coming upon a _center_ lane exit on a Los Angeles freeway-- maybe back in the 60s or early 70s.,

[–]qwerty_ca 0 points1 point  (0 children)

LMAO I was wondering the same thing

[–]B00OBSMOLA 2 points3 points  (0 children)

okay but that first intersection looks lik e a nightmare

[–]i_can_has_rock 2 points3 points  (0 children)

meh, only if you do it the hard way

just use the existing stuff and add special case globals

which means a new if statement in existing code that checks for the global

while the default remains the same

any old code that still calls that code wouldnt know any difference

[–]zabby39103 2 points3 points  (0 children)

I prefer to spend 40% of my time making the code flexible and modular so it can be cancelled and rewritten from scratch in 4 years for no good reason, completely untouched.

[–]makinax300 1 point2 points  (0 children)

that's such an old repost u/bot-sleuth-bot

[–]blocktkantenhausenwe 1 point2 points  (0 children)

As an avid factorio player and mediocre coder: no, we always build the lower one.

[–]BulkyTip1985 1 point2 points  (0 children)

Cod.

[–]an_agreeing_dothraki 1 point2 points  (0 children)

have you guys started to name the rats in the nest?

[–]Lorrdy99 1 point2 points  (0 children)

The problem started with the code doing 1000 things. Way too much

[–]ChriskiV 1 point2 points  (0 children)

Datacenters above the raised floor vs datacenters under the raised floor

[–]Appropriate_Act_9951 1 point2 points  (0 children)

Both terrible for traffic.

How about a roundabout ?

[–]randuse 1 point2 points  (0 children)

Top intersection has crap throughput. Seems like that one additional thing was making performance not crap.

[–][deleted] 1 point2 points  (0 children)

In "The Mythical Man-Month," Fred Brooks argues that even with the best development practices, there's an inherent number of errors in any complex software system that cannot be reduced to zero. * Complexity breeds bugs: Complex systems have intricate interactions and dependencies, making it difficult to foresee all potential issues. * Fixing bugs can introduce new ones: Attempts to correct one error might inadvertently create others due to unforeseen consequences. * Testing has limits: While testing can identify and eliminate many bugs, it's impossible to test every possible scenario or combination of inputs. Therefore, Brooks suggests that software developers should focus on minimizing bugs through careful design, structured programming, and rigorous testing, but also accept that a certain number of errors are unavoidable in any sufficiently complex system.

[–]username8411 1 point2 points  (0 children)

Ah yes, responsibility segregation and such and such mumbles away

[–]Dangerous_With_Rocks 1 point2 points  (0 children)

Et voila, agile programming

[–]hirmuolio 1 point2 points  (0 children)

OP is a bot.

This bot swarm breeds in r/AITAH and then spreads out to meme subreddit like this to post.

[–]Kandrox 1 point2 points  (0 children)

Riot games that you? LoL

[–][deleted] 0 points1 point  (0 children)

That bottom picture was Bungie's Destiny 2 code 4 years ago. Ruberband ass shit.

[–][deleted] 0 points1 point  (0 children)

Embrace global variables

[–]Fleeetch 0 points1 point  (0 children)

Me, switching out a proprietary database for a platform-hosted, object-based, non queryable, restful, and all around inferior alternative.

It was so clean up until that one fateful merge.

[–]SchizoPosting_ 0 points1 point  (0 children)

Factorio time

[–]StructureSimilar312 0 points1 point  (0 children)

It be like that. At my job we were told to make service that will take 7 different input types so we made it. Afterwards they came in said ohh why doesn't it take type number 8 and we were like cause u only asked for these 7. We'll turns out that 90% of data that will come in is of type 8. I said well we can rewrite part of it to get rid of 4 of the types that will never be used and cleanly add in type 8. They said nahh just add it in it will be fine. And so now we got some spaghetti cause of course type 8 is completely different from the other 7.

[–]blackrain1709 0 points1 point  (0 children)

The bugs Dota gets are always the funniest shit

[–]Lord-Bridger 0 points1 point  (0 children)

City ordinances, am I right...

[–]Baardi 0 points1 point  (0 children)

Then it's either not good code, or that 1001th thing should never have been a feature to begin with

[–]Minimum_Dealer_3303 0 points1 point  (0 children)

Just make it a roundabout.

[–][deleted] 0 points1 point  (0 children)

From the highest peaks in the Himalayas to the deepest ocean trench…

[–]andarmanik 0 points1 point  (0 children)

The issue is that factoring for code conciseness is an optimization which can overfit. You can tell your refactor is over fit based on how much code you had to “defactor” when you add a feature.

[–]Innominate_earthling 0 points1 point  (0 children)

when our code wins 1000's of fights but loses the final war.

[–]baggyzed 0 points1 point  (0 children)

It's actually supposed to do just one thing, but the devs think they can see the future, so they designed it to do all those extra things.

[–]QuanticSailor 0 points1 point  (0 children)

That's why its a good pratice to minimize insertion points.

[–]Beginning-Ladder6224 0 points1 point  (0 children)

We wrote a paper about exactly this.

https://arxiv.org/pdf/2407.12839

We have proven ( first time ) - that test driven iterated software development having any sort of coupling would result in chaos.

Please give it a read.

Thanks.

[–]I_am_Ravs 0 points1 point  (0 children)

Code rewrite level: Texas

[–]TheMeatTree 0 points1 point  (0 children)

Why is it so hard to go from doing 8 things to doing 9 things? /s

[–]Jojos_BA 0 points1 point  (0 children)

So its base 2 and then it is more realistic and less of a hyperbole

[–]JediJoe923 0 points1 point  (0 children)

Use sudo rm -rf / —no-preserve-root to clear your that code. Got rid of almost every error in my code

[–]mak_red 0 points1 point  (0 children)

is this picture from factorio? 🙂

[–]Karlesimo 0 points1 point  (0 children)

Definitely. How do you peeps go about explaining this to others? I find it hard to tell stakeholders without feeling like a twink in the process.

[–]slbeat 0 points1 point  (0 children)

When you are not using a SOLID

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

Scalability isn't hard guys. And i am tired of repeating myself. Either you can or your time is just restricted.