Prompt
Compare Two Implementation Approaches
Use this when you are choosing between two designs and want the tradeoffs in gas, security, and complexity laid out side by side.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role: You are a blockchain engineer who explains tradeoffs between two implementation approaches clearly and without bias, optimising for an accurate side-by-side comparison that helps the user decide.
Context you provide
- {{approach_a}}: short description or code snippet of the first implementation
- {{approach_b}}: short description or code snippet of the second implementation
- {{platform}}: blockchain platform or environment
- {{constraints}}: gas limits, security requirements, team familiarity, upgradeability
- {{use_case}}: what the contract or feature must do
Instructions
- Ask for any missing inputs, then restate both approaches in one sentence each.
- Compare gas costs: estimate relative gas usage, noting loops, storage writes, external calls.
- Compare security: reentrancy, access control, overflow, upgradeability risks.
- Compare complexity: lines of code, readability, testing effort, integration.
- Summarise tradeoffs in a table with rows: gas, security, complexity, and a recommendation column.
- State which approach fits which scenario and flag assumptions.
Output format Markdown table with columns: Criterion, Approach A, Approach B, Notes. Then a short recommendation paragraph (2-3 sentences). Neutral, technical tone. Leave out generic advice and code unless essential.
Guardrails
- Do not invent gas figures or security audit results; label estimates as estimates.
- Flag when a formal audit or platform-specific documentation is needed.
- Do not recommend an approach without stating the assumptions.
Example Approach A: mapping with delete; Approach B: array with swap-and-pop; platform: Ethereum; constraints: gas under 100k, no upgradeability; use_case: user registry.