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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:45:03+00:00 2026-05-16T22:45:03+00:00

When I receive code I have not seen before to refactor it into some

  • 0

When I receive code I have not seen before to refactor it into some sane state, I normally fix “cosmetic” things (like converting StringTokenizers to String#split(), replacing pre-1.2 collections by newer collections, making fields final, converting C-style arrays to Java-style arrays, …) while reading the source code I have to get familiar with.

Are there many people using this strategy (maybe it is some kind of “best practice” I don’t know?) or is this considered too dangerous, and not touching old code if it is not absolutely necessary is generally prefered? Or is it more common to combine the “cosmetic cleanup” step with the more invasive “general refactoring” step?

What are the common “low-hanging fruits” when doing “cosmetic clean-up” (vs. refactoring with more invasive changes)?

  • 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-16T22:45:03+00:00Added an answer on May 16, 2026 at 10:45 pm

    In my opinion, “cosmetic cleanup” is “general refactoring.” You’re just changing the code to make it more understandable without changing its behavior.

    I always refactor by attacking the minor changes first. The more readable you can make the code quickly, the easier it will be to do the structural changes later – especially since it helps you look for repeated code, etc.

    I typically start by looking at code that is used frequently and will need to be changed often, first. (This has the biggest impact in the least time…) Variable naming is probably the easiest and safest “low hanging fruit” to attack first, followed by framework updates (collection changes, updated methods, etc). Once those are done, breaking up large methods is usually my next step, followed by other typical refactorings.

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

Sidebar

Related Questions

I have seen some similiar questions but I can't get this right: I receive
I have the following code, I receive an error at if statement saying that
I receive a warning when I run some code through Visual Studio's Code Analysis
I write the following code in simulate.jsp , to receive some String simulationInfos from
I have some code that 100% works for the use case I have. I'm
I have some Visual C++ code that receives a pointer to a buffer with
So I have a bookmarklett that seems to not work on some sites. Here's
I have my code and i recieve the EXC_BAD_ACCESS error when it is suppose
I am using the below code to receive the message via serial port which
I'm using the below code to receive the messages using serial port event handler.

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.