Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replace multi-line string concatenations with text blocks for better readability #21417

Description

@ivamly

I noticed that string concatenation is frequently used (here, for example) where text blocks would be much more readable and maintainable.

I suggest replacing these cases with text blocks.

I'd like to propose the following steps:

  1. Find all uses — Identify all instances of string concatenation.
  2. Analyze each case — Determine whether each case is a good candidate for a text block or if a StringBuilder would be more appropriate.
  3. Set up a linting rule — (Optional) Consider adding a checkstyle rule (or similar) to prevent using concatenation in the future.
  4. Create a list of violations — Provide a list of files/methods that need to be changed, so the work can be split or tracked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions