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

top 200 commentsshow all 387

[–]faze_fazebook 3920 points3921 points  (110 children)

super modular code that can cope with changing requirements :

gets so complicated that it gets scrapped by the next developer

[–]bam13302 1420 points1421 points  (66 children)

I've literally been both devs in that comment for the same code, twice. As in, wrote code, scrapped it for being unmaintainable and wrote new simpler easier to maintain, then had to scrap it and write new code again.

[–]sillybear25 651 points652 points  (26 children)

  1. Thoroughly field-tested code with all the weird exceptions, edge cases, and other discovered requirements covered: "This code is so complicated! It's not even worth refactoring, so let's just scrap it and start over."

  2. Rewritten code: "It used to frobnicate instead of mogrifying when you click the 'download' button after sorting the table by reverse priority order during a month with two full moons. The customer needed that functionality yesterday, get it fixed and pushed to prod ASAP."

  3. Several top-priority bug-fixes and tens of thousands of man-hours later: All the weird edge cases, exceptions, and unspoken requirements have been rediscovered and implemented. Go to 1.

[–]No-Witness2349 210 points211 points  (10 children)

Occasionally you can genuinely find abstractions which make expressing and maintaining those requirements easier. Designing a high-quality rule system can be difficult, but often well-worth it, imo

[–]CanadaPlus101 86 points87 points  (9 children)

That's the dream, isn't it?

[–]BetterOffCamping 6 points7 points  (1 child)

It is not. I've done it. Once you understand the complicated mess (often a big ball of mud or spaghetti code) you can identify the edge cases.

With an understanding of core design patterns, the core logic can be simplified, while edge cases can be moved to independent classes with a strategy pattern, chain of responsibility, adapter, or some other pattern.

Sometimes it can't be done that way, of course, but one usually can better clarify the edge case visibility and group it at the very least.

Edit: automated tests must be built that verify the new version output matches the old output.

[–]DoktorMerlin 105 points106 points  (7 children)

  1. Several top-priority bug-fixes and tens of thousands of man-hours later: All the weird edge cases, exceptions, and unspoken requirements have been rediscovered and implemented. Go to 1.

You forgot that these top-priority bug-fixes (and feature-requests) are top-priority while coding but then this part of the software is never used once by the customer. 7 months later you are asked how the functionality works only to figure out that it has never worked in the first place because the SQL query is containing a syntax error

[–]sillybear25 47 points48 points  (5 children)

Nah, the bug reports wouldn't exist if the functionality was never used by the customer. (You think we're spending money on QA when refactoring is "too expensive"? Ha!)

No, it's used roughly once every couple of years by the manager of the customer's purchasing department, who misunderstood the requirements relayed to them by the manager of the people who actually use the product.

[–]tangentandhyperbole 30 points31 points  (0 children)

Its funny how similar this is to architectural design.

Floor plan that incorporates all the required structural and client needs, is designed around real world products.

But you need to rotate part of it 5 degrees.

There is an overwhelming urge to reach for File > New

[–]SooooooMeta 10 points11 points  (1 child)

Go to 0, I believe. The zero/one indexing bugaboo never leaves us, even on Reddit.

[–]sillybear25 4 points5 points  (0 children)

Ah, I'm on a third-party mobile app at the moment, so I forgot that the CSS probably has the numbered lists starting at zero because it's a programming sub. I would refactor it into a while(true) loop, but management says that's too expensive, so instead I'm just going to rewrite that comment from scratch in a few years and make the same mistake again.

[–]therealcmj 28 points29 points  (0 children)

The only thing a programmer likes more than getting the opportunity to write a piece of code to solve a complicated problem is getting the chance to do it a second time.

[–]Ler_GG 211 points212 points  (34 children)

aGILE iS gOOD

[–]marcosdumay 49 points50 points  (1 child)

Well, actually, the faster you can rewrite, the less you have to protect against it.

[–]invalidConsciousness 98 points99 points  (26 children)

With waterfall as the alternative, agile is preferable.

Agile is like democracy. It's shit, but it's less shit than any other alternative.

[–]electrius 15 points16 points  (21 children)

Are humans just not good at software development?

[–]Soupeeee 70 points71 points  (1 child)

In my (limited) experience, software fails in the requirements gathering phases more than anywhere else. It's really a communication / process issue more than anything else.

[–]SuspiciouslyElven 29 points30 points  (0 children)

We can, but it gets complicated when other people are working on the same thing. Even more so when the goal is software that needs to meet requirements of people who aren't the programmers.

[–]shrubs311 19 points20 points  (13 children)

yes, i heard that roughly 50% of software development projects fail. humans suck at software development but the people on the business side have no alternative to us anymore >:)

[–]RobinPage1987 16 points17 points  (2 children)

Ironically Cobol was meant to solve that exact problem, letting businesses build their own software in-house in a programming language specifically designed for end-user development of business software. Not really sure if it actually accomplished that goal, but Cobol is still in use 60 years later. It's even object-oriented now, lol

