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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:58:47+00:00 2026-05-26T19:58:47+00:00

I use Developer Express’s CodeRush product which has a feature called Code Issues which

  • 0

I use Developer Express’s CodeRush product which has a feature called Code Issues which makes suggestions to optimize your code. I’ve noticed that if you have a method that has parameters it will always suggest making this method static. In the spirit of trying to write the best code and optimized which I assume is what DevExpress is trying to help us do, I’ve heard mixed opinions on whether making the method static is in fact wise.

What is your opinion on when a method should be static? Is there any benefit to doing this? Impact? I don’t see anything wrong with it as it is requiring parameters to run the method so it is not something that would be an issue across multiple users/uses.

Good or Bad?

Thanks.

  • 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-26T19:58:47+00:00Added an answer on May 26, 2026 at 7:58 pm

    As others have indicated, the presence of parameters is not a consideration.
    The hint is present when the method does not access any instance members.

    When is this useful?

    When a candidate method requires no state to perform it’s function, it should not be required that the caller of this function possess or create an instance of the parent class.

    By removing this requirement, the calling code will surface errors (or in some languages warnings) indicating that the method in question “cannot be accessed with an instance reference” requiring a Type Reference instead.

    When the calling statement is rewritten to use a Type reference, it may be discovered that the original instances of the type is not required and code may be refactored further to eliminate he creation of same.

    The elimination of this instance type will save cpu and memory.

    The calling method (or it’s own callers) will likely be easier to read since instantiation code is not needed for the method in question.

    Additionally if instantiation code is missing, this will add to the readability of one or more methods.

    For example the System.Math class is static and therefore filled with static functions. Calling code for these functions would be less readable if it had to instanciate an instance of the math class prior to execution.

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

Sidebar

Related Questions

I frequently write C# code that has to use magic strings to express property
I'm trying to use T4MVC in Visual Web Developer 2008 Express Edition and it's
I'm a PHP developer and now I use Notepad++ for code editing, but lately
I'm a PHP developer, and I use the MVC pattern and object-oriented code. I
I want to use NSCalendarDate, which exists in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.1.sdk/ System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSCalendarDate.h but is not present
Im trying to use the fileupload control. Im using Visual Web Developer Express on
In Microsoft Visual Web Developer 2010 Express, I can use #region...#endregion to Outline and
I use Visual Web Developer Express Edition 2008 and SQL Server 2008 Express edition.
In a corporate development environment writing mostly administrative software, should every developer use their
I'm trying to be a good CF web developer and use <cfqueryparam> around all

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.