Below are some tips or tricks when building application with Cursor. These lessons are based on my recent experience while building a Sudoku game (just wanna test Cursor's capability).
- Do commit frequently. Recommend doing commit for every big change (a new feature such as a new button added for some function, some big UI change like added some new component changing the UI layout a bit)
- Test everything (regression testing) after doing big change. It may affect existing functions when adding new features, you think the change should not impact other parts, but it may not be the case.
- Using Composer instead of Chat if trying to add a new complete feature including changes to multiple places (FE, BE etc).
- Write the skeleton yourself. One recommendation is you write the skeleton yourself, then ask Cursor to fill in the missing components. For example, you are writing a game, you should write the game board div, the game ctrl div, the status div, then ask Cursor to fill in each part. Avoiding writing everything (especially when you have built some features already).
- Giving instructions clearly. Use bullet points and state clearly about the requirements (write the step-by-step instructions) would have better result.
I am going to implement a sudoku game, please help with below requirements: 1. the game board should have grid borders 2. The game should have different difficulty levels(easy, medium, hard) 3. The game should be mobile friendly ...
- Try to understand the code generated. Please don't just rely on it to generate the code, when find it is working as expected, great, but don't forget to try to understand the code it generates, otherwise it would be difficult for you to debug and maintain the code as you may end up with regenerating everything again when something new is needed.
- Reset session when necessary. Sometimes we would see the answer diverted away from our original expectation and not be able to circle back after a few follow ups. It is a good time to start a new session and instruct it all over again.
The list would become lengthier and lengthier with more touch on Cursor. Also, you can share your tips as well.
The general recommendation is to avoid relying solely on Cursor or other AI-assisted editors for development, particularly if you are an experienced developer. It’s better to write code yourself and use these AI tools only when needed, such as for building a proof of concept (POC) or minimum viable product (MVP). Additionally, be cautious about advertisements claiming you can build an app in just five minutes—they can be misleading.