Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 147277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:45:12+00:00 2026-05-11T08:45:12+00:00

The project I’m working on has just hit 4200 lines in the main C#

  • 0

The project I’m working on has just hit 4200 lines in the main C# file, which is causing IntelliSense to take a few seconds (sometimes up to 6 or so) to respond, during which Visual Studio locks up. I’m wondering how everyone else splits their files and whether there’s a consensus.

I tried to look for some guides and found Google’s C++ guide, but I couldn’t see anything about semantics such as function sizes and file sizes; maybe it’s there – I haven’t looked at it for a while.

So how do you split your files? Do you group your methods by the functions they serve? By types (event handlers, private/public)? And at what size limit do you split functions?

To clarify, the application in question handles data – so its interface is a big-ass grid, and everything revolves around the grid. It has a few dialogs forms for management, but it’s all about the data. The reason why it’s so big is that there is a lot of error checking, event handling, and also the grid set up as master-detail with three more grids for each row (but these load on master row expanded). I hope this helps to clarify what I’m on about.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:45:13+00:00Added an answer on May 11, 2026 at 8:45 am

    I think your problem is summed up with the term you use: ‘Main C# file’.

    Unless you mean main (as in the method main()) there is no place for that concept.

    If you have a catch-all utility class or other common methods you should break them into similar functional parts.

    Typically my files are just one-to-one mappings of classes.

    Sometimes classes that are very related are in the same file.

    If your file is too large it is an indication your class is too big and too general.

    I try to keep my methods to half a screen or less. (When it is code I write from scratch it is usually 12 lines or fewer, but lately I have been working in existing code from other developers and having to refactor 100 line functions…)

    Sometimes it is a screen, but that is getting very large.

    EDIT:

    To address your size limit question about functions – for me it is less about size (though that is a good indicator of a problem) and more about doing only one thing and keeping each one SIMPLE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Requirements Project should contain 1 main application and some secondary sub applications (which uses
A project I was working on has finished, so I've been moved on to
Project Euler has a paging file problem (though it's disguised in other words). I
Project file here if you want to download: http://files.me.com/knyck2/918odc So I am working on
Our project's template html has a quirks declaration,which is <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML
Current project is an Mvc4 application, I had Ioc working and recently it just
My project has both client and server components in the same solution file. I
The project currently has a UIviewController called Dashboard that acts as the main view
Project: http://design.vitalbmx.com/fave/news.html When I click Add to favorites button (under main pic), in Chrome
The project I'm currently working on generates 30+ warnings each time it gets build.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.