Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Legends 

Do you ever feel like you've just commit a war-crime?

As the title states... I do. Look, I'm not nor have I ever been the best and breaking my code up into modular chunks and appropriate file structure. My github would showcase this poor practice. But today I think I went too far, 1.5k lines of code in 1 file for a single file project. What's fun about it is that there is so much expansion necessary and validated that I'm getting a bit lost traversing where certain things are. Do I stick it out and easily get 5k out of this or do I break it up.
[Image: brotherhood.gif]
(Aug 13, 2025 05:59 AM)Dystortion Wrote:  I think I went too far, 1.5k lines of code in 1 file for a single file project. What's fun about it is that there is so much expansion necessary and validated that I'm getting a bit lost traversing where certain things are. Do I stick it out and easily get 5k out of this or do I break it up.

Lol, this is a war crime. "If there's any doubt, then there is no doubt" as they say in the CIA (or Robert De Niro says it Ronin, anyway).

I was just updating a file and my changes made it 594 lines long, which probably makes me complicit, but just in a minor genocide - ya know, one of those cheeky 19th century ones.
<p><br></p>
(Aug 13, 2025 06:21 AM)bevc Wrote:  Lol, this is a war crime. "If there's any doubt, then there is no doubt" as they say in the CIA (or Robert De Niro says it Ronin, anyway).

I was just updating a file and my changes made it 594 lines long, which probably makes me complicit, but just in a minor genocide - ya know, one of those cheeky 19th century ones.

Suppose so, yours is a collateral damage shot, mine is an artillery strike into a civilian area.
[Image: brotherhood.gif]
The indiscriminate bombing is the only way we learn.
(Aug 13, 2025 09:12 AM)arlington Wrote:  The indiscriminate bombing is the only way we learn.

As a specific nation at the moment would know about.
[Image: brotherhood.gif]
1.5k lines of code in 1 file would lead me to commit seppuku
i am not a professional software architect but personally i think 1.5k loc in one file is fine if it makes sense to structure your code that way. its not as if 1.5k loc is necessarily considered a lot of code. if it takes too much effort than it is worth to break it up into smaller logical parts then i wouldnt do it. it just depends on what you care about to a certain extent and how necessary it is from an engineering point of view.
(Aug 14, 2025 12:26 AM)ttbr0 Wrote:  i am not a professional software architect but personally i think 1.5k loc in one file is fine if it makes sense to structure your code that way. its not as if 1.5k loc is necessarily considered a lot of code. if it takes too much effort than it is worth to break it up into smaller logical parts then i wouldnt do it. it just depends on what you care about to a certain extent and how necessary it is from an engineering point of view.

Of course 1.5k is normal, but this could be absolutely broken down into a ton of files. I just follow hella bad practice as times and I just keep writing in one file and can't be bothered seperating
[Image: brotherhood.gif]
(Aug 14, 2025 08:18 AM)Dystortion Wrote:  Of course 1.5k is normal, but this could be absolutely broken down into a ton of files. I just follow hella bad practice as times and I just keep writing in one file and can't be bothered seperating

What language are you coding in? I code in golang and if I get to about 500 LoC in 1 file, I look for ways to optimise and properly break up parts hahaha.
(Aug 14, 2025 12:01 PM)Prawnster Wrote:  What language are you coding in? I code in golang and if I get to about 500 LoC in 1 file, I look for ways to optimise and properly break up parts hahaha.

Go brother, Go lmao so this ain't looking to hot for me. I use go for everything except web dev, but I'm not afraid to use gin/gin-gonic - great package
[Image: brotherhood.gif]
(Aug 14, 2025 12:07 PM)Dystortion Wrote:  Go brother, Go lmao so this ain't looking to hot for me. I use go for everything except web dev, but I'm not afraid to use gin/gin-gonic - great package

I've never written in gin-gonic tbf, most of my golang tools are bots/tools for sites as opposed to sites themselves haha, might look into it :)
(Aug 14, 2025 12:22 PM)Prawnster Wrote:  I've never written in gin-gonic tbf, most of my golang tools are bots/tools for sites as opposed to sites themselves haha, might look into it :)

Yep, I'd write more tools and scripts for cyber related and just random but I love a good frontend for tools. I'm a gui typa guy
[Image: brotherhood.gif]
This is happening way too often, but I think it's just how I work when the requirements aren't 100% clear.

Instead of getting caught up in file structures, helpers, utils, service injections, models, etc, I just write everything in a single file to start with. Once it works (even if it's just the bare minimum) I begin breaking it apart.

Anything that handles data transformation or manipulation goes into utils. DTOs/schemas/interfaces get their own files under a new folder. And if something looks reusable I turn it into its own service.

Even if the initial file blows up to 2k+ lines, I usually end up with around 200–250 lines in the main file after refactoring. The rest gets split out cleanly.

Especially now with GitHub Copilot's Agent mode, it's pretty solid at breaking a big file into components and making sure each one has the right imports.
[Image: ezgif-5ed481b8a2df6a8e.gif]
(Aug 16, 2025 05:44 AM)Oh_Well Wrote:  Especially now with GitHub Copilot's Agent mode, it's pretty solid at breaking a big file into components and making sure each one has the right imports.

Interesting, copilot has always seemed to have lacked in AI capabilities but this is actually useful especially if you're handling thousands of lines of code, even getting it to potentially clean up your current folder structure if they're messy also is great.
[Image: brotherhood.gif]
(Aug 13, 2025 05:59 AM)Dystortion Wrote:  As the title states... I do. Look, I'm not nor have I ever been the best and breaking my code up into modular chunks and appropriate file structure. My github would showcase this poor practice. But today I think I went too far, 1.5k lines of code in 1 file for a single file project. What's fun about it is that there is so much expansion necessary and validated that I'm getting a bit lost traversing where certain things are. Do I stick it out and easily get 5k out of this or do I break it up.

is it pushing code if you don't feel like you've committed a war crime?


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersJun 4, 2024 11:18 AM 12 319 Jun 4, 2024 11:18 AM
Last Post: Hackers
by MavenGradleApr 15, 2023 07:38 AM 14 453 Apr 15, 2023 07:38 AM
Last Post: MavenGradle
by ASLRJun 29, 2014 09:57 PM 5 127 Jun 29, 2014 09:57 PM
Last Post: NeoXiD