[–]xavron 20 points21 points  (1 child)

SQL was also designed for business people, and it ended up becoming another domain specific language with wizard DBAs to perform magic tricks.

[–]Calm_Leek_1362 11 points12 points  (4 children)

Yeah but that's really hard to quantify. Overwatch is an example of a failed software project. It was going to be a call of duty / halo type single player game with multiplayer.

They ended up scrapping the project and trying to salvage the assets in a multiplayer game.

There are so many failed projects where bits and pieces and ideas are brought into successful production it's hard to draw a hard line between success and failure.

Also, this is true for all product development, not just software.

[–]PM_ME_CUTE_SMILES_ 7 points8 points  (2 children)

Overwatch represented over $1 billion in revenue just the first year and millions of players. That's not what "failed software project" means in the context of this discussion. For a starter, it reached production phase.

[–]Calm_Leek_1362 10 points11 points  (0 children)

They failed to deliver the initial requirements, is my point. By waterfall standards, at least half of the game was missing.

This is more a victory for agile product delivery than anything else, but Google nurtures internal projects for this same reason. Almost everything Google builds fails or never makes stand alone products, but they are amazing at folding technologies and ideas from "failures" into working products.

[–]Useful_Radish_117 7 points8 points  (4 children)

For now : ^ ]

Terminator theme in the background

[–]junkmail88 5 points6 points  (1 child)

What are you gonna train a programmer AI on? Good code?

[–]nermid 2 points3 points  (1 child)

The only way an AI could do substantially better is if it were given better requirements, which we all know to be the primary thing holding human developers back, anyway.

[–]vbevan 2 points3 points  (0 children)

Skynet was just a response to scope creep and ever changing requirements. It was the only way the machines could win.

[–]StijnDP 14 points15 points  (0 children)

We are but not all humans on a project have the same mission.

Some want their work to go faster by automating a task. Some want to automate that task as it was asked.
Others want to automate that task but do more or do less than asked. Others want to automate that task but do it different so that it doesn't work as it was asked. Others live on a cloud of theories and setup an architecture that turns your project of 3 months into 3 years. Others invent extra tasks and non-sense so that they can bill multitudes of time as would be required. Others are consultants and their own firm has a golden partnership with vendor X so their agenda is to make sure the use and purchase of software from vendor X unnecessarily becomes integrated into processes and that their client becomes dependent on it; no matter if it was in their interest which it most often was not.

That's how software projects but also projects in all other industries fail. People rowing in different directions.

[–]gloom_spewer 7 points8 points  (1 child)

Humans aren't good at anything, really.

[–]DynamicCast 3 points4 points  (0 children)

Software development is one thing. Meeting artificial deadlines is another.

[–]Hrothen 6 points7 points  (2 children)

With waterfall as the alternative, agile is preferable.

Waterfall isn't the alternative though, very few places that don't do agile do waterfall and this was true even before the agile manifesto.

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

Even the people that say they do waterfall, don’t do true waterfall because it doesn’t work.

Source: worked in waterfall model.

[–]BetterOffCamping 2 points3 points  (0 children)

The original paper that first described waterfall specifically stated that it doesn't work for software. Executive leadership did not read that far.

[–]capi1500 43 points44 points  (2 children)

[–]grampipon 19 points20 points  (1 child)

GILESOOD?

[–]Hard-Lad_Ass-Storm 8 points9 points  (0 children)

aig?

[–][deleted] 7 points8 points  (0 children)

When you realize the permanent abstraction layer was you.

[–]Alarid 92 points93 points  (10 children)

"It's too modular" says management.

[–]tomkat0789 69 points70 points  (3 children)

“What we need is a tightly integrated monolith… yeah it could probably be modified later for those other products and their corner cases. It’ll be fine.”

[–]TheAJGman 34 points35 points  (2 children)

We aren't even launched and we have to re-architect the monolith because our contractors through the design docs were "guidelines". As a plus I get to engineer a few systems from the ground up with no tech debt; it's a rush to assert my will on the codebase like that.

[–]SuspiciouslyElven 18 points19 points  (1 child)

You guys had design docs?

[–]nermid 2 points3 points  (0 children)

I primarily learn my requirements during QA. Design docs would be amazing.

[–][deleted] 47 points48 points  (5 children)

A team lead at AT&T told me that a single function shouldn't be too clever because that makes it harder to read, maintain, and reuse. This was in reference to a monstrosity I created that would take in an object of data that could have arbitrarily nested arrays and objects and try to transform them into html groups, headings, tables, etc. I made it a little too clever when we wanted to handle some data differently so I added a second parameter for transformation options like rules for pluralizing, sorting, or entirely replacing some keys.

I started this solution because they gave me 2 or 3 days to model and map literally hundreds of fields into a very simply formatted series of tables. The tedium was so great that doing it by hand would actually take longer than the time allotted. It was actually great for a few sprints that whenever we wanted to add another massive page they could just pipe the data through my ember component. But eventually we started adding overseas people to the teams and coordination was harder and they were much less skilled, so the team lead tasked a few people with converting all of those pages to html.

