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 7412053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:28:54+00:00 2026-05-29T06:28:54+00:00

It depends. a) Sure, but since the entire project gets turned into one .dll,

  • 0

It depends.

a) Sure, but since the entire project gets turned into one .dll, does it really matter from a performance standpoint if you have 7 controllers with 300 lines of code each versus one controller with 2100 lines? (Obviously readability and tight coupling are problems if there is no separation of concerns)

b) As long as separation of concern is taken into consideration, is the number of lines of code in one controller not an issue?

c) How many lines of code in one controller can be a sign of needing to refactor? (500,1000,5000,10000)?

  • 1 1 Answer
  • 0 Views
  • 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. Editorial Team
    Editorial Team
    2026-05-29T06:28:54+00:00Added an answer on May 29, 2026 at 6:28 am

    Any fool can write code that a computer can understand. Good
    programmers write code that humans can understand.
    –Martin Fowler [ source]

    I remember seeing an application in classic asp that was a single page. It rendered differently based on the parameters that came in. Theoretically, you could do the same thing with ASP.NET MVC, make a single controller with a ton of views (or worse a single view that changed based on input to the controller).

    Granted, that super controller divides its work up into actions. But regardless, you’re still working with something big.

    The first SOLID Principle is Single Responsibility. Your module should have only one reason to change. A large controller tells me two things:

    1. It is involved with too much
    2. The actions have too much logic

    Both of these are SRP violations because the Controller that does too much has more than one reason to change. The actions that do too much have to change when the logic changes or when the objects they interact with change.

    To me a Controller Action should just call a function on a Service (interface, web service, whatever) and return the results of that call. Most of my controller actions are a whopping two lines of code. And most of my controllers are very focused in what they do.

    As a rule of thumb, I get uncomfortable when I have to scroll more than two pages for a single class (about 200 lines depending on your font size and/or resolution). Even more important than actual length is how much responsibility my controller has. Minimize the responsibility and file size decreases automatically.

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

Sidebar

Related Questions

I've got a project that depends on a particular version of MSVCR80.dll (the MS
I'm sure this depends heavily on a few variables. Here are the ones I
I know the answer depends on the particular JVM, but I would like to
i know it depends on many thing. But can anybody tell me how long
I have a number of atomic classes (Components/Mixins, not really sure what to call
i cam across some older topics about this but since there is a lot
In short, my application needs to pull images from a MySQL db. Since the
I'm not sure if this is possible or not, but what I would like
I need to split a string where there's a comma, but it depends where
Maybe this is a basic question. but I still not sure jquery cookie ,

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.