4 ms·
I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and star
by eric_h 9y ago
I disagree. I inherited an app that I'm maintaining that was written by one person over ~12 years. When requirements were added, he just cloned the app and started making the changes so the new app would meet the requirements. Repeat 2 more times, and you get to now, where there are 4 similar but not identical versions of the same code base, with inconsistently applied fixes to various bugs. All 4 still need to work for the organization to function.
It's old school PHP, with sql queries mixed in with markup mixed in with php business logic - if that's not spaghetti code, I don't know what is.
(I'm replacing it, but it's a very slow process).
- iaw 9y agoMy inherited spaghetti codebase took only 24 months for my predecessor to build. I was told: "don't worry, it's in SVN and all of the important switches are clearly laid out at the top." Well, it was in an SVN repo... with a single commit. It did have all the important switches at the top, none of them but the ones that were set actually worked. Man, I "miss" that job.
- quickben 9y agoWas the comment of that commit 'initial commit'? :)
- koolba 9y agoNot GP but probably: “Here be dragons”
- taw55 9y agoI actually did that once. It was a wordpress site for a company written by some 16 year old intern. Terribly fun. No version management. The main folder had multiple older copies of itself in seemingly random subfolders. It went deep. The CSS was stored partially in CSS files, of which there were 20 (!) loaded from the theme folder, partially in one of the 40+ plugins used (not an exageration). But there was also plenty of CSS in the templates, the database and seemingly random third party servers. The favicon was 20MB large. It used like 4 plugins for “custom fields” all of which had infected large swathes of the database, and all of which did... something. Much like the root folder had nested copies of itself there was something similar going on in there... I simply didn’t bother by the time I understood what the hell was going on. The templates were basically this premium theme of “customized” php, the fun part was that in some page templates it basically rendered a bunch of different pages inside the template (the guy apparently didn’t understand the concept of closing tags, yet somehow made it work. It was incomprehensible.) and then used custom css to hide the pages that shouldn’t be visible. Basically the entire thing was some satanic equillibrium of bugs cancelling eachother out. It was a work of art.
- quickben 9y ago> "The favicon was 20MB large" Well, that's actually impressive :D
- iaw 9y agoYes. It actually was LOL
- hinkley 9y agoOne of the things it took me a while to intellectualize is that 'you' a year ago is a very different person from 'you' today. Given enough time, maintaining a much larger body of code than a single person can reasonably handle, you're going to have disagreements with yourself without even realizing it.
- eric_h 9y agoAbsolutely. When I stumble upon some code in my full time codebase that I find distasteful, my first thought is "what idiot did this". git blame and sure enough, it's me. Past me has been and always will be an idiot as far as present me is concerned (with some infrequent exceptions).
- eric_h 9y agoI should add that I volunteered to maintain this project, in exchange for free stuff from said organization (not money), before I knew what I was volunteering for (heh, lesson learned). 3 years (of occasional work, maybe 1-4 hours a week) later and I've got a layer on top that can interact with all of the slightly different data models of the four apps and I'm gradually replacing the legacy code with new code and migrating them all back into a single database/app. Since I'm not working for money, I maintain sole ownership of the code, and I hope to eventually turn it into a passive income source, since it will be useful to other, similar organizations who have it even worse as far as their web applications go.
- harrisonjackson 9y agoI'd say one person over ~12 years is basically multiple developers working on it. I look back on code after a couple months and it often feels like someone else wrote it.
- eric_h 9y agoYep, and in particular, one person over 12 years with one to three month breaks between sessions of working on it. He had no choice but to "monkey see, monkey do" what his past self did, and the resultant product is ... difficult to maintain, to put it nicely. [Edit: I don't blame him - I understand how it happened, and also why he wanted to get out ;)]
- zelos 9y agogit blame regret: "who wrote this crap?...oh, right, I did"
- swivelmaster 9y agoI swear I know a guy who would have done this. I have worked with him. I have cleaned up his code. I have asked him to clean up his code and been yelled at in response.
- eric_h 9y agoPretty sure we all do. The constraints under which he was operating to create the mess I took over I understand well, and I do not blame him for the end result. He is a manager now, though, not a day-to-day programmer ;)
- adrianratnapala 9y agoI think that's a perfectly good way to develop a bunch of somewhat-similar apps for different customers. As long as you refactor all the time. If you don't then you are basically one developer doing a serial simulation multiple developers miscommunicating in parallel.
- ukyrgf 9y agoYour description is a 100% spot-on description of what I inherited a few weeks ago. I wake up every morning making groaning noises I never knew my body was capable of.