Preheat the oven to 350°F. Grease a 10" x 5" x 3 1/2" loaf pan and set aside.: When the oven temperature reaches 350°F you should notice a subtle warmth and faint oven odor, a reliable signal that the environment is steady for rising. Greasing the pan ensures the loaf releases cleanly, and I often line the pan with parchment for extra insurance. A common mistake is skipping the grease or lining, which can make removal difficult and tear the crust. If your oven runs hot, use an oven thermometer to confirm accuracy, because an overheated oven will brown the exterior too fast while leaving the center underdone.
In a large bowl, whisk together the sugars, flour, baking powder, baking soda, salt, and nutmeg. Set aside.: As you whisk, you will see the dry mix transform into a homogenous, pale mixture with flecks of nutmeg. This step disperses leaveners evenly so the loaf rises uniformly. If you skip thorough mixing you may find pockets of baking soda or powder, which can create uneven rise or small metallic spots. A whisk or sift works fine; aim for even color and texture in the bowl.
In a separate large bowl, whisk together the eggs and vanilla and combine with the mashed bananas.: Whisking the eggs and vanilla creates a smooth, glossy base that the bananas will blend into. When the mashed bananas join, the mixture becomes thick and fragrant, with visible banana strings and a sweet aroma. If your bananas are overly cold, the mixture may feel lumpy; bring them to room temperature for a smoother emulsion. Overbeating here is less risky than overmixing once flour is added, but aim to combine until uniform.
Pour the wet ingredients over the dry ingredients and mix together until just combined. Stir in the melted butter until fully incorporated. Fold in the well-drained pineapple and coconut (if using) until fully incorporated.: After combining the bowls, you will notice the batter change from floury to glossy, with streaks disappearing as you fold. The goal is a unified batter with some texture from the fruit, not a perfectly smooth cake batter. Adding the cooled melted butter smooths and enriches the batter, while folding in the drained pineapple and optional coconut distributes moist pockets and chew. A frequent error is overmixing at this stage, which develops gluten and yields a tough loaf; stop when you no longer see dry streaks.
Pour the batter into prepared pan and sprinkle the top with coarse sugar. Bake until golden brown and a cake tester inserted in the center of the loaf comes out clean, about 1 hour and 10 minutes. Allow to cool for 20 minutes before slicing.: As the loaf bakes you will see the top turn from pale to golden and small cracks appear, a sign of even rise. The aroma will shift from sugary to toasty, with tropical notes wafting from the oven. Insert a cake tester in the center near the end of the bake; a clean tester indicates the crumb has set. Avoid opening the oven repeatedly early on, because temperature shifts can cause sinking. If the top browns too quickly, tent with foil to finish baking without burning.
Allow to cool for 20 minutes before slicing: Cooling lets the crumb set and redistributes steam so slices are neat and not gummy. You will notice the bread relax and the aroma mellow in this period. Cutting too soon can compress the loaf and create a dense texture, so patience pays off. After cooling, invert or lift the loaf from the pan and rest on a rack for the best slicing experience.