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
gargravarr1 reply#
I never actually saw the code that makes this work (thank Christ) but at the previous place I worked, we did everything in SQL. Believing SQL Agent to be 'too limited', my boss had taken it upon himself to reimplement it... in SQL...

Just let that sink in for a moment.
There were 20+ tables all modelled after how SQL Agent does its own scheduling, 30+ stored procedures for interacting with it, and it was all intended for use with a GUI that was (naturally) never written. A relationship diagram of the tables sat on my personal Wall of Shame board for most of the time I was there. And yes, I had to use it from time to time. It was installed in every database for 200+ clients, in production, UAT, development, you name it.
The most delicious irony is, the only way such a thing could run automatically... was to use a SQL Agent job to poll it once a minute.

gargravarr#
And yes, I'm aware you can programmatically create SQL Agent jobs in SQL, so he couldn't even use that excuse. The only thing it had over SQL Agent was that it could be 'event driven'. All that ultimately meant was that the job would only run if a condition was met.

Yeah...

poulsbohemian3 replies#
As many experienced commenters below have already noted, nearly any piece of substantial, revenue-generating, long-lived code will ascend to a place full of dragons and mysticism. The more interesting debates revolve around:

1) How did it get that way, and what can we learn from that? 2) Is it inevitable that all software will end up like that? 3) How can an organization ever successfully sunset or move to a more maintainable system? Or should they even aspire to that?

nathan_long1 reply#
https://www.reuters.com/article/us-usa-banks-cobol/banks-scr... describe banks struggling to maintain ancient COBOL systems as the developers who understand them are dying off.

I don't know exactly what they should have done and when, but it seems like rewrites are going to be necessary, and it sure would be nice to start rewriting a system while you still have someone who can explain what it does.

poulsbohemian#
In the post-Y2K years, I heard a lot about how the next order of business was going to be to replace all those systems in health care, banking, etc, especially as a generation went into retirement. But, here it is 2018 and there are still articles Food for thought.
spc476#
Code that is easy to change is changed until it's no longer easy to change.

Also: Well-designed components are easy to replace. Eventually, they will be replaced by ones that are not so easy to replace. -- Sustrik's Law
Edit: Added Sustrick's Law

bogdanu#
My worst experience was with a PHP app (no framework), 60K LOC per file, 6 dimension arrays, variables and comments in 3 different languages, elseif statements spread over 2-3k LOC, no kind of separation of concerns (HTML mixed with php, db calls, etc).

It was a 3 months nightmare with an arrogant as fudge client/developer.

bayindirh#
I have seen a complete project. The project was maintained by one person. Former developer left and transferred his work to the next.

It was a C project, but the second developer was coming from a Java background. So his half is all written with Java notation and naming conventions.
The thing was maths-heavy and had no comments. Instead they were consulting to a documentation book which also had file names and approximated line numbers.
The error tracing was done with function call stacks, so every function pushed some data into a global stack before a critical operation and, popped the same data if everything went without any problems.
Some libraries they were using were ad-hoc patched to taste, and grafted into the code tree. So, debugging was 5x harder and longer.
The functions were not divided into headers in a logical way, they were ad-hoc. So finding something was dependent on an source indexer or a grep sprint.
Last but not the least, the developer was so arrogant that the bugs were resolved by threatening to force him to clone his code and sent it out to another developer to debug and clean. Otherwise he pretended that the bugs were not present, because it was running on his test bed.
... and yes. It was in production.

Load more comments