Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "spaghetti mess"
I’m a senior dev at a small company that does some consulting. This past October, some really heavy personal situation came up and my job suffered for it. I raised the flag and was very open with my boss about it and both him and my team of 3 understood and were pretty cool with me taking on a smaller load of work while I moved on with some stuff in my life. For a week.
Right after that, I got sent to a client. “One month only, we just want some presence there since it’s such a big client” alright, I guess I can do that. “You’ll be in charge of a team of a few people and help them technically.” Sounds good, I like leading!
So I get here. Let’s talk technical first: from being in a small but interesting project using Xamarin, I’m now looking at Visual Basic code, using Visual Studio 2010. Windows fucking Forms.
The project was made by a single dev for this huge company. She did what she could but as the requirements grew this thing became a behemoth of spaghetti code and User Controls. The other two guys working on the project have been here for a few months and they have very basic experience at the job anyways. The woman that worked on the project for 5 years is now leaving because she can’t take it anymore.
And that’s not the worse of it. It took from October to December for me to get a machine. I literally spent two months reading on my cellphone and just going over my shitty personal situation for 8 hours a day. I complained to everyone I could and nothing really worked.
Then I got a PC! But wait… no domain user. Queue an extra month in which I could see the Windows 7 (yep) log in screen and nothing else. Then, finally! A domain user! I can log in! Just wait 2 extra weeks for us to give your user access to the subversion rep and you’re good to go!
While all of this went on, I didn’t get an access card until a week ago. Every day I had to walk to the reception desk, show my ID and request they call my boss so he could grant me access. 5 months of this, both at the start of the day and after lunch. There was one day in particular, between two holidays, in which no one that could grant me access was at the office. I literally stood there until 11am in which I called my company and told them I was going home.
Now I’ve been actually working for a while, mostly fixing stuff that works like crap and trying to implement functions that should have been finished but aren’t even started. Did I mention this App is in production and being used by the people here? Because it is. Imagine if you will the amount of problems that an application that’s connecting to the production DB can create when it doesn’t even validate if the field should receive numeric values only. Did I mention the DB itself is also a complete mess? Because it is. There’s an “INDEXES” tables in which, I shit you not, the IDs of every other table is stored. There are no Identity fields anywhere, and instead every insert has to go to this INDEXES table, check the last ID of the table we’re working on, then create a new registry in order to give you your new ID. It’s insane.
And, to boot, the new order from above is: We want to split this app in two. You guys will stick with the maintenance of half of it, some other dudes with the other. Still both targeting the same DB and using the same starting point, but each only working on the module that we want them to work in. PostmodernJerk, it’s your job now to prepare the app so that this can work. How? We dunno. Why? Fuck if we care. Kill you? You don’t deserve the swift release of death.
Also I’m starting to get a bit tired of comments that go ‘THIS DOESN’T WORK and ‘I DON’T KNOW WHY WE DO THIS BUT IT HELPS and my personal favorite ‘??????????????????????14
In my previous company, I used to work for a client company which had a terrible website. It was about financial data and people would have to wait too long before the page loaded because there was a freaking 1.2 megs of minified, compressed JS file that needed to load before you could do anything.
Everyone knew that was a pain in the ass and nobody wanted to touch spaghetti code and mess up something they didn't know.
I wanted to however take a shot at it. So an architect from client side and I discussed how we were gonna go about it and how we were gonna find the stuff that needed to load on page load and stuff that could be loaded later.
So we plan for it. We broke everything down from a globals polluting JS, found out the variables and functions that needed to run during first load by literally putting a console statement for each function and finally came up with two bundles.
The primary bundle was 120kb and would during first load and then every module would call it's own secondary bundle when the user interacted with it.
In the process, we removed half a meg of JS and the site became blazing fast.
I did it with a team of two members who, my manager thought were useless, learned a ton of stuff, setup proper process for the transition.
When the client didn't appreciate the amount of brain and effort we had put into it, these two members came forward to tell the client to acknowledge my effort and attributed the success of it to me.
I was totally moved. There was so much respect that I didnt care what anybody else thought. I was just so happy to work with those two humans.
When i left the company, i gifted them stuff they always talked about or wanted. :) Feels good.2
Guy from work: "I have a messy coding style ¯\_(ツ)_/¯".
No, you have a bad coding style. Your repetitive uncommented spaghetti code isn't an artistic expression of your quick imaginative mind jumping from thought to thought. It's a horrible mess that shows me that either you can't do any better or you don't care.8
So this bunch of idiots made this huge iOS app using lots of global variables, lots of spaghetti code and basically no separation between logic and UI.
Another bunch of idiots were told to take that iOS app and basically port it to Android. And they ported that same code mess, almost line by line, and adding some weird shit.
Now the HQ of the first bunch of idiots realize that the second bunch of idiots were too slow/inefficient/whatever, and they're now asking US to solve that Android mess and add another shitload of features.
The worst part of it, is that both bunches of idiots are still working on it, so we're basically forced to follow the same shitty style until the first deadline, otherwise we'd die suffocated by stinky merge conflicts. Which will happen anyway because our changes are going to overlap.
Oh, and the PM refuses to understand the disaster coming and there's six hours of time zone difference.
Fuck this shit.7
That feeling when you refactor that spaghetti mess into clean beautiful code that passes all tests flawlessly4
Classmates having trouble with their mess of spaghetti code and improperly named variables (I saw variable names like "poop" already).6
When someone you know asks for a favour..
"Hey I have this wordpress website & heard you know PHP, could you help me out with this 1 plugin? :)))"1
Look, I'm not even mad that your dataset is the spaghettiest of all spaghetti, but why do you have ten different jupyter notebook files lying around?
I mean, I'm not implying that a monkey has more brain in his armpit than you have in your entire body, but like, you call this a dataset while all over seen so far is half-processed garbage. You could've just dipped your pc in sewage and the results would still be cleaner than this.
Luckily, your paper is half decent so what the hell, let's see if I can fish anything useful out of this. But I swear to god if I come across another static path in this... And here we go! Another static path! Ladies and gentlemen, I propose we get this guy's phd back until he learns to fucking do a decent code.
(It's actually a massively complicated project, so it kinda makes sense to be this big of a mess. But still!)11
Computer Science student here, and it looks like my group partners have no idea what keeping classes short and straight to the point means.
The project is in C++, and I'm trying to understand this mess that they made, when they have a class called "Manager" that basically did EVERYTHING, whose header file has only the declarations of functions. 50+ functions. Only half of then documented, and most of them with apparently random names. The file has more than 200 lines of reading.
I've never worked with so much Spaghetti in my life yet.
Worst part: I spent time and effort organising some other classes, breaking down methods, untangling code and all that tedious stuff. But one week before delivery, they decide to delete all of my work, because they "didn't understand it" and didn't even think of asking me to explain the changes.
And if that wasn't enough, they refused to give me some percentage of the grade due to that code not being in the delivery.
I am so freaking done with those guys -_-12
Has anyone used PHP unit with Selenium before?
I have a.. well words can’t explain it nice enough but, beyond a joke, not even funny, spaghetti code base I’ve come to inherit recently, which god help me, doesn’t follow any design patterns at all, it’s just a stamp this here, staple this down over here and throw paint at the wall and hope it sticks.
It’s a mixture of procedural and functional with the rare class kind of mess.
So attempting to refactor by any means is not a real possibility without some kind of behavioural testing in place first otherwise I know I’m going to end up breaking something somewhere and not even know it.
Also if anyone has had the privilege of such code bases, tips to dealing with the mess are appreciated.
Oh and no, I can’t rm -rf or start again.😭3
I was asked to transfer a spaghetti Android/iOS project to xamarin for a bank client yesterday because "that's what they use".
This is a crm/loyalty app that has been around for 2+ years now (you can imagine the mess). On top of that I have no knowledge of c#, .net or xamarin.
So I ask: "When is this supposed to be delivered?"
Boss: "It was scheduled for 2 weeks ago but let's say 2 weeks from now"
Me: "..... This is a huge remake it won't be even close to ready in 2 weeks"
Boss: "Let's check on the progress in 2 weeks and see how it goes"
Why is it hard for bosses to provide an actual timeframe???
He's been pulling the same crap with junior devs for years and of course they get nervous and create more spaghetti code...
Anyway long story short (not) I have an interview Monday!
Let's hope it's not more of the same!
P.S.: to junior devs: When you are given a deadline... IGNORE IT.5
The moment when you are too scared to make any needed changes in your code fearing you will untumble all the structured mess of spaghetti code you have written... 😳😨😕5
Valve is definitely on drugs, their items file is a complete mess.
... more data ...
... more data ...
We are at the end of the school year, at least in France.
This is my recap of this shitty year.
My school try to teach programming, and that’s just a try.
Some of the dudes do not event know what a variable was.
For a second year university diploma, they don’t teach OOP, no Git, no DP, no JS, no clean code or whatever.
So at the end of the year, you’ll be able to code in procedural, no versioning, spaghetti code and a big mess in folder structure, lack of interactivity because of poor JS knowledge.
Well a codebase which makes you crying blood, literally.
And that’s what a second year university diploma ...
Fortunately for the most curious there’s so much to learn out of the school but, damn, why are some schools so retarded ?
For almost 8k€/year you just receive a piece of paper and you’re still a shit in your *suppose to be* job.9
There was a task of fixing up a payments page that features pretty complex logic. Initially it was like 200 lines of code, seems short but it was a fucking spaghetti mess. Never seen more cognitively complex code in my life.
So I delete the spaghetti and pull out the 500 lines fucking state machine. It works perfectly. It’s perfectly understandable even though it’s longer.
This is how I deal with problems. Shorter code isn’t always better code.4
Wish me luck. I am done with the spaghetti mess.
There is a stock management system written using laravel and jQuery. There are mistakes in database structure. There are lots of I-dont-know-what-this-function-do-so-i-should-leave-it-alone codes. There are lots of repeated and duplicated functions.
Gonna start things from scratch and will also start using vue. This week's Thursday and Friday are public holidays here. I hope I can code my ass off and finish the migration/refactoring/cleaning shit by Sunday.1
300 global variables.. THREE HUNDRED FUCKING GLOBAL VARIABLES?
Are you for real?
Now let me check the line numbers again..
hmm.. line 97 to .. yep line 410, just a few new lines to seperate some of them or.. group? Idk, I've given up on trying to understand those.
Now you may ask "But ThatPerlDeb, where did you see this and what was the intention?"
Low and behold, take a chair and I may explain this to you.
First of all: Fuck the dev that wrote this!
Second: Fuck all the devs that kept up with this practice or whatever you want to fucking call this!
Now, the application is our POS system that our customers can use for a monthly fee (That this piece of garbage even requires payment is disgusting) but anyway..
The global variables sometimes are declared for labels, sometimes for some frames, sometimes just for random values to be there.
We're using Perl for the POS system and Perl ain't the best at OOP, so in the dev's defense I can understand why you'd use a few global variables, but not fucking 300!! FUCK OFF WITH THIS BULLSHIT!!
So now I'm going through this torture slowly but surely deleting globals and putting them into some sort of scope and always MANUALLY test if something broke. Again, this company sucks ass and there's nothing that could even be considered a "unit test" or something like that, so fuck that, too.
After two hours I've brought down the count of global variables to about 260, so there's progress being made..
But then, there comes more!
"But how???" you may ask, and you're right, I've asked that myself.
Now to resolve the global stuff in each file some of the initial globals are used, we got about 20-30 files which do different stuff, all fair and square, at least there was an attempt at seperating functions but god this mess is so fucking fucked up. So in order to "safely" delete a global variable I have to check if any of the variables are used in another file, and if so, in which scope and how they are used.
Spaghetti would be a compliment for this fucking disgusting piece of utter bullshit.
Let alone the code quality of this "code"
Indendation? Dafuq is dat?
Scope? Nah, we got everything global anyway
Function size? Well, some are 5 lines, some are 900 lines, who cares anyways, right?
I'm so fucking glad once I leave this shithole, for real.6
To the JS devs (not all of course, but to many of them), look here: ;
Is it so hard to do? ;
I feel like you don’t use semicolons just to mess with non-JS devs...
Just because it works without, doesn’t mean it shouldn’t be used...
It’s as if i would stop using dots Just because I can it doesn’t mean it’s the way to go
It’s just making it more complicated for others to understand
Especially if the code looks like the spaghetti monster vomited into the IDE!21
Anyone remember my rant about Go and GTK? Well, the main problem was that it was 3 AM, I've since completed it, and have begun to refactor that spaghetti mess.
I feel so good right now.5
To the 8 months ago *me*.
You're an idiot learn how to properly keep a changelog I just spent almost an hour fixig that freaking spaghetti mess you wrote!1
Drupal makes me want to go back to the moment that life first crawled out of the ocean, and shoot that first land-dwelling organism in the head – just to make sure that the animal kingdom never evolves to the point where a crime as ghastly as Drupal can occur.
Drupal somehow manages to be both unforgivingly, bureaucratically rigid, and an anarchic, spaghetti-coded mess – at the same time. Other frameworks are toolboxes. Drupal is a series of windows at the IRS or MVA – and it *will* take you days to figure out which series of forms you have to submit, with which boxes checked, in order to accomplish your goal.
The documentation is complete and utter trash.
It models content in a way that makes all sorts of assumptions about your use case. And those assumptions don't have anything to do with *how websites are actually designed and built*. In 20 years of building websites, I've never *once* wanted to use anything resembling the bizarre data model that Drupal *forces* you to use. Nor have I ever thought "gee, I wish my platform forced me to stop writing code every 20 seconds, so I can use an atrociously designed point-and-click interface".
I ask the community how to accomplish [insert extremely fucking basic task here], and they say: "well, you just install these 17 modules, glue them together with a bunch of configuration that couples your database to your code, and then shrug at the hideously broken HTML/CSS that comes out, because we give exactly zero shits about UX! isn't it great how Drupal makes things so easy?" Like, no – literally *every other framework on the planet* allows you to accomplish the same thing with just a few lines of code.
Most of the community seems to have little or no experience with other frameworks – so they seem solipsistically unaware that these are even problems. If your platform has been stabbing you in the arm for as long as you've been building websites, then you're just gonna assume that being stabbed in the arm is part of developing websites, you know? They seem oblivious to the fact that things are *so much easier* when your platform just lets you build whatever abstractions you need, instead of forcing its own weird-ass, undocumented assumptions on you.
Uruururrrrrrrggghgh. I can't understand how anyone defends this piece of garbage. If you're a Drupal developer reading this – please, for the love of God, try learning another framework. Once you've spent a couple of weeks learning saner ways of doing things, you'll never look back. I cannot comprehend how Drupal is still a thing.4
My Boss Abuses me, should I leave my job?
I overheard this tidbit on a bus recently. Okay I'm lying. But in the great spans of
time I've spent reading "dear annie" type articles, many involving how often my meth head step dads beat me while growing up, or in turn how often *I* beat me (oh yeah)..I've come across this in one form another, this, and other dumbfuck questions from the stuttering meek and halfhearted.
They say there are no dumb questions. Well, like that guy who smoked too much weed and
asked "what is the sound of one hand clapping?" (fap fap fap), there are in fact dumb questions.The world is overflowing with them, like a clogged shitter full of tacobell and glitter covered brown gutter wisdom. And it smells like roses, if roses smelled like shit.
Questions like "How do I make sure my cats don't feel lonely once I have my first child?"
I don't know, they're fucking cats. Did you even google this before asking?
"How to make spaghetti?"
Really, is this question written by a bot?
All of them and none of them. Welcome to hell.
"Whats your favorite color?"
My answer: I'm not five years old any more. And obviously you are. Why are you on this site instead of eating crayons at daycare?
Yes indeed, this and many more dumbfuck questions await you and can be found on the preeminent quora, amongst other sites.
A place, which censored an eminently reasonable answer of mine (I was totally not being a shithead btw).
I responded in kind by removing a whole mess of long form answers of mine.
What I have learned from the experience is this: Humanity is greatly comprised of many people who, having no brains to speak of, wander aimlessly like beasts of the field, glass eyed and slack jawed, in search of a savior. But their savior came a long time ago, once, and many times before. An engineer, or programmer, or perhaps in another reincarnation a guy parting a sea of koolaid after the local ruler swindled his peeps out of another payment for moving some heavy ass stone blocks, but I digress.
And in response to peoples worries, anxieties, everyday problems and concerns, every one of these would be wiseman, every one of these saviors, leaders, and great men spoke these magic words which resonate now down through the ages like the voice of reason and providence:
"Read the FUCKING manual."
"And don't bother me again asshole." (well this last bit is all me, but I'm sure others said it too.)2
90% of my time at work is spent debugging and fixing a horrible mess of years-old legacy spaghetti. The only "real" coding I do is my personal hobby projects at home.3
Me and the lead developer of my team gave a long and detailed explanation to our manager entailing the current state of a budge program our workplace uses.
This app has been bugging him for a while, he did not write it and has not been given an opportunity to rewrite the damned thing. Its a really...really messy application, and whilst it is a functional one it most certainly is NOT an efficient one since adding or moving things only incites more spaghetti mess.
We were laughing while giving our report, but both of us were crying inside. The main thing is, we both love PHP and the things he has built are very well structured and efficient, he has good technique, but will admit at certain caveats regarding the way he structures his dbs stating that he always has to do changes, which hey, its the nature of the beast, dbs change all the time. But our issue with php is the same: it lets beginners write monstruosities that are harder to do in other environments.
It really is a permissive language. But I reckon thay such lax nature is better left at the hands of the more experieced developers that know what they are doing.
Either way, we will restructure this motherfucker taking advantage of the new standards (which both of us are well versed in) and applying a more structured approach with a nice frontend interface (we be looking at Vue.js and React although we are considering Angular as well)
Gon be some good times.
Not a specific bug, but I always have that satisfactory feeling when I fix a bug inside a code like this:
1. Spaghetti af
2. Duplicated af
3. Heavy use of static fields instead of passing via callback when required
4. variable names like: textbox1 ..etc.
5. No comments
It is true that is a huge pain in the ass to deal with, but then I look at it as I was able to create something out of that mess, I mean all is mixed up nothing is clear, no clue where it starts and what caused it, but then I put the pieces together and end up with a solution of what I thought to be: It will never be solved when that mess is here.
Not an excuse for messed up code, I try fixing whenever possible, but hey, at least I did not run away and give up
OK what the actual fuck is going on within this company.
TL;DR: Spaghetti Copy/Pasted code that made me mad because it's just a mess
I just looked into a code file to search for a specific procedure regarding the creation of invoices.
I thought "Oh this is gonna be a quick look-through of like 1000 lines MAX" turns out this script is 11317 fucking lines long and most of it's logic is written there multiple (up to 6-7 times). And I'm not talking about a simple 10 lines or something. No! Logic of over 300 lines.. copy & pasted over .. and over .. and over?! I mean what the fuck did this guy drink when he wrote this.
Alsooo 10000 of those 11317 lines is ONE FUNCTION.. I kid you not! It's just a gigantic if / else if construct that, as I said before, contains copy-pasted code all over the place.
Sadly my TL thinks that code cleanup / optimization is "not necessary as long as it works" like wtf dude. If anyone wants to ever fix something in this mess or add a new feature they take a few hours longer just to "adjust" to this fucking shit.
This is a nightmare. The worst part: This is not the only script that has shit like this. We got over 150 "modules" (Yeah, we ATTEMPTED something OOP-ish but failed miserably) that sometimes have over 15000 lines which could be easily cut down to 1/3 and/or splitted into multiple files.
Let's not start about centralization of methods or encoding handling or coding standards or work code review or .. you get the point because there's a character limit for one rant and I guess I'd overshoot that by a lot if I'd start with that. Holy shit I can't wait until my internship is over and I can leave this code-hell!!2
Using the new project as an excuse to try out the language I was an absolute newbie at. (Python, at the time).
A couple years later when I’m much more proficient and I go back and look at that code, I want to slap past me for putting that spaghetti mess into production.
I managed to clean up the React part of my project, and now everything is smooth AF *.*
But boy oh boy did I fuck up big time, any console.log() written under the render section of anywhere was triggered around 4 times! I still have to rebuild everything (I only finished the dashboard so far) but it will be cleaner that I could ever hope2
That feeling when you are about to add a new feature to a project and when you start reading the spaghetti mess the previous developer puked when he/she was monkeying around, your blood pressure goes up, you lose a bit more hope in humanity, you start thinking about buying a gun, and start theorizing how torture could potentially be a valid recourse in some cases.3
I hate programmatic auto layout. It's such a mess! Simple shit like cells that can easily be defined in a .nib become spaghetti coded messes that violate every good programming practice ever. Want to recreate the same style of cell again? Good luck reverse engineering the hieroglyphics your teammate wrote when creating the layout by hand. Never mind a whole bunch of useless shit is done in code that could easily be defined via runtime attributes through the storyboard. But why learn a new approach? Cause job security. Or because for some reason Interface Builder tools are seen as "too hard" or "not scalable" to use.. fuck me.2
My first game jam,
I was first excited about coding but when I started, I was caring about making my code clean, and I lost too much time focusing on this... You should see the end, such a mess ! Spaghetti code, pointers everywhere but hey, it worked 😊
Found bug in legacy code with comment "4 days to release workaround, works predictably".
Added "No, it doesn't!" and committed to main branch before I start reworking the entire spaghetti mess of a codebase