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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:26:57+00:00 2026-06-10T04:26:57+00:00

By now my average class contains about 500 lines of code and about 50

  • 0

By now my average class contains about 500 lines of code and about 50 methods.
IDE is Eclipse, where I turned “Save Actions” so that methods are sorted in alphabetical order, first public methods, and then private methods.
To find any specific method in the code I use “Quick Outline”. If needed, “Open Call Hierarchy” shows the sequence of methods as they called one by one.

This approach gives following advantages:

  • I can start typing new method without thinking where to place it in the code, because after save it will be placed by Eclipse to appropriate place automatically.
  • I always find public methods in the upper part of the code (don’t have to search the whole class for them)

However there are some disadvantages:

When refactoring large method into smaller ones I’m not very satisfied that new private methods are placed in different parts of code and therefore it’s little bit hard to follow the code concept. To avoid that, I name them in some weird way to keep them near each one, for example: showPageFirst(), showPageSecond() instead of showFirstPage(), showSecondPage().

May be there are some better approaches?

  • 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-10T04:26:59+00:00Added an answer on June 10, 2026 at 4:26 am

    Well, naming your methods so that they’ll be easier to spot in your IDE is really not good. Their name should reflect what they do, nothing more.

    As an answer to your question, probably the best thing to do is to split you class into multiple classes and isolate groups of methods that have something in common in each of such classes. For example , if you have

    public void largeMethodThatDoesSomething() {
     //do A
     //do B
     //do C
    }
    

    which then you’ve refactored such that:

    public void largeMethodThatDoesSomething() {
     doA();
     doB();
     doC();
    }
    
    private void doA() {};
    private void doB() {};
    private void doC() {};
    

    you can make a class called SomethingDoer where you place all these 4 metods and then use an instance of that class in your original class.

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

Sidebar

Related Questions

When I try this code: class MyStuff: def average(a, b, c): # Get the
now i'm working on a project for creating audio unit instrument that provide the
Now facebook require to have these options when you want to use bulit-in actions
Now I try to developing an application related to Image processing, for that I
I have been using Python for about a year now, coming from a mostly
I have two PHP scripts. One acts as a backend, and contains a class
Previously, I had a class that wrapped an internal System.Collections.Generic.List<Item> (where Item is a
I have a class StreamCopyOperation which provides me such things like the average speed
I'm writing a class that does essentially the same type of calculation for each
Now I'm not sure if this is something I'm doing wrong, or something thats

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.