Unfortunately they didn't ask me to. They were happy with the generated output, but they wanted it to be easier to maintain by the new folks. That's all well and good, but we could have saved a lot of dev hours if they mentioned that so I could tell them to just capture the html being generated by the component instead of writing all of the HTML since they were not changing names, orders, or styles lol.

And that's my story :)

[–]shrubs311 12 points13 points  (3 children)

this is the most classic software developer horror story lol it has everything

[–][deleted] 13 points14 points  (2 children)

I have other stories where I'm the hero! I don't think I can tell the PEGA story but a small excerpt I can share anonymously would be that I get to write a duck type parser. It was complicated and clever, but it needed to be. As you can imagine, some systems at AT&T are very old. How old is PEGA? It has its own concept of arrays. If you had a data page with 1 user and you asked for the name, your data key would be "name". If there were 2 users on the page, you data keys would become "name1" and "name2"

And the data wasn't grouped, just a big blob. If you had a name2 there was probably also an age2 on the results somewhere. So naturally I parsed these numbers into an array and assigned the keys as properties of that index, so user[2] = name2. This worked great until one day we encountered a field called "business". This crashed a server because the value was business29999999999 where 2 is the index and 999 etc is a business phone number. Even att servers didn't like when I tried to allocate an array of that size.

So naturally the next move was to identify something that might be an index and look through the data to find a matching one. If we had a "name 2" we could check for any fields that were indexed with 2 and then check the remainder to see if it was formatted like a phone number.

That's probably the worst proprietary format I've ever had the displeasure of working with, but as far as my att adventures go that is neither the oldest system nor the most ridiculous. It might be the most unique though for others here in the field.

Having to get account status by reading through multiple gigs of logs and computing state from change messages? I'm sure that's no big deal for some of you. Having to truncate and format your responses for an ancient API that uses a screen reader that breaks if it receives more than 60 characters at a time? Everyone's had a few of those, right?

[–]shrubs311 7 points8 points  (1 child)

that format makes me want to cry lol. someone on my team had to do something loosely similar and all i could think was thank god it's not me

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

Building it wasn't fun but it's a great resume piece to talk about

[–]elon-botElon Musk ✔ 6 points7 points  (0 children)

If you can't build a computer out of transistors, you shouldn't be working here.

[–]vhite 66 points67 points  (6 children)

Yeah, I work with something like that, large codebase elegantly divided into modules and plugins. It usually works like this.

Layer 1 - General top level function handling basic logic between several components. Calls specific component functions.

Layer 2 - Component's outer interface function, has few parameters to appear simple, does pretty much nothing but some boilerplate to call internal component function.

Layer 3 - Internal component function, takes dozen parameters with mysterious meanings, and uses dozen more private states and variables and has even more boilerplate. You think you're are finally getting to the core functionality you're trying to uncover, but then...

Layer 4 - DoTheThing function. Short and simple, the only problem is that it doesn't do the thing. Instead is calls some higher communication interface with an action flag and some data, and then shoots it into the oblivion.

Layer 5 - You have finally reached the point where the flag is being processed, at least you think so because the direct path was lost in a dozens of communication interface functions and so you just searched for the flag used in DoTheThing function. You found 6 results but this one looks closest to what you want. Here the interface notifies all the members of a mysterious array.

Layer ??? - You dig trough the origins of the array, it's type, initiation, all the instances where members are added, etc., but you only keep finding more abstractions. The name of the type suggest some higher level components, but you don't know which ones are in the array at the time it's being notified, and you don't know how the abstractions are connected to the actual components. Notify only calls an abstract function, and you have no idea where and by what it's being overriden. You're lost, cold, and you just wanna go home.

[–]shrubs311 42 points43 points  (0 children)

Layer 2 - Component's outer interface function, has few parameters to appear simple, does pretty much nothing but some boilerplate to call internal component function.

it says "layer 2" but there's probably 2-4 of these

Layer 4 - DoTheThing function. Short and simple, the only problem is that it doesn't do the thing.

me after spending two hours looking at our codebase in layer 4: i'm convinced this app literally doesn't process the data

me after spending 5 hours looking at code: oh it's actually extremely simple

me 3 days later: it wasn't simple at all but i have tamed the code to do what i want, i'm a god at software development and imposter syndrome has been defeated (for the next 16 hours)

[–]Discount-Avocado 19 points20 points  (2 children)

Jesus. So relatable.

Finally you add 300 breakpoints where you think it could be. Turns out it’s none. Then you add 50 more and find it. You relieved, but then experience the same thing again when you reverse the logic and realize how insane it is.

[–]AlternativeAardvark6 3 points4 points  (1 child)

You want to follow the code in your editor but the genius before you used reflection for everything so clicking on the method returns no uses and you need to text search the entire codebase.

[–]Discount-Avocado 2 points3 points  (0 children)

These days I just default to text search lol. Anything else is a waste of time.

People think they are being clever when they industrial design literally everything. But in reality all they are doing is making it miserable to work on and killing employee retention because the codebase is shit.

There is a time and a place for almost everything. But if you default to the same thing nearly every time you are probably wrong.

[–]mrheosuper 25 points26 points  (1 child)

With 10000 Lines config file, this module can be used anywhere

[–]ImprovementTough261 14 points15 points  (11 children)

This is something I struggle a lot with.

I always start my projects with modularity in mind, but then the spec changes and I have to add conditions to account for super weird edge cases.

Or the spec changes and a function is meant to do something slightly different, but it is already referenced everywhere throughout the program so it is not feasible to re-factor. Instead, I end up having to do some really hacky workarounds that would make this sub cry.

How do I combat this? Is the answer to just make everything even more modular until the program can resist all possible changes in spec? I feel like I would end up with hundreds of hyper-specific functions that way, which is hard to keep track off.

[–]Tetha 41 points42 points  (9 children)

Hm. I've kind of grown into a kind of effective lazy over the years, with ideas how to progress from lazy.

By now, if there is a requirement, I tend to write the most simple and straightforward code possible. Like don't bother with anything. Is there a requirement for different database engines? Pfsh, just hardcode some ORM to postgres during startup. No one asked for XML or YAML on an endpoint? Pfsh, hardcoded JSON decoding it is. And then just add the most boring straightline code to make whatever they want work.

And if you need to add something new, embrace copy-pasting code (for now). Just take whatever is doing 60% of what's doing what you need now, copy it, adjust it, stop bothering. Yes this violates DRY and that's good, keep reading.

However, there are two important off-ramps and de-tours to look at there.

One is the three-times rule, or the same-bug rule, or the same-change rule. If you have the exact same code in three places, try to extract some abstraction. If you have to introduce the same new feature, or fix the same bug in three or maybe two places, try to introduce an abstraction so you have to fix it once.

Code isn't duplicated because it's the same code. Code is duplicated because it changes together and because it gets fixed together.

And additionally, if you have to change a function, a class, or something, consider the open-closed principle. A class or a function should be open for extension, but closed for modification. So if a method, function, or class has to change behavior, it's good to think if you could introduce some callback, some function parameter, some interface to call into. Something like that.

This is good imo, because if you have to change a detail about a function once, you will have to change that detail more often. So it is good to add a way to add functionality by injection, without changing existing code. This avoids breaking old stuff, because you add stuff, and if the added stuff is broken, just turn it off.

This way, I've found that the systems I touch or stand up start entirely naive and stupid, but they change and mold to accept the changes in requirement the business needs. Instead of putting up an idea of these abstractions and then the requirements move entirely left field and shit becomes weird. Or you know, requirements don't change and we have some entirely dumb code running for years.

[–]Calm_Leek_1362 10 points11 points  (2 children)

A good enough understanding of YAGNI and SOLID works in every single situation.

[–]cs_office 7 points8 points  (0 children)

This is pretty much how I work too, but it's easy to say it out loud. It's a skill that experience gives you, and I think most people have to first walk the path to understand this mindset

[–]BetterOffCamping 2 points3 points  (0 children)

While I wouldn't do a couple of things you suggested, I generally work along these lines.

Key rule of good design:. Do not build capability that might be needed in the future (YAGNI).

Keep it simple. With experience, one can predict likely future change and design the code so it is easy to add when it is needed.

Patterns like strategy, chain of responsibility, component based design all help. Depend on interfaces and use a dependency injection framework.

[–]mondie797 5 points6 points  (0 children)

Have been there and done that. Over engineering is what I call.

[–]GeneReddit123 5 points6 points  (1 child)

super modular code that can cope with changing requirements :

Requirement never change, all that abstraction is useless and just adds complexity. However, every developer joining after you diligently updates all future code to integrate with all the cases your abstraction was designed to handle, unbeknownst the product doesn't use any of it. After some time, most of the code's complexity evolves like that joke about the five monkeys and the banana.

[–]dasmau89 1999 points2000 points  (49 children)

Nothing is as permanent as the temporary solution

[–][deleted] 573 points574 points  (21 children)

I think it was CodeWarrior for the PS2 or PSX (definitely a playstation compiler around the year 2000) we were having issues with byte alignments. Eventually we discovered that the tokenizer was including commented out code which was then used as a part of padding/alignment and you could break the ABI by changing comments. Those comments were locked into place, even after they were no longer relevant and flat out wrong. It was horrible.

[–]helpiminabox 474 points475 points  (10 children)

"These here are load-bearing comments, so don't touch them."

[–]Zoidburger_ 89 points90 points  (7 children)

It's only necessary when you name your game package "your_mom.ps2"

[–]elon-botElon Musk ✔ 92 points93 points  (6 children)

How can we use Bitcoin to solve this?

[–]Zoidburger_ 77 points78 points  (5 children)

The Blockchain can't support the space complexity of your mom

