- After creating a function, don't just start typing out the code, first write down the tasks needed to be done with comments, then tackle each comment.
For example:
async function createSnippet(){
//This needs to be a server action
//Check user's inputs and make sure they are valid
//Create a new record in the database
//Redirect the user to a page, like root page.
}
- Write down your plan and approach for solving the problem with comments first before writing the code.