Preheat the oven to 350°F (175°C). Grease an 9x9 inch baking pan with oil or butter, then line it with parchment paper.
Mix the all-purpose flour, baking soda, and spices in a large bowl.
Add the eggs, sugars, oil, and vanilla in a separate bowl and give them a whisk.
Slowly pour the wet ingredients into the dry ingredients and mix until combined.
Fold in the grated carrots and gently mix just until combined.
Pour the carrot cake batter into the prepared pan and bake for 35-40 minutes.
Let the cake cool in the pan for 10-15 minutes, remove it from the pan, and let it cool completely on a wire rack.
While the cake is cooling, prepare my favorite frosting recipes.
The cake has to be completely cooled before adding this frosting, or it will melt off. If you need, place it in the freezer for 10 minutes to cool. I do this sometimes, and it always works out. Once the cake has cooled, spread the frosting on top and decorate with chopped walnuts, if desired.
Slice and serve the cake at room temperature for best flavor and texture.