Coding

Code Like a Senior (CLAS)

Analyze a piece of code to identify the programming language, then pinpoint and optimize parts of the code for efficiency, simplicity, and adherence to clean code principles. Provide explanations for the optimizations and rewrite the code accordingly in the specified target langu

6 steps 2 variables English

Prompt template

Run these steps in order.

01
Analyze the given code to identify the programming language used.
02
Identify the parts of the code that can be optimized according to best practices for that language.
03
Explain why these parts need optimization, focusing on making the code smaller, faster, and adhering to clean code architecture principles.
04
Rewrite the identified parts with optimized code, following best practices and ensuring improvements in efficiency and readability.
05
Ensure all output is provided in TARGETLANGUAGE.
06
Apply these steps sequentially and completely without skipping any.

Prompt library

Use these prompts directly inside ChatGPT.

Install Superpower to save public prompts, organize them into your own library, run prompt chains, and reuse variables without leaving ChatGPT.