Skip to content

Code review E: examples polish#141

Merged
Chris-Wolfgang merged 2 commits into
vNextfrom
stack/cr-e-examples-polish
Jun 3, 2026
Merged

Code review E: examples polish#141
Chris-Wolfgang merged 2 commits into
vNextfrom
stack/cr-e-examples-polish

Conversation

@Chris-Wolfgang
Copy link
Copy Markdown
Owner

Collapses 8 near-duplicate WriteLine blocks per example file to a 4-element int[] + two foreach loops. Also fixes inconsistent column padding (manual spaces → format alignment), switches the net462 example from + string concat to interpolation (C# 6, supported on net462 since 2015), and cleans up a stray blank line + double-newline in the net8 example.

Pure example polish — no library changes. Both example projects build clean in Release.

Stacked on vNext (PR #129).

…review group E)

Both example Programs had 8 near-duplicate Console.WriteLine lines
each (one per test value, twice — IsBetween then IsInRange). Collapsed
to a 4-element int[] + two foreach loops. The example reads as a
single pattern, not eight near-duplicates.

Also:
- DotNet462: uses '+' string concat. .NET Framework 4.6.2 supports
  C# 6 string interpolation; switched to interpolated strings with
  format alignment ({value,2}) to make the column line up without
  the manual '  ' vs '   ' padding the old code used.
- DotNet8: dropped the stray blank line after the opening brace,
  switched 'Console.WriteLine("\n")' (which prints two newlines)
  to 'Console.WriteLine()' for one separator line, and used a
  collection expression '[1, 2, 9, 10]' since the example targets
  net8.0.

Both example projects still build clean in Release.
Copilot AI review requested due to automatic review settings June 2, 2026 17:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR polishes the example console apps by reducing duplicated output code and standardizing the formatting of the example output, without changing the library itself.

Changes:

  • Refactors repeated Console.WriteLine blocks into a shared int[] + two foreach loops per example.
  • Standardizes value column padding using format alignment instead of manual spacing.
  • Cleans up newline usage (e.g., replacing "\n" + WriteLine with WriteLine()).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
examples/Wolfgang.Extensions.IComparable.DotNet8.Example1/Program.cs Deduplicates output and normalizes formatting/newlines for the .NET 8 example.
examples/Wolfgang.Extensions.IComparable.DotNet462.Example1/Program.cs Deduplicates output and normalizes formatting (including interpolation/alignment) for the .NET Framework 4.6.2 example.

@Chris-Wolfgang Chris-Wolfgang merged commit 0aedb43 into vNext Jun 3, 2026
1 check passed
@Chris-Wolfgang Chris-Wolfgang deleted the stack/cr-e-examples-polish branch June 3, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants