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

  • Home
  • SEARCH
  • 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 7997009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:51:31+00:00 2026-06-04T14:51:31+00:00

I am working on a functionality and have confuded about the length of the

  • 0

I am working on a functionality and have confuded about the length of the method.There are certain points are read but not sure what is best or a standard

  1. A method should be as long as required to perform the task for which it is designed.
  2. can read the whole method without the need for scrolling and it fits onto the page.

There are others points also.
I have a static helper method and whose lengths is getting increased, so i have the option of either to create more static helper methods and distribute the tasks to those methods but than it seems like i am creating unnecessary static methods.

Other approach is to create another helper class and delegate some work to methods defined in the helper class

I am not sure what is best way/standard way to do this.

  • 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-06-04T14:51:33+00:00Added an answer on June 4, 2026 at 2:51 pm

    In general, both of those points are very good things to consider. One of the main reasons you already mentioned: It makes the code more readable and easier to digest.

    The other benefit from splitting up your methods and creating helper methods is one that won’t manifest itself immediately. Instead, one day you’ll be working on a system where you have users who are Customers, and you’ll need to implement a feature where you’ll need to create admin users, or Vendors, or some other abstract version of a person.

    You’ll find yourself thinking about how you’re going to save the vendor’s orders, or the vendor’s whatever, to the database and you’ll need to generate some form of something or other that is used to identify the order, and you’ll realize that the code you wrote to do this same action for the customer will work with a Vendor object just as well as a Customer object.

    However, if all of that code was strong together in the same method that handles everything related to Customers, you’d be using what we call cut and paste reusability. Which involves going through your previously-written code and cutting and pasting relevant parts and creating a copy that is mostly similar but with very subtle differences. (Note: This is generally considered a bad practice.)

    But when you write small, concise methods that do one thing only and one thing really well, you find that you’re able to take those building blocks you’ve already built and then use them to build other things, saving you time, saving QA time, and in general lowering the maintenance costs of the project, allowing the product to move forward, and allowing you to move forward and do cooler stuff.

    However, one last point to consider is that it is possible to overdo it, or over-architect. There is a fine line between too long and too short, and you may be tempted to split your methods up too much. If you get to the point where splitting up your methods makes it too hard to work with, then consider that you may be taking it a little too far. Good luck!

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

Sidebar

Related Questions

Right now I have some functionality working but its really ugly and I know
I have the jQuery UI sorting functionality working fine, but I would also like
I have made an android app which working fine. I implemented the Login functionality
Hi i developed small web application, in that all the functionality working fine but
I am having issues with javascript functionality not working in the admin area. When
I am working on one project where there is a functionality need to implement
I'm working on a fresh new product that eventually will have different functionality built
I am working in ASP.NET 3.5 MVC application. We have a functionality where we
I have read up about what COMET streaming is, and all the various hacks
I am working on a web site with login registration functionality.I have implemented the

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.