Fighting a monster
-
Here in Brazil sales taxes are Lovecraftian levels of nightmarish. We have a form in a shared Windows Forms library that we use in several of our "of the shelf" products that deals with invoicing and taxes of product sales that is 17K lines in and of itself, no counting helpers and specialized components and dialogs. Most of that code it to manage the interacion between the UI and the rules and calculations for taxes. You sometimes see people complaining about doing income tax declarations, they have no idea how it is like to sell a simple piece of candy in Brazil.
não é reddit, mas r/suddenlycaralho ! Que vai querer no print, meu bom companheiro Dev BR, sofredor com cálculo de IPI/PIS/COFINS?
-
I started to dive in a new (for me) very large code base. One of the files is 9500 lines. Got me wondering: what's the largest single source file you ever met? I'm not talking about automatically generated source files, but those written by humans. On the same note, when do you think it's time to break a file in smaller pieces? For me, it is somewhere around 1000 lines.
Mircea
Probably not a reasonable answer because this is from back in the mainframe days but I seem to recall the Unisys A-Series operating System MCP (yes we laughed when Tron came out) was a million - ish lines of code. And not assembly code, written in NEWP, an Algol loke language.
-
Slacker007 wrote:
If all the code is concise and organized well and has purpose
Which is almost never the case in a 9k lines file ;)
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
Probably has five recursive functions buried in the middle of the file, which calls all of the other functions. Each recursion is controlled by a different combination of global variables defined and controlled in other units.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Slacker007 wrote:
If all the code is concise and organized well and has purpose
Which is almost never the case in a 9k lines file ;)
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
A frightening large fraction of modern programmers believe that putting each method/function into its own individual file, headed by a 90 line open-source license statement, magically solves those problems.
Those guys are posers. I put every word in a separate file. I use a build script that concats all necessary files so it becomes a compilable script again. That way, I never write a single word twice, so it's completely DRY! Let the build server handle the complexities. Also, when a function is compiled it becomes its own service, because a service should do one thing only. Naturally, I'm using Kubernetes to deploy all my services. It's completely SOLID I tell you :D
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
I started to dive in a new (for me) very large code base. One of the files is 9500 lines. Got me wondering: what's the largest single source file you ever met? I'm not talking about automatically generated source files, but those written by humans. On the same note, when do you think it's time to break a file in smaller pieces? For me, it is somewhere around 1000 lines.
Mircea
Mircea Neacsu wrote:
what's the largest single source file you ever met?
File? I found a C++ class which spanned 3 source files - at least. It had 20,000 lines of code and at least 200 attributes and 200 methods. Years later I read the book "AntiPatterns" in which it described the God Pattern. That is what that class was.
-
I think the opposite situation is even worse. You get some abstraction/interface monkey at the keyboard and you may find yourself jumping through a dozen different 5 line files to get to the actual code that adds X + Y. Tons and tons of code written to handle the unlikely event that your boss is going to walk into your office one day and say, "Hey, let switch from Oracle to SQL". I understand some vended products feel the need to support that, but they don't.
MadGerbil wrote:
"Hey, let switch from Oracle to SQL".
To be fair that actually happened to me. But from SQL Server to Oracle. It took me, by myself, a bit less than two weeks and had no impact at all on any other developer. Customer mandated it. The boss that just delivered the news was rather skeptical about what impact it would have. There was a very specific DB API although without a lot of layers. Contrast with the more recent job where the required change from SQL Server to MySQL is closing in on 2 years now. And still not done. That didn't have a DB API layer. It has a mismash of various idioms and misuses of various APIs over years.
-
One "Hacker's dictionary" listed "Cobol Fingers" as "Fingers worn down to a single joint". :-)