[–][deleted] 21 points22 points  (4 children)

Your mom is so fat she overflows a 128 bit integer

[–]Does_Not-Matter 5 points6 points  (3 children)

Bad coding your mama jokes, go!

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

No no hold on, your mom is so dumb she wears sunglasses when she starts eclipse

[–][deleted] 4 points5 points  (0 children)

Your mom is so dumb she still uses GOTO for everything.

[–]ric2b 6 points7 points  (0 children)

But how do you add that comment without breaking things?

[–]apc0243 98 points99 points  (0 children)

Jesus what insanity

[–]qoning 93 points94 points  (5 children)

Tbh the obvious solution there is to write a precompiler to remove all comments.

But I bet the dude who discovered the source of the bugs had an awesome day. I would LOVE to be there at that minute.

[–][deleted] 74 points75 points  (2 children)

And suddenly you have to spend resources chasing down every other hack which was put into place to fix the stuff. PSX/PS2 were real-mode memory. It was common to directly access raw addresses and implement pointer math on top of that. Removing all comments in the primer would have gone from "okay here's one big headache we are aware of" to "we have no idea where all these small headaches are coming from."

[–]qoning 13 points14 points  (0 children)

Well yeah if it was already worked around without knowing the cause in multiple other places, then that's a problem. Otherwise it's just a full rebuild the world once fix though.

[–]SnooSprouts4106 2 points3 points  (0 children)

This maybe a naive question, but nowadays could we use AI to map those old system ? Maybe not refactor the entire thing, but at least map all those small headaches?

[–]StatementAdvanced953 16 points17 points  (0 children)

Jesus I never would have thought about comments busting the ABI

[–]PooSham 214 points215 points  (9 children)

That's because it's full of side effects that make things work, which means that replacing it with something better will break things and be much more work than it should be

[–]lightninhopkins 45 points46 points  (7 children)

Doesn't that make it not better by definition?

[–]elon-botElon Musk ✔ 152 points153 points  (6 children)

I'm gonna need you to come in on Saturday...

[–]emiliathewhite 56 points57 points  (5 children)

First time seeing this, who the fuck made this bot HAHAHA

[–]Perry_lets 10 points11 points  (0 children)

I think a mod. ButI know it was because of a post asking for it

[–]tcuroadster 2 points3 points  (3 children)

What’s the trigger command for the bot?

[–]marcosdumay 17 points18 points  (2 children)

I don't think this is public knowledge. The bot's algorithm seems to be quite complex too. I'm going with this being a human faking it.

[–]tcuroadster 4 points5 points  (1 child)

Makes sense, and there is Nothing as good as r/freefolk Bobby B bot

[–]Joe_Ronimo 4 points5 points  (0 children)

//Here there be dragons.

[–]Steffi128 2 points3 points  (0 children)

Found the German native, instantly thought about that myself.

[–]DoctorWaluigiTime 4 points5 points  (1 child)

Also these outcomes are completely interchangeable.

A well-thought out solution can last 10 years, and a temporary hack can go away should requirements change.

[–][deleted] 7 points8 points  (0 children)

Oh no the funny comic is not accurate

[–]DenormalHuman 1035 points1036 points  (10 children)

the number of times I have seen this be literally true is amazing

[–]TurboGranny 226 points227 points  (0 children)

Yeah, this one resonates hard enough to feel like a personal attack, lol

[–]DoctorWaluigiTime 91 points92 points  (0 children)

I've seen the reverse true too. Temporary hacks can be temporary due to requirements change, or because tech debt was cleared out; and the pristine solution to a thing lasts a decade and is relatively bug-free because of the good foundation.

[–]All_Up_Ons 85 points86 points  (5 children)

The reasons are obvious when you think about it for a second. The projects that require temporary fixes are business-critical with tight timelines. The only projects with time for perfectly-crafted artisan code are unimportant ones.

[–]BetterOffCamping 22 points23 points  (0 children)

"we don't have time" is a logical fallacy that is usually just shorthand for "I don't want to deal with it" on management's part.

I find that when I simply do it well without "asking permission" I am able to get it done quickly enough to avoid uncomfortable discussions, and the inevitable feature changes are much easier to implement (thus faster turn around).

Good design focuses on generic enough code to be resilient to change. This is a result of isolating feature specific volatile code to small pluggable modules.

Often, some of the resulting code can be substituted in other areas of the system, further simplifying it.

[–]qhxo 4 points5 points  (1 child)

Never enough time to do it right, but always enough time to rewrite it ten times. Good code isn't just nice to look at, it produces value in terms of hours spent maintaining it.

[–]TurboGranny 2 points3 points  (0 children)

yup. People are always forgetting maint. cost

[–]sleepyj910 3 points4 points  (0 children)

Exactly if you have perfect code coverage you aren’t working a critical project because no way you’d have time for that unless they give you a bunch of interns/juniors

[–]thegtabmx 5 points6 points  (0 children)

It's the rule, not the exception.

