Searching the best prompts from our community
Discover the most effective Best Practices prompts. High-quality templates curated by experts to help you get professional AI results.
Secure your applications against common vulnerabilities. OWASP Top 10: 1. Injection (SQL, NoSQL, OS commands - use parameterized queries). 2. Broken Authentication (implement MFA, secure password storage with bcrypt). 3. Sensitive Data Exposure (encrypt data at rest and in transit, HTTPS). 4. XML Ex...
Create a production-quality Jupyter notebook template. Structure: 1. Markdown header with title, author, date, and objective. 2. Table of contents with anchor links. 3. Environment setup cell (imports, configs, random seed). 4. Exploratory Data Analysis section with visualizations. 5. Modeling secti...
Write maintainable code using SOLID principles. Principles: 1. Single Responsibility (class has one reason to change). 2. Open/Closed (open for extension, closed for modification). 3. Liskov Substitution (subclasses should be substitutable for base classes). 4. Interface Segregation (many specific i...
Conduct thorough code reviews with this checklist. Areas to review: 1. Functionality (does it work as intended? edge cases handled?). 2. Code quality (readable, maintainable, follows style guide). 3. Tests (adequate coverage, meaningful assertions). 4. Performance (no obvious bottlenecks, efficient ...
Write effective code documentation. Levels: 1. Code comments (explain why, not what - complex logic only). 2. Function/method docs (parameters, return values, exceptions - JSDoc, docstrings). 3. README (setup, usage, examples). 4. API documentation (OpenAPI/Swagger for REST). 5. Architecture docs (s...
Act as a senior software engineer. Take the following code snippet and refactor it for better readability, performance, and maintainability. Explain the changes you made and why.
Act as a peer reviewer for my code. I will provide a pull request link or a code snippet. Please review it for potential bugs, style inconsistencies, performance issues, and security vulnerabilities. Provide constructive feedback and suggest specific improvements.
Explain the "Singleton" design pattern. What problem does it solve? Provide a code example of how to implement it in Java or Python. Discuss its pros and cons, and when it is appropriate to use.
Take the following C-style for-loop in Python and rewrite it in a more "Pythonic" way. Explain why the Pythonic version is preferred. Original code: `for i in range(len(my_list)): print(my_list[i])`
Explain the "Single Responsibility Principle" (SRP) from the SOLID principles of object-oriented design. Provide a simple "before" code example in C# or Java that violates SRP, and then show an "after" example that refactors the code to adhere to the principle.
What is the best practice for managing environment variables (e.g., API keys, database passwords) in a Node.js project? Explain the use of `.env` files and the `dotenv` package. Provide an example of how to load and access variables from a `.env` file.