python icon indicating copy to clipboard operation
python copied to clipboard

[Exercise Approaches]: Audit/Cleanup of Track Approaches 2026 (part 2)

Open Yrahcaz7 opened this issue 6 months ago • 30 comments

This is a tracking issue for existing approaches on the Python track. (Part 1 of the audit/cleanup was issue #4055.)

In general, we are auditing/reviewing the following:

  • Spelling, grammar, and typos
  • Python syntax
  • Clarity of writing and explanation
  • Readability and maintainability
  • White space
  • Other Exercism markdown specifications as needed
  • Possible missing/additional approaches (noted as TODOs of future work)

See the lists for each category below. Exercises in "Merged Audits" have been reviewed, changed, and merged. Exercises in "Unaudited" have approaches that have not been audited yet.

Exercises in "Approaches In Progress" do not have finished/published approaches yet, while those in "Missing Approaches" do not have any known work on their approaches yet.

If you want to work on an exercise that is missing an approach, please check in with the maintainers to avoid conflicting with current track priorities or others who may be working on things.

Merged Audits
  • Acronym: #4258
  • Atbash Cipher: #4191
  • Collatz Conjecture: #4250
  • Darts: #4187
  • Leap: #4252
  • Reverse String: #4226
  • RNA Transcription: #4052 and #4191
  • Robot Name: #4051
  • Roman Numerals: #4289 and #4300
  • Rotational Cipher: #4184
  • Sublist: #4190
  • Wordy: #4198
Unaudited
  • All Your Base
  • Bob: PR forthcoming
  • Circular Buffer
  • DnD Character
  • Flower Field (formerly Minesweeper)
  • Grains
  • Hamming
  • Isogram
  • Luhn
  • Matching Brackets
  • Nth Prime
  • Palindrome Products
  • Pangram
  • Pig Latin
  • Raindrops: PR #4308
  • Scrabble Score
  • Sieve
  • Yacht
Approaches In Progress
  • Allergies
  • Anagram
  • Armstrong Numbers
  • Book Store
  • ETL: #3378
  • Gigasecond: #3772
  • ISBN Verifier
  • Markdown
  • Matrix
  • Perfect Numbers
  • Protein Translation
  • Robot Simulator
  • Saddle Points
  • Say
  • Space Age
  • Sum Of Multiples: #3375
  • Transpose
  • Triangle
  • Word Count: #3371
Missing Approaches
  • Affine Cipher
  • Alphametics
  • Bank Account
  • Binary Search
  • Binary Search Tree
  • Bottle Song
  • Bowling
  • Change
  • Clock
  • Complex Numbers
  • Connect
  • Crypto Square
  • Diamond
  • Difference Of Squares
  • Diffie Hellman
  • Dominoes
  • Dot DSL
  • Flatten Array
  • Food Chain
  • Forth
  • Go Counting
  • Grade School
  • Grep
  • Hangman (to be replaced by Save the Cow)
  • High Scores
  • House
  • Kindergarten Garden
  • Knapsack
  • Largest Series Product
  • Ledger
  • Linked List
  • List Ops
  • Meetup
  • OCR Numbers
  • PaaS I/O
  • Phone Number
  • Poker
  • POV
  • Prime Factors
  • Proverb
  • Pythagorean Triplet
  • Queen Attack
  • Rail Fence Cipher
  • Rational Numbers
  • React
  • Rectangles
  • Resistor Color
  • Resistor Color Duo
  • Resistor Color Trio
  • Rest API
  • Run Length Encoding
  • Satellite
  • Scale Generator
  • Secret Handshake
  • Series
  • SGF Parsing
  • Simple Cipher
  • Simple Linked List
  • Spiral Matrix
  • Tournament
  • Tree Building
  • Twelve Days
  • Two Bucket
  • Two Fer
  • Variable Length Quantity
  • Word Search
  • Zebra Puzzle
  • Zipper

Yrahcaz7 avatar May 21 '26 01:05 Yrahcaz7

@gjbbcjj The changes to the Acronym exercise were already PR'd.

BethanyG avatar Aug 17 '26 23:08 BethanyG

@kyliekamesha26 - I'm sorry, but this issue is closed to contributions from anyone but Yrahcaz7, who was originally assigned to it.

BethanyG avatar Sep 10 '26 22:09 BethanyG

Roman Numerals Dig Deeper audit
  • Overall:

    • "Loop over Romans" does not make sense, it should be changed to "Loop over Roman Numerals".
  • introduction.md:

    • Line 20: "concept" should probably be "process" or similar.
    • Lines 20-24: This paragraph should be made more generic; right now it seems to focus too much on the "With if conditions" approach.
    • Lines 24 and 95 should probably be separated from the last list item.
    • Line 91 is missing punctuation at the end.
    • Line 92 is a bit awkward.
    • Line 122: This is an odd place for the link, perhaps it should be moved to line 133.
    • Lines 135-147 should probably be reworded to use a link to the relevant lines instead of a codeblock.
    • Lines 175-180: This codeblock is formatted in a way that is very hard to read.
    • Line 179 uses double quotes.
    • The introduction is missing a section that links to the itertools.starmap() approach.
  • if-else/content.md, if-else/snippet.txt, and introduction.md:

    • This approach uses type hints, which are usually not included. It also has unnecessary assertions.
  • if-else/content.md:

    • Lines 17, 20, 22, 24, 26, and 35: There is an extra space after the +=.
    • Lines 28 and 37: There is an extra space after the second >.
    • The first codeblock has unnecessary > 0 and > 4 comparisons.
    • Line 49: This paragraph does not actually explain how the approach works.
    • Line 61 needs more explanation.
    • Line 64 is missing a serial comma in "hundreds, tens and units".
    • Line 69 does not make much sense where it is currently, so it should be moved to after the codeblock.
  • table-lookup/content.md, table-lookup/snippet.txt, and introduction.md:

    • This approach uses single letter variable names (that are not roman numerals). It also has an unnecessary assertion.
  • table-lookup/content.md:

    • Perhaps the comments could be merged into the rest of the explanation.
    • Line 17 (75 in introduction.md): "we need" should be "get" and "our" should be "the".
    • Line 34: This header should be "Variation 1" or similar.
  • loop-over-romans/snippet.txt:

    • This snippet uses single letter variable names (that are not roman numerals).
    • Line 2 (line 30 in loop-over-romans/content.md) has an unnecessary assertion.
    • Line 3 uses double quotes (quoting should be consistent per exercise, if I remember correctly).
  • loop-over-romans/content.md:

    • This approach uses type hints.
    • The exact workings of most of the variants are not explained.
    • There are no headers separating the variants.
    • Line 19: "Arabic (decimal)" should be "Arabic (decimal) numbers".
    • Lines 25-27, 70, and 89 use double quotes.
    • Lines 33-36 and 55-57 use single letter variable names (that are not roman numerals).
    • Line 40: "the" is unnecessary here.
    • Lines 44 and 45 have inconsistent spacing.
    • Lines 48 and 74 have docstrings.
    • Line 66: "1, 5, 10" should be "1, 5, and 10".
    • Line 69 is missing a serial comma in "10's, 5's and 1's".
    • Line 97: "is doing" should probably be "does".
    • Line 113 does not apply to the last variant. This should be clarified.
    • Line 113: There is a missing space after "while".
    • Line 117 is a bit awkward, changing "so need" to "so they need" should improve it.
    • Lines 121-124 should probably either be:
      • removed entirely, or
      • moved to a single variant (and preserve the type hints on only that variant) and also have links to resources about type hinting.
    • If it is kept, these should be fixed:
      • Line 122: There should be an "is" after the "and".
      • Line 124: "IDE's" should be "IDEs". Also, the subject of whether VSCode is an IDE should probably be avoided.
  • recurse-match/content.md, recurse-match/snippet.txt, and introduction.md:

    • This approach uses type hints.
    • The comma in [ROMAN_NUM[idx],] is unnecessary, as it is a single-element list, not a tuple.
    • The last case (case [num, idx, digits]:) can be changed to a default case (case _:).
  • recurse-match/content.md:

    • Lines 5, 38, 39, and 50 (line 155 in introduction.md) use double quotes.
    • Line 22: The first part of this sentence could be improved to: "A major limitation is the lack of tail-call optimization".
    • Line 26 has an extra space before the ending period.
    • Line 41 has an extra space after convert.
    • Lines 44-46: It is not clear what the ltr variable represents from its name. It should probably be renamed to roman_val or similar.
    • Line 57: This link is invalid as it uses loop-over-roman instead of loop-over-romans.
  • itertools-starmap/content.md and itertools-starmap/snippet.txt:

    • This approach uses type hints, single letter variable names, and double quotes.
  • itertools-starmap/content.md:

    • Line 50 is a bit awkward; perhaps it could be changed to: "Roman numerals for 5,000 and 10,000 are not defined, so spaces are used here instead."
    • Line 63: There should be a comma after "For example".
    • Line 71: "compute" should probably be "compute()".
  • config.json:

    • Line 23: "Numerals" should be lowercased here.
    • Line 53: Maybe "the recently-introduced" should be removed, as Python pattern matching has been around for almost 5 years now.

@BethanyG, can I open a PR to fix these? (Or perhaps 2 separate ones due to the amount?)

Yrahcaz7 avatar Sep 14 '26 01:09 Yrahcaz7

Hi @Yrahcaz7 👋🏽

@BethanyG, can I open a PR to fix these? (Or perhaps 2 separate ones due to the amount?)

Apologies for the delay in replying. Go for it. Maybe two groups: The straight-up typos, whitespace, and punctuation-related stuff. And a second one for rephrases and other more substantial edits? Many thanks for working on this!

BethanyG avatar Sep 15 '26 18:09 BethanyG

I can take a look at auditing Circular Buffer next, specifically ensuring we cover the trade-offs between using a

jonahwhite115 avatar Sep 27 '26 22:09 jonahwhite115

Raindrops Dig Deeper audit
  • Overall:

  • introduction.md:

    • Line 8: "many" is duplicated in "many many variations".
    • Line 16 is missing punctuation at the end.
    • Line 27 is missing a serial comma in "(3, 5 or 7)".
    • Line 28 is missing a space between 'Plong' and (7).
    • Line 38: "code" should be "the code" here.
    • Line 88: "f-string" should be "f-strings" here.
    • Line 91: A comma is unnecessary here.
    • Line 134: "tuple with join" should be "sequence with join".
    • Line 153: "factor -> sound mappings" would be clearer as "factor to sound mappings". It might also be helpful to provide the generator expression link again.
    • Line 154: "'results'" should be "results" here.
    • Line 205: This link should be to approach-itertools-compress, not itertools-compress.
    • Line 211 has unnecessary parentheses around number % factor.
    • Line 233: To clarify that this does not include the approach in the "Other Approaches" section, "All approaches" should be changed to "All 7 approaches".
    • Lines 235-239: This paragraph is rather large and would benefit from splitting.
    • Line 245: The comment has no space after the # and has an extra space before "Unless".
    • Line 262: n is usually used for big-O notation instead of m when there is only one factor.
  • if-statements/content.md:

    • Line 15: The "modulo" here should probably have the modulo link from introduction.md.
    • Line 16: "modulo == 0" and "sounds" should probably be surrounded with backticks.
    • Line 17: "Sounds" should be "sounds" here.
    • Line 20: The comma should either be removed or a matching comma after the "of course" should be added.
    • Line 26: A variation header would be apt here.
    • Line 28: The docs on conditional expressions could be linked here.
  • truthy-and-falsey-with-fstring/content.md:

    • Line 6: The comment is incorrect; modulo == 1 should be modulo > 0.
    • Line 12 (line 74 in introduction.md): The #OR# is indented here.
    • Line 23: The docs on f-strings should be linked here.
    • Line 23 (line 85 in introduction.md): The last comma is unnecessary.
    • Line 30 has mismatched quotes: 'Pling" should be 'Pling'.
    • Line 30: "not False" should be "is not False" here.
    • Line 31: The empty string here '' looks like a double quote when rendered on the website. Surrounding it in backticks could fix this.
  • loop-and-fstring/content.md:

    • Line 7 (line 97 in introduction.md, line 3 in loop-and-fstring/snippet.txt): Double quotes are used here, when single quotes are used in most other places.
    • Line 19 (line 108 in introduction.md): "sounds string" should be "the sounds string".
    • Line 20 (line 109 in introduction.md): "Sounds" should be "sounds".
    • Line 28: A variation header would be apt here.
  • sequence-with-join/content.md:

    • Lines 5 and 27 (line 119 in introduction.md) use double quotes.
    • Lines 9 and 30 (line 123 in introduction.md, line 6 in sequence-with-join/snippet.txt) have unnecessary parentheses around the if clause.
    • Line 16 (131 in introduction.md): "Sounds" should be "sounds".
    • Line 19: There should be a comma after "like most approaches described here".
    • Line 21: A variation header would be apt here.
    • Line 22 is phrased awkwardly; perhaps it could be changed to "The above solution might not be very readable for those not used to reading generator expressions inside calls to other functions, so if that is the case, it can be re-written as:".
  • dict-and-join/content.md:

    • Line 37: A variation header would be apt here.
    • Line 45 has unnecessary parentheses around the if clause.
    • Line 48, 49, and 52: All of these links now redirect here (with the appropriate heading).
  • itertools-compress/content.md:

    • Line 8 (line 4 in itertools-compress/snippet.txt) should either use parentheses or there should be explanation of implicit tuple creation.
    • Lines 9 and 34 (lines 166 and 173 in introduction.md, line 5 in itertools-compress/snippet.txt) have unnecessary parentheses around number % factor.
    • Line 14 should have the generator expression link.
    • Line 21 is a bit awkward, maybe it could be changed to: "The code is also harder to maintain should additional factors/sounds be needed."
    • Line 39 is a bit awkward, maybe it could be changed to: "In this variation, factors are keys and the sounds are values in a dictionary."
  • functools-reduce/content.md:

    • Lines 9 and 31 (line 166 in introduction.md, line 5 in functools-reduce/snippet.txt) have unnecessary parentheses around number % factor.
    • Line 9: The comment has no space after the #.
    • Line 23: "as the factor list expands" should be "if the factor list is expanded".
    • Line 32 has unnecessary parentheses around item[0] * item[1].
  • The performance article:

  • The performance article's snippet.md:

    • All columns past "14" can't be seen on the website (but they are still rendered in the HTML, so removing them may slightly decrease load time). Additionally, the website does not render any borders for the snippet's table, so it is hard to tell when one column ends and begins.
    • The data appears to be outdated (it seems like the article's data was changed in PR #3620, but not in the snippet).

@BethanyG, can I open a PR for these? (There's quite a few audit items, but only a couple of them need prose rewording.)

Yrahcaz7 avatar Oct 14 '26 01:10 Yrahcaz7

@BethanyG, can I open a PR for these? (There's quite a few audit items, but only a couple of them need prose rewording.)

Go for it! 😄

BethanyG avatar Oct 14 '26 17:10 BethanyG

I am planning to audit the All Your Base approach documentation; should I prioritize updating the conversion logic explanation for multi-base edge cases before touching the formatting?

damianoecker26 avatar Oct 16 '26 21:10 damianoecker26

@damianoecker26, please see this comment.. Thanks.

BethanyG avatar Oct 16 '26 22:10 BethanyG

@edinakama - did you not see the comment above? Please respect that. Thanks,

BethanyG avatar Oct 19 '26 19:10 BethanyG

Regarding the Unaudited list, should I prioritize All Your Base to align with the existing style guide for functional decomposition, or is there a specific target for how to handle the base conversion logic in the approaches doc?

brokendenim avatar Oct 20 '26 04:10 brokendenim

@brokendenim - As I said to @edinakama -- please read this comment. Thanks.

BethanyG avatar Oct 20 '26 04:10 BethanyG