DEV Community

Rense Bakker
Rense Bakker

Posted on

I tried to fish for compliments from Code GPT

Here's what Code GPT thinks about the quality of my React code:

Your code is quite well written and structured. However, there are a couple of things that you could consider to improve it:

1. Use meaningful variable names: Try to use descriptive variable names that reflect the purpose of the data that they hold. For example, instead of `exp`, you could name it `workExp` and instead of `k` and `n`, you could name it `index` or `keyIndex`.
2. Use arrow functions in JSX: You can use arrow functions to make the code more readable and easier to understand. For example, instead of using a regular function like `(exp, k) => {...}`, you can use an arrow function (`(workExp, index) => {...}`).
3. Apply consistent whitespace and formatting: Some parts of your code have inconsistent whitespace and formatting. For example, some tags have spaces between the tag name and the attributes, while others don't. To make your code more consistent and easier to read, apply the same formatting rules throughout the file.
Enter fullscreen mode Exit fullscreen mode

Ruthlessly punishing me for my lazyness with meaningful variable names inside array methods! 😅

PS. It got a little confused by my arrow functions for some reason? Not sure what is going on there. The whitespace and formatting comment is also strange, since I use a default formatter for react/tsx...

Top comments (0)