Hacker News new | ask | show | jobs
by dfinninger 1096 days ago
Not the most complex software, but definitely the most needlessly complex software.

I worked for a company where IT owned customer onboarding for historical reasons. Each customer had their own DB in the same server so that each site would be isolated. So onboarding was basically cloning a “gold DB” and templating some values.

The script that cloned the DB was over 50k lines of Batch files (Windows .bat). There were so many includes, GOTOs, random black holes, passwords in plain text, reliance on special IP whitelisting in the AD server… it had been grown organically by someone who didn’t know how to program and it was a major mess.

It took me three weeks to figure out what was happening, and another to make sure the details were correct.

I replaced the whole thing with <10 lines of an actual scripting language. Proved it worked. But the management at the time didn’t want to change the process…

My Facebook rant at the time got me invited to speak to an upcoming class at my Alma Mater about software quality.

2 comments

There is no way you replaced 50,000 lines of batch files with 10 lines of a script.
I'm positive there's some exaggeration for effect, but I've run into some Powershell scripts for that have grown into 1000+ lines and I'd guess roughly 2/3rds of them were in functions never called.

The call is removed, but the function remains. Fields in a form stay, unused and unpopulated, but the validation is disabled and left behind. Things like this.

No version control meant it was hard to go back, and people are afraid to break things.

I once replaced ~2500 lines of ruby with ~450 lines of...ruby.

That was some shit.

Mostly it was copy/pasted data (strings) with slight modifications eating up a lot of lines. A few big chunks were in a code path that could not execute, as well.

It was just really bad code.

> the management at the time didn’t want to change the process…

Every time I see something like this it makes me want to scream. This is not how you develop software, setting all implementations in stone. Ugh