Tái cấu trúc đoạn mã này để dễ đọc hơn
A ready-to-use “Lập trình” AI prompt template, designed and tested with Cursor. Replace the (bracketed) parts below with your own needs.
Prompt template
Hãy tái cấu trúc đoạn mã dưới đây để dễ đọc và dễ bảo trì hơn: 1) cải thiện cách đặt tên; 2) chia nhỏ các hàm quá dài; 3) loại bỏ trùng lặp; 4) giữ nguyên hành vi. Sau đó, giải thích bạn đã thay đổi gì và tại sao, và kèm theo toàn bộ mã đã tái cấu trúc. Mã: ``` dán mã vào đây ```
How to use this prompt
- Copy the whole prompt above and paste it into Cursor or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.
Recommended tool: Cursor — A code editor built for AI.