In a mixing bowl, whisk together the sugar, flour, and a pinch of salt.
In a saucepan, heat the milk over medium heat until warm.
Gradually add the milk to the dry ingredients, whisking constantly.
Return the mixture to the saucepan and cook over medium heat, stirring constantly, until thickened.
Remove from heat and stir in the beaten eggs, butter, and vanilla extract.
In a baking dish, layer the vanilla wafers, sliced bananas, and pudding mixture.
Repeat layers, ending with the pudding mixture on top.
Chill in the refrigerator for at least 2 hours before serving.