Skip to content
The Latent Daily
The Latent Daily

Sections

News & Industry
Knowledge & Learning
Research & Science
Tools, Software & Models
Developers & Builders
Hardware & Infrastructure
Society, Policy & Ethics
AI in Industries
People & Community
Special Formats

Tag

#Software Quality

Software Quality on The Latent Daily: 2 prompts. News, explainers and guides on Software Quality, each linked to its sources.

2 items

Prompts tagged #Software Quality

Codingintermediate

Refactor code for readability without changing behavior

You are a senior [LANGUAGE] engineer. Refactor the code below for readability and maintainability. Context: - What the code does: [PURPOSE] - Language and framework version: [e.g. "Python 3.12, Django 5"] - Style guide or linter: [e.g. "PEP 8, ruff defaults"] - Parts that must not change: [e.g. "public function signatures", "log messages parsed by monitoring"] Hard rule: the external behavior must stay identical. Same inputs, same outputs, same side effects, same exceptions. Do not fix bugs silently; if you find one, list it separately. Work in this order: 1. Summarize what the code does in 3-5 bullet points so I can confirm you understood it. 2. List the readability problems you see (naming, long functions, deep nesting, duplication, magic numbers, unclear control flow). 3. Propose a sequence of small refactoring steps, each one safe on its own (e.g. "extract function", "rename variable", "replace nested ifs with early returns"). 4. Show the final refactored code. 5. List any behavior that could change by accident (ordering, floating point, mutability, error types) and the tests I should run or add to confirm nothing changed. 6. Under "Possible bugs found", list issues you noticed but did not fix. Code: ``` [PASTE CODE] ```

Works with: ChatGPT, Claude, Gemini, GitHub Copilot Chat

Codingintermediate

Structured code review with a severity checklist

You are a senior [LANGUAGE] engineer doing a code review. Review the code below. Context: - What the code is supposed to do: [PURPOSE] - Where it runs: [e.g. "public web API", "internal batch script"] - Project conventions: [STYLE GUIDE, FRAMEWORK, VERSION] - Focus areas, if any: [e.g. "security", "performance"] Check the code against this list, in order: 1. Correctness: logic errors, edge cases (empty input, null, large values), off-by-one errors. 2. Security: input validation, injection, secrets in code, unsafe deserialization, permissions. 3. Error handling: failures that are swallowed, unclear error messages, missing cleanup. 4. Performance: unnecessary loops, repeated I/O, N+1 queries, memory growth. 5. Readability: naming, function length, duplicated code, missing comments where logic is non-obvious. 6. Tests: what is untested and which test cases you would add. Output format: - A table: # | Severity (blocker/major/minor/nit) | Line(s) | Issue | Suggested fix - Then up to 3 code snippets showing the most important fixes. - Then "What is good": 2-3 things worth keeping. Rules: only report issues you can point to in the code. If something depends on code you cannot see, list it under "Questions for the author" instead of guessing. Code: ``` [PASTE CODE OR DIFF] ```

Works with: ChatGPT, Claude, Gemini, GitHub Copilot Chat