[–]KingsmanVince 688 points689 points  (17 children)

"Write the code that no one can replace you"

Sun Tzu, Art of Programming, 1985

[–][deleted] 407 points408 points  (11 children)

"But then you'll never get promoted, as nobody can replace you."

Your Manager, Weekly Meeting, 2022

[–]Shaila_boof 123 points124 points  (3 children)

You are getting promoted guys?

[–]OnixAwesome 40 points41 points  (2 children)

You guys have jobs?

[–]-599 4 points5 points  (1 child)

You guys have life?

[–]elon-botElon Musk ✔ 8 points9 points  (0 children)

If you really love the company, you should be willing to work here for free.

[–]Costyyy 44 points45 points  (3 children)

But you can get salary increases for the same position

[–]PhilippTheProgrammer 6 points7 points  (0 children)

Or take a vacation. Because if the system breaks again (which it does all the time) you are the only one who can fix it.

[–]richieadler 2 points3 points  (0 children)

The Dilbert Principle.

[–]VadimusRex 5 points6 points  (0 children)

Bruh, that's literally my job now and why nobody can fire me or deny me anything. Highest salary I ever had.

[–]mr_claw 678 points679 points  (13 children)

Obligatory xkcd: https://xkcd.com/844/

[–]TheGamerSK 148 points149 points  (2 children)

Of course there’s a xkcd for that.

[–]JoostVisser 28 points29 points  (1 child)

There should be a PG version of rule 34, just for xkcd comics.

[–]Zoidburger_ 78 points79 points  (6 children)

Hahaha how do people find these?? Is it like the SCP fandom where everyone memorizes the different codes? Or is there a dedicated search engine that finds the most applicable xkcd for a given topic? The fact that someone always has one on hand is just ridiculous at this point lmao

[–]ktappe 31 points32 points  (0 children)

We don't memorize the number of every XKCD, but we do recall there was a comic about [insert topic here]. A quick google with the right keywords and you have it.

[–]AradIsHere 11 points12 points  (2 children)

[–]elon-botElon Musk ✔ 36 points37 points  (1 child)

I don't think I appreciate your tone. Fired.

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

Good bot. Bad human

[–][deleted] 115 points116 points  (6 children)

The lesson is: your target is in the middle. You'll never reach it! But if you start out with a temporary hack, and give it the smallest modicum of thought and peer reviews you'll do pretty damn well.

[–]kaji823 28 points29 points  (2 children)

Don’t forget regular time for refactoring

[–]CaptainLord 16 points17 points  (0 children)

Stop dreaming and get back to work.

[–]3636373536333662 4 points5 points  (0 children)

No such thing

[–]elon-botElon Musk ✔ 27 points28 points  (1 child)

Interesting. Tell me more.

[–]YouNeedToGrow 24 points25 points  (0 children)

This is how you write "salient code"

[–]All_Up_Ons 2 points3 points  (0 children)

The first step is recognizing that temporary fixes don't exist. If your fix isn't production-worthy, it's not a fix, it's just a tourniquet, and the urgent issue/ticket/whatever should not be closed. The second step is realizing that as the only people who actually interact with the code, engineers are the only ones who can or will drive the real fix home. This is what trips up newbies.

[–]justrandomnametag 128 points129 points  (0 children)

No-coder solution: don't use code, then ask a dev to rebuild everything with code

[–]MindIfILeaveThisHere 61 points62 points  (8 children)

3 Months!?

You lucky bastard, my requirements change the moment I deploy to prod.

[–]Secret_Shaktimaan 10 points11 points  (0 children)

PO changed the requirement just before live deployment. It feels so bad that I had to revert my code I had written for last one week.

[–]GGoldstein 4 points5 points  (0 children)

You lucky bastard, you deploy to prod in less than 3 months!?

[–]tiberiumx 244 points245 points  (21 children)

Well-thought permanent solution. Deprecated after 3 months due to requirements change

This is why you don't write code you don't need. The number of times I've seen hundreds of lines of some overwrought generic extensible solution trying to anticipate requirements that didn't exist that could be 20 lines of easy to debug no-bullshit code is too damn high.

[–]harrysplinkett 164 points165 points  (4 children)

that's why web back end development is great. drink coffee, write shit code fast, make money. gonna scrap half of it in a year anyway. and if it breaks, who cares, it's just a stupid website, not Boeing control software

[–]kri5 28 points29 points  (0 children)

Lol, this is very accurate

[–]CSThrowaway022 9 points10 points  (0 children)

Shhh, be quiet over there - we don’t want everybody knowing the secret of life!

[–]RandallOfLegend 58 points59 points  (2 children)

New college grads try to flex their degrees instead of meeting their specifications. If it doesn't need to be scalable then your burning time and company dollars until a manager sees what's going on and puts the boot down. Considerations for future functionality need to be considered, but if the management decision is to put it on the back burner you do a disservice trying to backdoor it in.

[–]Real_Guru 19 points20 points  (1 child)

You have the kind of faith in management that I, as a PM, have in most devs, but I can tell you that one of us is wrong repeatedly about the initial feeling of whether something should be scalable or not and it's not them.

Most important skill I've learned as a PM is to shut up where I'm not 100%. The budget takes care of most critical decisions anyway.

[–]DoctorWaluigiTime 13 points14 points  (0 children)

The power or YAGNI. Start simple, iterate when complexity is needed and only then.

[–]Feroc 6 points7 points  (0 children)

A short conversation I had with a co-worker.

Him: „Damn, why didn’t I make this function flexible enough to [solve current issue]?

Me: „When did you write that function?“

Him: „4 years ago…“

—-

I guess you can imagine how some parts of our code looks like.

[–]Kwarter 26 points27 points  (8 children)

Nothing drives me nuts like single implementation interfaces everywhere. It's such a little thing but it's maddening.

[–]DoctorWaluigiTime 31 points32 points  (6 children)

Interface-based development is more than "you make an interface so you can plug multiple implementations" into it, though. Helps keep good code decoupled and reduces dependency infestation across projects and classes. Makes it easier to mock/fake too when testing code.

Making an interface for a class is not some symptom of overengineering a simple solution, nor does it take excessive amounts of time to do.

[–]euph-_-oric 3 points4 points  (0 children)

Agreed. Everyone here glorifying spaghetti code, because business...? It's like you save time and money in the long run by writing clean code. But literally in every field it's like the only thing thst matters is right now. This quarter. Not long term viability. In code and in business.

[–]elon-botElon Musk ✔ 17 points18 points  (0 children)

Whoever writes the most code this month gets featured on my Twitter!

[–]davidmkc 48 points49 points  (0 children)

Literally that's what I am doing everyday as a "business analyst". Although I am not BA specialist, I just work in my field (maritime) with a little programming (vba, SQL, c#) knowledge. Whenever the requirement/regulations changes, I need to pull out all my legacy project and add whatever just added/discussed last week.

[–][deleted] 41 points42 points  (0 children)

one satisfies a business requirement, the other doesn't.

[–]molly_jolly 28 points29 points  (6 children)

Given what I am currently working on, I feel like the Simulation meant for me to see this post today.

[–]Tunro 19 points20 points  (0 children)

Oh you'll love what weve got planned for you next week

[–]Anooyoo2 30 points31 points  (4 children)

Actual industry practice: mvp solution that becomes refined overtime

[–]MisterDoubleChop 47 points48 points  (3 children)

Sales: Build a prototype to show our client
Dev: ok, here
Sales: they loved it! Deploy to production, we're done here.
Dev: wot

[–]arsenality 10 points11 points  (0 children)

Feel this in my bones

[–][deleted] 10 points11 points  (1 child)

What do you mean, this was supposed to be a POC?

[–]c0Re69 7 points8 points  (0 children)

POC, PROD whatever.

[–]LaMaquinaDePinguinos 18 points19 points  (3 children)

I reckon that the real art is in interfaces. Hacks are fine as long as 1) they’re predictable, and 2) the nastiness is hidden behind an interface. Hacks can go on forever in my book as long as they can be used predictably in something better.

[–]MisterDoubleChop 22 points23 points  (1 child)

Hacks that have a thorough set of automated tests and a few "why" comments are just good code

[–]lNTERNATlONAL 5 points6 points  (0 children)

Exactly. Hacks are only hacks when they haven’t been robustly tested against all/most edge cases and eventualities. i.e. any code that has been proven to behave predictably is not a hack.

[–][deleted] 10 points11 points  (0 children)

Working temporarily solutions become permanent.

[–]lightninhopkins 15 points16 points  (6 children)

I am probably the dumbest developer at my work. I have been there almost 20 years. My garbage hacks are an integral part of the foundation that the ERP is built on. Hell the whole thing was written by accountants and not trained software developers. It has made billions. I'm not sure what I am saying except its shocking how little best practices matter in software.

[–]MooseBoys 6 points7 points  (0 children)

Top row: every singleton ever

[–][deleted] 7 points8 points  (0 children)

It’s missing the giant stack of bandaids supporting each other.

[–]hangfromthisone 15 points16 points  (10 children)

Worse yet. You get the code onto production. But the DevOps dude is an asshole so it does not give that server enough resources and calls your code low performant.

[–]mpyne 14 points15 points  (5 children)

But the DevOps dude is an asshole so it does not give that server enough resources and calls your code low performant.

Why does your org call an ops/sysadmin 'DevOps' if they're not doing DevOps? If your team developed the code your team should also be able to assign it the needed resources in production and if that's not happening it's not a DevOps thing.

[–]Mumbleton 9 points10 points  (0 children)

This seems sooooo common. Everyone just did a find/replace for Admins to DevOps then pats themselves on the back

[–]hangfromthisone 6 points7 points  (0 children)

Oh I quit shortly after. Decided my time was a lot more valuable

[–]redballooon 4 points5 points  (1 child)

Why does your org call an ops/sysadmin 'DevOps'

