Improve the following code
This is a ready-to-copy More prompt, “Improve the following code”. Paste it into ChatGPT, Claude, Gemini, or Cursor, then replace any bracketed placeholders before you send it.
Prompt
Improve the following code
```
${selectedText}
```
Please suggest improvements for:
1. Code readability and maintainability
2. Performance optimization
3. Best practices and patterns
4. Error handling and edge cases
Provide the improved code along with explanations for each enhancement.