Lurker News
I think I've broken my own record with this one ~2500 lines of incoherent JavaScript/C#. Works though.

Comments (578) 119 threads

Earlier comments
andyhasit#
I might have a slightly different record, if you count lines in a single source file...

One client wanted to hire me to continue developing his AutoCAD plugin written in AutoLisp (a cut down version of lisp for writing macros in AutoCAD). He had all his code in a single file which was around 63,000 lines long. (I calculated this as 504 meters of screen/paper top to bottom).
This was for a product that was in production, used commercially, and he'd been going for 15 years, adding bits as he went. There were loops hitting 300 lines, well over a hundred global variables, no consistency, and duplication like you wouldn't believe because he hadn't grasped the idea of moving code out to reusable subroutines.
I asked him what he did when his clients found a bug. The answer was "knuckle down for a few weeks".
I just couldn't believe that this was his daily work for 15 years, and he never thought to learn anything about programming other than what was immediately required to solve the problem in front of him...
Another unbelievable part of this, is that AutoCAD has an absolutely superb IDE built into it (i.e. it's fricking free!) which has features like the ability select & run code in current scope with minimal clicks which make for the fastest development environment I have ever played with, as in, you have no idea how much functionality you can churn out in a day. But he didn't like it, so he edited his code in....wait for it... WordPad! (That's a Windows built in Rich text editor where double clicking on an underscored_word only selects up to the underscore because it's not made for code, and that on its own makes it impossible to work with).
I tried to modify his code for several hours but had to stop myself because it was madness. So I told him the only way forward would be to rewrite everything from scratch after which point I could make it do anything he wanted. I reckoned it would only take 4 weeks to rebuild his 15 years of mess - partly because the IDE makes development so damn quick, and was even willing to do it on a fixed price, but he declined, which I think was utter madness.
The thing is, he had 15 high paying clients, and two other part time employees helping with other aspects of the business, and drove a brand new Audi A3, which means he probably holds a world record for highest ratio of money earned to quality of code written, at least in the CAD subcategory :-D

cat-turner#
In my past life I was an oceanographer at a consulting company. Essentially we wrote Matlab code that processed data we get from ocean and meteorological models. Many of these models, used by NOAA, are all written in Fortran. While most were well documented, one thing you could not get around is the use of parameters for these models ( think of global variables used everywhere) and a never ending game of go-to statements. I had to figure out how this one flood model worked... literally had to read 5,000 lines of Fortran. This is what we use to determine potential flood impact from hurricanes, today. Software written for oceanography is a whole other beast.
gassiss#
Three years ago I was hired as a Business Analyst, with 0 background in anything related to IT. Our team was responsible to maintain a legacy base in COBOL.

As time went by, everything started to make sense and I was able to grasp almost everything about the environment and the tech stack. Even perform a little bit of system analysis in COBOL to try and identify some gaps in the code base.
But what always intrigued me is that even those senior developers in the team with 25+ years of experience with COBOL wouldn't ever touch this one program. The program responsible for 90% of the logic of the product of that company. Every now and then, this program would ABEND for whatever reason and sometime, no one could figure out why. They respected (cute way of saying they were afraid) this program so much that, instead of refactoring it, they would just throw an if statement and let it run.
This program was built in the 60s and had I don't know how many hundreds of thousands of lines of code. It is still running to this day.
Now I don't have the expertise to say if that was bad code, and even if I had, I didn't deal with this program enough to say this anyway, but I was very intrigued why would this particular program ABEND out of nowhere, and no of these super experienced developers would have the guts to touch it.

dotdi1 reply#
I was given the opportunity to work with iOS at one of my former employers and I quickly agreed (I was a backend developer back then). It was a rather popular application at a rather large Austrian media company, with around 50k unique monthly users.

Boy did I regret that decision!
- 100KLOC
- Initial development outsourced to India. Comments, variable names in Indian.
- Subsequent development outsourced to Belarus. Add comments, variable names in Russian.
- "Why use ObjC OO features when we can write buggy and incoherent C"?
- Global, implicit state everywhere. Tapped on something? Hope it didn't mess up the state you are relying on.
- Obviously no tests, and no testers.
- Inheritance chains of up to 20 classes.
- iOS kindly forces MVC, but you can obviously write empty controllers and all spaghetti-logic into your views. Needless to say, that was what they did.
- Complete lack of proper structure. Several views iterated up their parent controllers to the desired one, grabbed its views, iterated over them until the right view was found and something was done to that view.
- Building and running the application was controlled by 10+ env variables (the other dev was fired after he pushed a dev build to the App store, which mysteriously passed review. "Whoopsie, forgot to set one of the env variables correctly").
- about 80% of the logic was copy-pasted for the iPad build instead of reusing anything. It was not a different target, it was a separate project.

charlesdm1 reply#
You were "given the opportunity" huh? :)

How long did you work on that before you threw in the towel?

dotdi#
About six months. I managed to actually get a new feature into that hot mess while fixing bugs that would take days to weeks to track and handling compatibility with a new iOS major version, but then I got an offer to work in the space industry and quickly left.

A while later I heard they threw everything away and started an in-house rewrite in Swift. Some people do seem to learn from their mistakes.
EDIT: clarification on the opening statement.

Load more comments