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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:54:27+00:00 2026-05-13T09:54:27+00:00

I have inherited an existing code base where the features are as follows: huge

  • 0

I have inherited an existing code base where the “features” are as follows:

  • huge monolithic classes with
    (literally) 100’s of member variables
    and methods that go one for pages
    (er. screens)
  • public and private methods with a large number of arguments.

I am trying to clean up and refactor the code, to leave it a little better
than how I found it. So my questions

  • is worth it (or do you) refactor methods with 10 or so arguments so that they are more readable ?
  • are there best practices on how long methods should be ? How long do you usually keep them?
  • are monolithic classes bad ?
  • 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-13T09:54:28+00:00Added an answer on May 13, 2026 at 9:54 am

    is worth it (or do you) refactor methods with 10 or so arguments so that they are more readable ?

    Yes, it is worth it. It is typically more important to refactor methods that are not “reasonable” than ones that already are nice, short, and have a small argument list.

    Typically, if you have many arguments, it’s because a method does too much – most likely, it should be a class of it’s own, not a method.

    That being said, in those cases when many parameters are required, it’s best to encapsulate the parameters into a single class (ie: SpecificAlgorithmOptions), and pass one instance of that class. This way, you can provide clean defaults, and its very obvious which methods are essential vs. optional (based on what is required to construct the options class).

    are there best practices on how long methods should be ? How long do you usually keep them?

    A method should be as short as possible. It should have one purpose, and be used for one task, whenver possible. If it’s possible to split it into separate methods, where each as a real, qualitative “task”, then do so when refactoring.

    are monolithic classes bad ?

    Yes.

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

Sidebar

Related Questions

I have inherited a code-base which uses a compiled logging library. I cannot update
I have inherited an big existing PHP application (website actually) that runs on Apache.
I have inherited some legacy PHP code what was written back when it was
I have some classes inherit from existing Windows Controls like TextBox and DateTimePicker, ..etc
I have inherited a large existing website to maintain. Previous developers have taken an
I have inherited code for an iPhone app using Core Data written by another
I have inherited a existing website with a large codebase. To handle ajax requests,
I have inherited some code that will eventually be part of an API call.
I have inherited a client site which crashes every 3 or 4 days. It
I have inherited an old crusty PHP application , and I'd like to refactor

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.