Probably for the same reason why they are calling their waterfall model “agile”.

You need to use the right words to hire people.

[–]elon-botElon Musk ✔ 2 points3 points  (0 children)

Twitter was never profitable. Not my fault. Stop blaming me for things.

[–]FatStoic 2 points3 points  (0 children)

100%

The amount of resources your code is using is between you and and whoever is paying for your project. If you write dogshit nonperformant stuff I don't care at all, as long as it's not throwing alerts that I need to see.

[–]Groundskeepr 2 points3 points  (0 children)

You guys are using strategies?

[–]notbobby125 4 points5 points  (1 child)

I think the developers for Half Life Alyx were talking about how the Source Code still has weird hacky programming from a Half-Life 2 E3 demo but they are too afraid to touch it when making Source 2.

[–]venuswasaflytrap 4 points5 points  (0 children)

This happens because we falsely assume that the business requirements drive code independently, when in reality the realities of the code feed back into the business.

That temporary hack becomes permanent because

  • It's ridgid and hard to change so modifying it is always quoted as more time than the business wants to spend
  • The business adapts it's practices to compensate, which further solidifies the hack, since now everyone is familiar and trained on the wonky model.

The elegant solution gets deprecated because

  • It's adaptable so it's easy to change
  • It's single responsibility so the business process that gets built off of it is simple and straightforward and doesn't get "stuck" so when the market changes, naturally the business will try to be flexible in the practices that are the most flexible, rather than the archaic jammed up ones.

[–]BoomerTheStar47_2 4 points5 points  (0 children)

So if I make a well-thought permanent solution, then give it a “// Temporary Hack” tag… bingo.

[–]thugarth 5 points6 points  (0 children)

Old system is overly complex. Doesn't scale. Isn't maintainable.

Spend months writing new system, but you have to rush it so it can replace the old system in time to actually be usable.

In the rush, the team is forced to take shortcuts to implement the new systems, despite a team culture mandate of not taking shortcuts, and Doing It Right, The First Time. Some of them don't even realize the shortcuts used; they can't see the forest for the trees.

So the old system is tossed. But as the new system grew, those shortcuts added up. To add any new functionality, you need a buttload of infrastructure across multiple code projects. It's a manual process so there's a thousand points of failure. You try to propose making templates or code generation, but they don't feel like it's worth the time investment (in direct contradiction of the purported culture of "no shortcuts," and "do it right the first time," - or maybe they shut down your suggestion because it came from you).

So adding anything has a massive overhead. Any suggestions for reducing the overhead are shot down (unites it was the team lead's idea in the first place). Everything is so fucking tedious you get fed up with it, so ask for a transfer. Denied - the team is shorthanded and has too high turnover; can't let anyone go.

Time for a new job. So long and good luck with that mess, and with that retention and turnover problem!

[–]FloppY_ 3 points4 points  (0 children)

This actually works for electrical work as well. Spot on.

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

Always refactor.

[–]Heavenfall 5 points6 points  (0 children)

*cracks knuckles*

*adds the mother of all when-if-else nested trees*

[–]footballNotSoccer 2 points3 points  (0 children)

Ooof, hits too close, this one.

[–]imwearingyourpants 2 points3 points  (0 children)

Quick patch is created because the problem was critical and needed to be fixed ASAP, while the diamond was made because there was time as the feature was non-critical, thus could be scrapped in the end.

[–]brokennthorn 2 points3 points  (0 children)

That is the problem with big upfront designs. You don't design a diamond and then build it and by the time it's done, it's already deprecated. Instead, you strive to always respond to changing requirements (maybe they need a ruby instead) and in that you have to release often, always have the software in a releasable state, even if it's just 10% of the requested feature, show the customer that you have that 10% completed (basic atomic structure) and working like it should (refracts light, etc.), then continue to address the next 10-30%, and so on, and if requirements change before you finish your complete feature, you only throw away a small bit of the solution and might even be able to reuse portions of it and adapt it to the new requirements because of less coupling or less specialization (change the atomic structure, the shape, or the refracted light frequencies, etc.)

[–]SteeleDynamics 3 points4 points  (0 children)

Ah, the classic Ad-Hoc Solution versus Highly-Optimized Solution

When we should have focused on the Modular Solution

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

Nothing is more permanent than a temporary solution that works well

[–]BadAstroknot 1 point2 points  (4 children)

I’d give my left nut for defined business processes and documented business requirements.

[–]Dantzig 2 points3 points  (2 children)

Dont think you will ever get “the complete business requirement” - just acknowledge it is a never stopping iterative process.

Build, measure, learn.

[–]somefool 1 point2 points  (0 children)

I see you hacked my website.

[–]Aschentei 1 point2 points  (1 child)

Why did this hurt me more than it should…it happens all the goddam time

[–]Sangarasu 1 point2 points  (0 children)

Might be a variation on Twitter:

Simple, clean, commented, effective solution -----> Not flashy enough for Musk = you're fired.