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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:07:47+00:00 2026-05-16T07:07:47+00:00

I was recently told it was bad practice to haved marked a number of

  • 0

I was recently told it was bad practice to haved marked a number of methods in our code with the [Obsolete] attribute. These methods were internal to our codebase, rather than being on an API. The methods handled an older encryption function.

I felt it was a quick and safe way to denote to the rest of the team that these methods should not be used, and provided a message to suggest alternatives.

Others felt that I should have removed the methods entirely, rewriting or refactoring existing code as required. Additionally, it was thought too easy to overlook the compiler warnings.

Is there a ‘best practice’ for marking code as Obsolete when it’s not being used by 3rd parties? Or is this largely subjective?

  • 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-16T07:07:48+00:00Added an answer on May 16, 2026 at 7:07 am

    Step 1. Mark the member or class as [Obsolete]

    Step 2. Update all internal uses of the member or class to either use the new approach that replaces the obsolete approach, or mark that member or class itself as [Obsolete]

    Step 3. If you’ve marked new stuff as [Obsolete] in Step 2, repeat this step as needed.

    Step 4. Remove all obsolete members and classes that are neither public nor used by an obsolete public member or class.

    Step 5. Update documentation to give a clearer description of the approach recommended to replace any public obsolete members or classes.

    At the end of this, you will have no obsolete code that is solely used by internal code. There’s nothing to say that you have to do all of this in one go though; at each stage you have made progress. The time between starting step 1 and ending step 5 could be 5 seconds or 5 years, depending on many factors (most of them to do with complexity).

    Incidentally, if someone finds it easy to ignore compiler warnings, the problem is not with [Obsolete]. However, one reason not to leave such calls in the code for long (that is, to have done as far as step 2 ASAP) is to make sure people don’t end up becoming used to compiler warnings as they’re part of the habitual response to compiling the code.

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

Sidebar

Related Questions

Recently I was told to add auto_increment primary key to all our tables because
Someone recently told me that this is bad: var el = $(#myID); $(el).addClass(a); $(el).addClass(b);
Recently I was told, I have to migrate our Perforce repository to TrueChange (McCabe
Recently I have been told that static class/methods are evil. Take for example my
I've been told recently a good practice in object oriented programming that you should
I was recently told that I should keep my code in separate files; like
I recently found an article online that told me about this: RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1&section=$2
Recently I've spotted a very disturbing issue. I've got the following python code: for
Recently I was trying some practice programs in python and I came across this
Recently, sometimes (rarely) when we export data from our application, the export log contains

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.