Hacker News new | past | comments | ask | show | jobs | submit login

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).




I'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.


Yep, 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 ;)]


git blame regret: "who wrote this crap?...oh, right, I did"


One 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.


Absolutely. 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).


If you like comic books where the hero has to travel in time to fight himself, you'll love programming.


I want this on a t-shirt.


I always think when this happens, "At least I must be improving."


My 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.


Was the comment of that commit 'initial commit'? :)


Yes. It actually was LOL


Not GP but probably: “Here be dragons


I 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.


> "The favicon was 20MB large"

Well, that's actually impressive :D


I 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.


I 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.


Pretty 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 ;)


I 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.


Your 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: