Prep the tin. Line a 9x13-inch (23x33 cm) traybake tin with baking paper, leaving an overhang for easy lifting. Lightly grease the sides.
Heat the oven to 170°C (150°C fan) or 340°F.
Cream butter and sugar. In a large bowl, beat the softened butter and caster sugar together until pale and fluffy, about 2–3 minutes with an electric mixer. This traps air and helps the cake rise evenly.
Add the eggs. Beat in the eggs one at a time, mixing well after each addition. If the mixture looks slightly curdled, don’t worry—it will come together once the flour is added.
Mix in vanilla. Add the vanilla extract and beat briefly to combine.
If using a pinch of salt, add it now.
Fold in flour. Sift the self-raising flour over the bowl. Gently fold it in with a spatula until just combined. If the batter seems very thick, stir in 1–3 tablespoons of milk to reach a soft, spreadable consistency.
Spread and level. Transfer the batter to the lined tray and spread it into the corners.
Smooth the top with an offset spatula or the back of a spoon.
Bake. Place in the center of the oven and bake for 22–28 minutes, or until the top is golden and a skewer inserted into the middle comes out clean.
Cool. Let the traybake cool in the tin for 10 minutes. Lift it out using the paper and transfer to a wire rack to cool completely before slicing.
Slice and serve. Cut into squares or bars. Enjoy plain, dusted with icing sugar, or with a thin vanilla glaze.