Preheat your oven to 350°F (175°C).
Grease and flour a 9x13 inch baking pan.
In a large mixing bowl, cream the softened butter and granulated sugar together until light and fluffy.
Add in the eggs one at a time, mixing well after each addition.
Mix in the crushed pineapple and vanilla extract.
In a separate bowl, whisk together the flour, baking powder, and salt.
Gradually add the dry mixture to the wet mixture, stirring until just combined.
If using, fold in the shredded coconut.
Pour the batter into the prepared baking pan and smooth the top.
Bake for 30-35 minutes, or until a toothpick inserted in the center comes out clean.
Once baked, let the cake cool in the pan for 10 minutes before transferring it to a wire rack.
Allow the cake to cool completely before frosting, if desired.